From 0e898965c31abd6a861c0af3223f0759b1a4ef6d Mon Sep 17 00:00:00 2001 From: "Arun Kumar K.R" Date: Thu, 17 Dec 2015 13:36:49 -0800 Subject: sf: ex-sf: Remove screenshot surface from secondary displays - When rotation animation is disabled on secondary displays, remove the screenshot surface from the secondary display list, without this it would show up upside down frame on secondary. - Mark IntOnly layers as invisible on secondary displays. Change-Id: Ia859ee1c6ac7caa132c95e4f906bd2589e786fac Crs-fixed: 949263 --- .../surfaceflinger/ExSurfaceFlinger/ExSurfaceFlinger.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/services/surfaceflinger/ExSurfaceFlinger/ExSurfaceFlinger.cpp b/services/surfaceflinger/ExSurfaceFlinger/ExSurfaceFlinger.cpp index 3579abb..0014e80 100644 --- a/services/surfaceflinger/ExSurfaceFlinger/ExSurfaceFlinger.cpp +++ b/services/surfaceflinger/ExSurfaceFlinger/ExSurfaceFlinger.cpp @@ -138,6 +138,18 @@ bool ExSurfaceFlinger::updateLayerVisibleNonTransparentRegion( layer->setVisibleNonTransparentRegion(visibleNonTransRegion); return true; } + + if (mDisableExtAnimation) { + /* Remove screenShotSurface from secondary displays when ext animation disabled */ + const int screenShotLen = strlen("ScreenshotSurface"); + if (dpy && !strncmp(layer->getName(), "ScreenshotSurface", screenShotLen) ) { + Region visibleNonTransRegion; + visibleNonTransRegion.set(Rect(0, 0)); + layer->setVisibleNonTransparentRegion(visibleNonTransRegion); + return true; + } + } + return false; } @@ -181,7 +193,8 @@ bool ExSurfaceFlinger::canDrawLayerinScreenShot( && !layer->isProtected() && !(!dispType && (layer->isExtOnly() || (isExtendedMode() && layer->isYuvLayer()))) - && layer->isVisible() ){ + && !(layer->isIntOnly() && dispType) + && layer->isVisible()){ return true; } return false; -- cgit v1.1