Bug 1025824 - Fix mHwcLayerMap handling. r=sushil, a=2.0+
authorSotaro Ikeda <sikeda@mozilla.com>
Mon, 16 Jun 2014 13:05:14 -0700
changeset 208729 272e865ade290eda483ee077ad676b72e29cc41c
parent 208728 befee2ec3a8245c665e90328243308e1ce999510
child 208730 ad4ea249261ae76579b52c2efb4dfd090240f4a4
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)
reviewerssushil, 2
bugs1025824
milestone32.0a2
Bug 1025824 - Fix mHwcLayerMap handling. r=sushil, a=2.0+
widget/gonk/HwcComposer2D.cpp
--- a/widget/gonk/HwcComposer2D.cpp
+++ b/widget/gonk/HwcComposer2D.cpp
@@ -687,17 +687,17 @@ HwcComposer2D::Prepare(buffer_handle_t f
 
 bool
 HwcComposer2D::Commit()
 {
     hwc_display_contents_1_t *displays[HWC_NUM_DISPLAY_TYPES] = { nullptr };
     displays[HWC_DISPLAY_PRIMARY] = mList;
 
     for (uint32_t j=0; j < (mList->numHwLayers - 1); j++) {
-        if (!mHwcLayerMap[j] ||
+        if (mHwcLayerMap.IsEmpty() ||
             (mList->hwLayers[j].compositionType == HWC_FRAMEBUFFER)) {
             continue;
         }
         LayerRenderState state = mHwcLayerMap[j]->GetLayer()->GetRenderState();
         if (!state.mTexture) {
             continue;
         }
         TextureHostOGL* texture = state.mTexture->AsHostOGL();
@@ -797,16 +797,17 @@ HwcComposer2D::TryRender(Layer* aRoot,
     mVisibleRegions.clear();
 
     MOZ_ASSERT(mHwcLayerMap.IsEmpty());
     if (!PrepareLayerList(aRoot,
                           mScreenRect,
                           gfxMatrix(),
                           aGLWorldTransform))
     {
+        mHwcLayerMap.Clear();
         LOGD("Render aborted. Nothing was drawn to the screen");
         return false;
     }
 
     if (!TryHwComposition()) {
         LOGD("H/W Composition failed");
         return false;
     }