summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar D.V.N <sravank1@codeaurora.org>2014-08-28 14:54:25 +0530
committerSteve Kondik <shade@chemlab.org>2014-09-18 22:17:50 -0700
commit2173e3201d7cb729b0faccc366c406deacd209f9 (patch)
tree94e245097353cb6aa62b1369417d518050e4ab10
parentebdaf884e92db4201183c93ea593b765c6914dcd (diff)
downloadandroid_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.cpp29
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);
+ }
}
}
}