Bug 1023506 - Don't fill the background color for overscrolled scrollinfo layers. r=mattwoodrow, a=2.0+
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 25 Jun 2014 19:18:33 -0400
changeset 200611 6d261c1cbe25
parent 200610 58bb80d1fe9d
child 200612 d62322a32501
push id6262
push userryanvm@gmail.com
push dateThu, 26 Jun 2014 15:09:39 +0000
treeherdermozilla-aurora@d62322a32501 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, 2
bugs1023506
milestone32.0a2
Bug 1023506 - Don't fill the background color for overscrolled scrollinfo layers. r=mattwoodrow, a=2.0+
gfx/layers/composite/ContainerLayerComposite.cpp
--- a/gfx/layers/composite/ContainerLayerComposite.cpp
+++ b/gfx/layers/composite/ContainerLayerComposite.cpp
@@ -318,17 +318,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);