diff options
author | Sravan Kumar D.V.N <sravank1@codeaurora.org> | 2014-08-28 14:54:25 +0530 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2014-09-18 22:17:50 -0700 |
commit | 2173e3201d7cb729b0faccc366c406deacd209f9 (patch) | |
tree | 94e245097353cb6aa62b1369417d518050e4ab10 | |
parent | ebdaf884e92db4201183c93ea593b765c6914dcd (diff) | |
download | android_frameworks_native-2173e3201d7cb729b0faccc366c406deacd209f9.tar.gz android_frameworks_native-2173e3201d7cb729b0faccc366c406deacd209f9.tar.bz2 android_frameworks_native-2173e3201d7cb729b0faccc366c406deacd209f9.zip |
sf: Clear FrameBuffer only if there are GLES composed layers
Clear FrameBuffer Target only if there are layers to be composed by
GLES. Otherwise, it results unnecessary gl calls and increases power
consumption in full MDP comp use cases.
Change-Id: Ib84c4fe154bb67668e4e8b8ce2f2328c55aed7c6
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 4f7b54933..e7c471615 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -2120,20 +2120,23 @@ void SurfaceFlinger::doComposeSurfaces(const sp<const DisplayDevice>& hw, const hw->eglSwapPreserved(false); } // DrawWormHole/Any Draw has to be within startTile & EndTile - if (hasHwcComposition) { - if(mCanUseGpuTileRender && !mUnionDirtyRect.isEmpty()) { - const Rect& scissor(mUnionDirtyRect); - engine.setScissor(scissor.left, hw->getHeight()- scissor.bottom, - scissor.getWidth(), scissor.getHeight()); - engine.clearWithColor(0, 0, 0, 0); - engine.disableScissor(); + if (hasGlesComposition) { + if (hasHwcComposition) { + if(mCanUseGpuTileRender && !mUnionDirtyRect.isEmpty()) { + const Rect& scissor(mUnionDirtyRect); + engine.setScissor(scissor.left, + hw->getHeight()- scissor.bottom, + scissor.getWidth(), scissor.getHeight()); + engine.clearWithColor(0, 0, 0, 0); + engine.disableScissor(); + } else { + engine.clearWithColor(0, 0, 0, 0); + } } else { - engine.clearWithColor(0, 0, 0, 0); - } - } else { - if (cur->getCompositionType() != HWC_BLIT && - !clearRegion.isEmpty()){ - drawWormhole(hw, clearRegion); + if (cur->getCompositionType() != HWC_BLIT && + !clearRegion.isEmpty()){ + drawWormhole(hw, clearRegion); + } } } } |