Bug 1023506 - Don't fill the background color for overscrolled scrollinfo layers. r=mattwoodrow
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 25 Jun 2014 19:18:33 -0400
changeset 190836 2186f79e926c
parent 190835 3ce66fc9bea4
child 190837 7311745f1fe4
push id27017
push usercbook@mozilla.com
push dateThu, 26 Jun 2014 10:29:24 +0000
treeherdermozilla-central@c43be7e4ec49 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1023506
milestone33.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 1023506 - Don't fill the background color for overscrolled scrollinfo layers. r=mattwoodrow
gfx/layers/composite/ContainerLayerComposite.cpp
--- a/gfx/layers/composite/ContainerLayerComposite.cpp
+++ b/gfx/layers/composite/ContainerLayerComposite.cpp
@@ -345,17 +345,19 @@ ContainerRender(ContainerT* aContainer,
   aContainer->SortChildrenBy3DZOrder(children);
 
   // If this is a scrollable container layer, and it's overscrolled, the layer's
   // contents are transformed in a way that would leave blank regions in the
   // composited area. If the layer has a background color, fill these areas
   // with the background color by drawing a rectangle of the background color
   // over the entire composited area before drawing the container contents.
   if (AsyncPanZoomController* apzc = aContainer->GetAsyncPanZoomController()) {
-    if (apzc->IsOverscrolled()) {
+    // Make sure not to do this on a "scrollinfo" layer (one with an empty visible
+    // region) because it's just a placeholder for APZ purposes.
+    if (apzc->IsOverscrolled() && !aContainer->GetVisibleRegion().IsEmpty()) {
       gfxRGBA color = aContainer->GetBackgroundColor();
       // If the background is completely transparent, there's no point in
       // drawing anything for it. Hopefully the layers behind, if any, will
       // provide suitable content for the overscroll effect.
       if (color.a != 0.0) {
         EffectChain effectChain(aContainer);
         effectChain.mPrimaryEffect = new EffectSolidColor(ToColor(color));
         gfx::Rect clipRect(aClipRect.x, aClipRect.y, aClipRect.width, aClipRect.height);