From e475933648cc8cfd3b170dce2092e4129e1db119 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Fri, 6 May 2016 13:53:56 -0400 Subject: [PATCH] Bug 1266161 - Make DrawForcedBackgroundColor fill the entire draw region, not just the layer's visible region. r=mattwoodrow We need to do this because the entire draw region will be added to the layer's valid region after drawing. If there are parts in the valid region that are not in the visible region, we still need those parts to have valid content, because in a later frame the visible region may grow to include those parts. MozReview-Commit-ID: 6zESYbPAmrx --HG-- extra : rebase_source : 24078d1ff802e53a2eb8895d2c5ffd1fe9507f04 --- layout/base/FrameLayerBuilder.cpp | 11 +- ...d-bg-color-outside-visible-region-ref.html | 39 +++++++ ...orced-bg-color-outside-visible-region.html | 105 ++++++++++++++++++ layout/reftests/layers/reftest.list | 1 + 4 files changed, 150 insertions(+), 6 deletions(-) create mode 100644 layout/reftests/layers/forced-bg-color-outside-visible-region-ref.html create mode 100644 layout/reftests/layers/forced-bg-color-outside-visible-region.html diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index a8091d4e6f5f..ef1f14e8a8dd 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -5594,13 +5594,12 @@ ShouldDrawRectsSeparately(DrawTarget* aDrawTarget, DrawRegionClip aClip) } static void DrawForcedBackgroundColor(DrawTarget& aDrawTarget, - Layer* aLayer, nscolor - aBackgroundColor) + const IntRect& aBounds, + nscolor aBackgroundColor) { if (NS_GET_A(aBackgroundColor) > 0) { - LayerIntRect r = aLayer->GetVisibleRegion().GetBounds(); ColorPattern color(ToDeviceColor(aBackgroundColor)); - aDrawTarget.FillRect(Rect(r.x, r.y, r.width, r.height), color); + aDrawTarget.FillRect(Rect(aBounds), color); } } @@ -5675,7 +5674,7 @@ FrameLayerBuilder::DrawPaintedLayer(PaintedLayer* aLayer, gfxUtils::ClipToRegion(aContext, aRegionToDraw); } - DrawForcedBackgroundColor(aDrawTarget, aLayer, + DrawForcedBackgroundColor(aDrawTarget, aRegionToDraw.GetBounds(), userData->mForcedBackgroundColor); } @@ -5714,7 +5713,7 @@ FrameLayerBuilder::DrawPaintedLayer(PaintedLayer* aLayer, aContext->Rectangle(ThebesRect(iterRect)); aContext->Clip(); - DrawForcedBackgroundColor(aDrawTarget, aLayer, + DrawForcedBackgroundColor(aDrawTarget, iterRect, userData->mForcedBackgroundColor); // Apply the residual transform if it has been enabled, to ensure that diff --git a/layout/reftests/layers/forced-bg-color-outside-visible-region-ref.html b/layout/reftests/layers/forced-bg-color-outside-visible-region-ref.html new file mode 100644 index 000000000000..8a5c68ac5e77 --- /dev/null +++ b/layout/reftests/layers/forced-bg-color-outside-visible-region-ref.html @@ -0,0 +1,39 @@ + + +Bug 1266161 - Reference + + + +
+ +
+ +
+
+ +
+ +
+ + diff --git a/layout/reftests/layers/forced-bg-color-outside-visible-region.html b/layout/reftests/layers/forced-bg-color-outside-visible-region.html new file mode 100644 index 000000000000..fe7d75a27215 --- /dev/null +++ b/layout/reftests/layers/forced-bg-color-outside-visible-region.html @@ -0,0 +1,105 @@ + + + +Bug 1266161 - Black boxes during scrolling + + + +
+ +
+

+

+

+ + + + + + + + + + + + + + + + + + +
+ +
+ + diff --git a/layout/reftests/layers/reftest.list b/layout/reftests/layers/reftest.list index e2bd481e4280..7ffdd0546773 100644 --- a/layout/reftests/layers/reftest.list +++ b/layout/reftests/layers/reftest.list @@ -20,3 +20,4 @@ skip-if(!asyncPan) != pull-background-displayport-5.html about:blank skip-if(!asyncPan) != pull-background-displayport-6.html about:blank # fails with non-overlay scrollbars and event regions due to bug 1148515 fuzzy(2,30150) == opacity-blending.html opacity-blending-ref.html fuzzy(16,5) == mask-layer-transform.html mask-layer-transform-ref.html +fuzzy-if(gtkWidget,1,17) == forced-bg-color-outside-visible-region.html forced-bg-color-outside-visible-region-ref.html