SurfaceFlinger: Disable rotation animation on Secondary displays

- Add support to set animating layer for HWCLayers
- After hwc_prepare, dont override the compType of a layer to
  HWC_FRAMEBUFFER if its for non-primary displays

Change-Id: Iac462778ce5fb9016290846146e62f80dcfafd5c
CRs-fixed: 922304
This commit is contained in:
Arun Kumar K.R 2015-10-07 18:27:03 -07:00 committed by Gerrit - the friendly Code Review server
parent c57c920c26
commit 81c57b3149
2 changed files with 19 additions and 3 deletions

View File

@ -36,6 +36,9 @@
#include <hardware/hardware.h>
#include <hardware/hwcomposer.h>
#ifdef QTI_BSP
#include <exhwcomposer_defs.h>
#endif
#include <android/configuration.h>
@ -692,13 +695,14 @@ status_t HWComposer::prepare() {
disp.hasFbComp = false;
disp.hasOvComp = false;
if (disp.list) {
for (size_t i=0 ; i<disp.list->numHwLayers ; i++) {
hwc_layer_1_t& l = disp.list->hwLayers[i];
for (size_t j=0 ; j<disp.list->numHwLayers ; j++) {
hwc_layer_1_t& l = disp.list->hwLayers[j];
//ALOGD("prepare: %d, type=%d, handle=%p",
// i, l.compositionType, l.handle);
if (l.flags & HWC_SKIP_LAYER) {
if ((i == DisplayDevice::DISPLAY_PRIMARY) &&
l.flags & HWC_SKIP_LAYER) {
l.compositionType = HWC_FRAMEBUFFER;
}
if (l.compositionType == HWC_FRAMEBUFFER) {
@ -987,6 +991,17 @@ public:
}
}
}
virtual void setAnimating(bool animating) {
if (animating) {
#ifdef QTI_BSP
getLayer()->flags |= HWC_SCREENSHOT_ANIMATOR_LAYER;
#endif
} else {
#ifdef QTI_BSP
getLayer()->flags &= ~HWC_SCREENSHOT_ANIMATOR_LAYER;
#endif
}
}
virtual void setDefaultState() {
hwc_layer_1_t* const l = getLayer();
l->compositionType = HWC_FRAMEBUFFER;

View File

@ -181,6 +181,7 @@ public:
virtual void setAcquireFenceFd(int fenceFd) = 0;
virtual void setPlaneAlpha(uint8_t alpha) = 0;
virtual void onDisplayed() = 0;
virtual void setAnimating(bool animating)= 0;
};
/*