Bug 1015332 - Optimize frame having layers with NULL gralloc buffer. r=dwilson
☠☠ backed out by 951e3a671279 ☠ ☠
authorSushil Chauhan <sushilchauhan@codeaurora.org>
Tue, 03 Jun 2014 14:07:50 -0700
changeset 206783 2a4cde9c1130172be110db8438a6e7a8e9793a5a
parent 206782 d6c1d9adf38b4f7b09312bef01c15584d713b3b9
child 206784 10869fc4d7e776ece46f35181ee59c3f26caddaa
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdwilson
bugs1015332
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1015332 - Optimize frame having layers with NULL gralloc buffer. r=dwilson
widget/gonk/HwcComposer2D.cpp
--- a/widget/gonk/HwcComposer2D.cpp
+++ b/widget/gonk/HwcComposer2D.cpp
@@ -254,25 +254,30 @@ HwcComposer2D::PrepareLayerList(Layer* a
                 return false;
             }
         }
         return true;
     }
 
     LayerRenderState state = aLayer->GetRenderState();
     nsIntSize surfaceSize;
+    bool skipLayer = false;
 
     if (state.mSurface.get()) {
         surfaceSize = state.mSize;
     } else {
         if (aLayer->AsColorLayer() && mColorFill) {
             fillColor = true;
         } else {
             LOGD("%s Layer doesn't have a gralloc buffer", aLayer->Name());
+#if ANDROID_VERSION >= 18
+            skipLayer = true;
+#else
             return false;
+#endif
         }
     }
     // Buffer rotation is not to be confused with the angled rotation done by a transform matrix
     // It's a fancy ThebesLayer feature used for scrolling
     if (state.BufferRotated()) {
         LOGD("%s Layer has a rotated buffer", aLayer->Name());
         return false;
     }
@@ -330,18 +335,18 @@ HwcComposer2D::PrepareLayerList(Layer* a
     }
 
     HwcLayer& hwcLayer = mList->hwLayers[current];
     hwcLayer.displayFrame = displayFrame;
     setCrop(&hwcLayer, sourceCrop);
     buffer_handle_t handle = fillColor ? nullptr : state.mSurface->getNativeBuffer()->handle;
     hwcLayer.handle = handle;
 
-    hwcLayer.flags = 0;
     hwcLayer.hints = 0;
+    hwcLayer.flags = skipLayer ? HWC_SKIP_LAYER : 0;
     hwcLayer.blending = isOpaque ? HWC_BLENDING_NONE : HWC_BLENDING_PREMULT;
 #if ANDROID_VERSION >= 17
     hwcLayer.compositionType = HWC_FRAMEBUFFER;
 
     hwcLayer.acquireFenceFd = -1;
     hwcLayer.releaseFenceFd = -1;
 #if ANDROID_VERSION >= 18
     hwcLayer.planeAlpha = opacity;