Bug 1089040 - Fix HWC opacity check for largers with complex regions. r=sotaro
authorBenoit Girard <b56girard@gmail.com>
Wed, 29 Oct 2014 16:07:11 -0400
changeset 213011 0f69fbc0d65d60b169b4d1d3f87359c753344a5e
parent 213010 0be3a777ab2b0843d6844ec8ed7f3de3737436e1
child 213012 e30de6729affd6aa103bbccb40be280af22cad93
push id27738
push usercbook@mozilla.com
push dateThu, 30 Oct 2014 13:46:07 +0000
treeherdermozilla-central@1aa1b23d799e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro
bugs1089040
milestone36.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 1089040 - Fix HWC opacity check for largers with complex regions. r=sotaro
widget/gonk/HwcComposer2D.cpp
--- a/widget/gonk/HwcComposer2D.cpp
+++ b/widget/gonk/HwcComposer2D.cpp
@@ -442,17 +442,20 @@ HwcComposer2D::PrepareLayerList(Layer* a
     }
 
     // OK!  We can compose this layer with hwc.
     int current = mList ? mList->numHwLayers : 0;
 
     // Do not compose any layer below full-screen Opaque layer
     // Note: It can be generalized to non-fullscreen Opaque layers.
     bool isOpaque = (opacity == 0xFF) && (aLayer->GetContentFlags() & Layer::CONTENT_OPAQUE);
-    if (current && isOpaque) {
+    // Currently we perform opacity calculation using the *bounds* of the layer.
+    // We can only make this assumption if we're not dealing with a complex visible region.
+    bool isSimpleVisibleRegion = visibleRegion.GetNumRects() == 1;
+    if (current && isOpaque && isSimpleVisibleRegion) {
         nsIntRect displayRect = nsIntRect(displayFrame.left, displayFrame.top,
             displayFrame.right - displayFrame.left, displayFrame.bottom - displayFrame.top);
         if (displayRect.Contains(mScreenRect)) {
             // In z-order, all previous layers are below
             // the current layer. We can ignore them now.
             mList->numHwLayers = current = 0;
             mHwcLayerMap.Clear();
         }