Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 81c57b31 authored by Arun Kumar K.R's avatar Arun Kumar K.R Committed by Gerrit - the friendly Code Review server
Browse files

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
parent c57c920c
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
@@ -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;
+1 −0
Original line number Diff line number Diff line
@@ -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;
    };

    /*