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 190745 2186f79e926c
parent 190744 3ce66fc9bea4
child 190746 7311745f1fe4
push id8380
push userkgupta@mozilla.com
push dateWed, 25 Jun 2014 23:19:51 +0000
treeherderb2g-inbound@2186f79e926c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1023506
milestone33.0a1
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);