Bug 1061976 - Remove background-drawing for overscrolled layers. r=BenWa
authorBotond Ballo <botond@mozilla.com>
Tue, 02 Sep 2014 19:15:52 -0400
changeset 203456 6a723264bc90dca46f44df2a5329df65d708c51c
parent 203455 55f0e713ff428359ff717943d27d71c41b4ab080
child 203457 a412d9988671f1b7793559b65ee0164f6fa64cb0
push id27428
push usercbook@mozilla.com
push dateThu, 04 Sep 2014 13:00:04 +0000
treeherdermozilla-central@7bfd030e8fc8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBenWa
bugs1061976
milestone35.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 1061976 - Remove background-drawing for overscrolled layers. r=BenWa
gfx/layers/composite/ContainerLayerComposite.cpp
--- a/gfx/layers/composite/ContainerLayerComposite.cpp
+++ b/gfx/layers/composite/ContainerLayerComposite.cpp
@@ -252,52 +252,16 @@ ContainerPrepare(ContainerT* aContainer,
 
 template<class ContainerT> void
 RenderLayers(ContainerT* aContainer,
 	     LayerManagerComposite* aManager,
 	     const RenderTargetIntRect& aClipRect)
 {
   Compositor* compositor = aManager->GetCompositor();
 
-  float opacity = aContainer->GetEffectiveOpacity();
-
-  // 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.
-  // Make sure not to do this on a "scrollinfo" layer because it's just a
-  // placeholder for APZ purposes.
-  if (aContainer->HasScrollableFrameMetrics() && !aContainer->IsScrollInfoLayer()) {
-    bool overscrolled = false;
-    gfxRGBA color;
-    for (uint32_t i = 0; i < aContainer->GetFrameMetricsCount(); i++) {
-      AsyncPanZoomController* apzc = aContainer->GetAsyncPanZoomController(i);
-      if (apzc && apzc->IsOverscrolled()) {
-        overscrolled = true;
-        color = aContainer->GetFrameMetrics(i).GetBackgroundColor();
-        break;
-      }
-    }
-    if (overscrolled) {
-      // 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);
-        compositor->DrawQuad(
-          RenderTargetPixel::ToUnknown(
-            compositor->ClipRectInLayersCoordinates(aContainer, aClipRect)),
-          clipRect, effectChain, opacity, Matrix4x4());
-      }
-    }
-  }
-
   for (size_t i = 0u; i < aContainer->mPrepared->mLayers.Length(); i++) {
     PreparedLayer& preparedData = aContainer->mPrepared->mLayers[i];
     LayerComposite* layerToRender = preparedData.mLayer;
     const RenderTargetIntRect& clipRect = preparedData.mClipRect;
 
     if (layerToRender->HasLayerBeenComposited()) {
       // Composer2D will compose this layer so skip GPU composition
       // this time & reset composition flag for next composition phase