Bug 944207 - Reset the number of HWC layers on failures before HWC prepare. r=dwilson
authorSushil Chauhan <sushilchauhan@codeaurora.org>
Fri, 29 Nov 2013 11:39:39 -0800
changeset 173913 2c4b329c1a9626fc3773e48380df2e06d05ce733
parent 173912 8fe38055e41a88cdab12cb90c866299f014e08e5
child 173914 9248eb2d924de6251a8bc0d26e178390bd5815ca
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdwilson
bugs944207
milestone28.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 944207 - Reset the number of HWC layers on failures before HWC prepare. r=dwilson
widget/gonk/HwcComposer2D.cpp
--- a/widget/gonk/HwcComposer2D.cpp
+++ b/widget/gonk/HwcComposer2D.cpp
@@ -446,24 +446,26 @@ HwcComposer2D::PrepareLayerList(Layer* a
 #if ANDROID_VERSION >= 18
 bool
 HwcComposer2D::TryHwComposition()
 {
     FramebufferSurface* fbsurface = (FramebufferSurface*)(GetGonkDisplay()->GetFBSurface());
 
     if (!(fbsurface && fbsurface->lastHandle)) {
         LOGD("H/W Composition failed. FBSurface not initialized.");
+        mList->numHwLayers = 0;
         return false;
     }
 
     // Add FB layer
     int idx = mList->numHwLayers++;
     if (idx >= mMaxLayerCount) {
         if (!ReallocLayerList() || idx >= mMaxLayerCount) {
             LOGE("TryHwComposition failed! Could not add FB layer");
+            mList->numHwLayers = 0;
             return false;
         }
     }
 
     Prepare(fbsurface->lastHandle, -1);
 
     bool fullHwcComposite = true;
     for (int j = 0; j < idx; j++) {