From 52e14fd22828df1d447cb14d4c2b0f3e28e65337 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Tue, 23 Sep 2014 17:47:36 -0400 Subject: [PATCH] Bug 1050493 - Invalidate ColorLayer bounds changes. r=roc --HG-- extra : rebase_source : 2196e9cb32a41771b9078ec1e66dbb97ef430b71 --- gfx/layers/LayerTreeInvalidation.cpp | 10 +++++- layout/reftests/bugs/1050493-1-ref.html | 18 +++++++++++ layout/reftests/bugs/1050493-1.html | 41 +++++++++++++++++++++++++ layout/reftests/bugs/reftest.list | 1 + 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 layout/reftests/bugs/1050493-1-ref.html create mode 100644 layout/reftests/bugs/1050493-1.html diff --git a/gfx/layers/LayerTreeInvalidation.cpp b/gfx/layers/LayerTreeInvalidation.cpp index 9f4bc2ffb5f..ea9ef3d28dd 100644 --- a/gfx/layers/LayerTreeInvalidation.cpp +++ b/gfx/layers/LayerTreeInvalidation.cpp @@ -324,6 +324,7 @@ struct ColorLayerProperties : public LayerPropertiesBase explicit ColorLayerProperties(ColorLayer *aLayer) : LayerPropertiesBase(aLayer) , mColor(aLayer->GetColor()) + , mBounds(aLayer->GetBounds()) { } virtual nsIntRegion ComputeChangeInternal(NotifySubDocInvalidationFunc aCallback, @@ -336,10 +337,17 @@ struct ColorLayerProperties : public LayerPropertiesBase return NewTransformedBounds(); } - return nsIntRegion(); + nsIntRegion boundsDiff; + boundsDiff.Xor(mBounds, color->GetBounds()); + + nsIntRegion result; + AddTransformedRegion(result, boundsDiff, mTransform); + + return result; } gfxRGBA mColor; + nsIntRect mBounds; }; struct ImageLayerProperties : public LayerPropertiesBase diff --git a/layout/reftests/bugs/1050493-1-ref.html b/layout/reftests/bugs/1050493-1-ref.html new file mode 100644 index 00000000000..b9cbafd5c56 --- /dev/null +++ b/layout/reftests/bugs/1050493-1-ref.html @@ -0,0 +1,18 @@ + + + +Test for bug 1050493 + + + +
diff --git a/layout/reftests/bugs/1050493-1.html b/layout/reftests/bugs/1050493-1.html new file mode 100644 index 00000000000..321cf0d6c5d --- /dev/null +++ b/layout/reftests/bugs/1050493-1.html @@ -0,0 +1,41 @@ + + + +Test for bug 1050493 + + + +
+ + diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 71c99829760..02d53faec61 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -1826,6 +1826,7 @@ pref(browser.display.use_document_fonts,0) == 1022481-1.html 1022481-1-ref.html == 1042104-1.html 1042104-1-ref.html == 1044198-1.html 1044198-1-ref.html == 1049499-1.html 1049499-1-ref.html +== 1050493-1.html 1050493-1-ref.html == 1050788-1.html about:blank == 1053035-1-flex.html 1053035-1-ref.html test-pref(layout.css.grid.enabled,true) == 1053035-1-grid.html 1053035-1-ref.html