Title: [109424] trunk/Source/WebCore
- Revision
- 109424
- Author
- [email protected]
- Date
- 2012-03-01 14:24:52 -0800 (Thu, 01 Mar 2012)
Log Message
[chromium] Move pageScaleDirty logic from LayerChromium to GraphicsLayerChromium
https://bugs.webkit.org/show_bug.cgi?id=79714
Patch by James Robinson <[email protected]> on 2012-03-01
Reviewed by Adrienne Walker.
When the page scale changes on a composited layer we need to invalidate all of the contents on the layer in
order to repaint them at the new scale. The sequence of calls we get make this a bit tricky, since we first
receive a page scale changed notification and then receive the new layer bounds. The solution is to defer the
invalidation until we have the new layer bounds, which landed in r99774.
This moves that logic from LayerChromium into GraphicsLayerChromium since IMO this is pretty particular to the
way WebCore is passing us invalidations and not something fundamental to the compositor.
* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::GraphicsLayerChromium::GraphicsLayerChromium):
(WebCore::GraphicsLayerChromium::setSize):
(WebCore::GraphicsLayerChromium::deviceOrPageScaleFactorChanged):
* platform/graphics/chromium/GraphicsLayerChromium.h:
* platform/graphics/chromium/LayerChromium.cpp:
(WebCore::LayerChromium::LayerChromium):
(WebCore::LayerChromium::setBounds):
* platform/graphics/chromium/LayerChromium.h:
(LayerChromium):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (109423 => 109424)
--- trunk/Source/WebCore/ChangeLog 2012-03-01 22:14:57 UTC (rev 109423)
+++ trunk/Source/WebCore/ChangeLog 2012-03-01 22:24:52 UTC (rev 109424)
@@ -1,3 +1,29 @@
+2012-03-01 James Robinson <[email protected]>
+
+ [chromium] Move pageScaleDirty logic from LayerChromium to GraphicsLayerChromium
+ https://bugs.webkit.org/show_bug.cgi?id=79714
+
+ Reviewed by Adrienne Walker.
+
+ When the page scale changes on a composited layer we need to invalidate all of the contents on the layer in
+ order to repaint them at the new scale. The sequence of calls we get make this a bit tricky, since we first
+ receive a page scale changed notification and then receive the new layer bounds. The solution is to defer the
+ invalidation until we have the new layer bounds, which landed in r99774.
+
+ This moves that logic from LayerChromium into GraphicsLayerChromium since IMO this is pretty particular to the
+ way WebCore is passing us invalidations and not something fundamental to the compositor.
+
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ (WebCore::GraphicsLayerChromium::GraphicsLayerChromium):
+ (WebCore::GraphicsLayerChromium::setSize):
+ (WebCore::GraphicsLayerChromium::deviceOrPageScaleFactorChanged):
+ * platform/graphics/chromium/GraphicsLayerChromium.h:
+ * platform/graphics/chromium/LayerChromium.cpp:
+ (WebCore::LayerChromium::LayerChromium):
+ (WebCore::LayerChromium::setBounds):
+ * platform/graphics/chromium/LayerChromium.h:
+ (LayerChromium):
+
2012-03-01 Joe Thomas <[email protected]>
:empty still applies to elements made non-empty via page dynamics.
Modified: trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp (109423 => 109424)
--- trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp 2012-03-01 22:14:57 UTC (rev 109423)
+++ trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp 2012-03-01 22:24:52 UTC (rev 109424)
@@ -78,6 +78,7 @@
, m_contentsLayerPurpose(NoContentsLayer)
, m_contentsLayerHasBackgroundColor(false)
, m_inSetChildren(false)
+ , m_pageScaleChanged(false)
{
m_layer = ContentLayerChromium::create(this);
@@ -201,6 +202,10 @@
GraphicsLayer::setSize(clampedSize);
updateLayerSize();
+
+ if (m_pageScaleChanged && m_layer)
+ m_layer->setNeedsDisplay();
+ m_pageScaleChanged = false;
}
void GraphicsLayerChromium::setTransform(const TransformationMatrix& transform)
@@ -722,8 +727,10 @@
void GraphicsLayerChromium::deviceOrPageScaleFactorChanged()
{
updateContentsScale();
- if (m_layer)
- m_layer->pageScaleChanged();
+ // Invalidations are clamped to the layer's bounds but we receive the scale changed notification before receiving
+ // the new layer bounds. When the scale changes, we really want to invalidate the post-scale layer bounds, so we
+ // remember that the scale has changed and then invalidate the full layer bounds when we receive the new size.
+ m_pageScaleChanged = true;
}
void GraphicsLayerChromium::paintContents(GraphicsContext& context, const IntRect& clip)
Modified: trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h (109423 => 109424)
--- trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h 2012-03-01 22:14:57 UTC (rev 109423)
+++ trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h 2012-03-01 22:24:52 UTC (rev 109424)
@@ -165,6 +165,7 @@
ContentsLayerPurpose m_contentsLayerPurpose;
bool m_contentsLayerHasBackgroundColor : 1;
bool m_inSetChildren;
+ bool m_pageScaleChanged;
AnimationIdMap m_animationIdMap;
};
Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp (109423 => 109424)
--- trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp 2012-03-01 22:14:57 UTC (rev 109423)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp 2012-03-01 22:24:52 UTC (rev 109424)
@@ -84,7 +84,6 @@
, m_drawOpacity(0)
, m_targetRenderSurface(0)
, m_contentsScale(1.0)
- , m_pageScaleDirty(false)
, m_layerAnimationDelegate(0)
{
}
@@ -278,12 +277,10 @@
m_bounds = size;
- if (firstResize || m_pageScaleDirty)
+ if (firstResize)
setNeedsDisplay();
else
setNeedsCommit();
-
- m_pageScaleDirty = false;
}
const LayerChromium* LayerChromium::rootLayer() const
Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h (109423 => 109424)
--- trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h 2012-03-01 22:14:57 UTC (rev 109423)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h 2012-03-01 22:24:52 UTC (rev 109424)
@@ -169,7 +169,6 @@
virtual void setIsMask(bool) { }
virtual void unreserveContentsTexture() { }
virtual void bindContentsTexture() { }
- virtual void pageScaleChanged() { m_pageScaleDirty = true; }
virtual void protectVisibleTileTextures() { }
virtual bool needsContentsScale() const { return false; }
@@ -326,8 +325,6 @@
String m_name;
- bool m_pageScaleDirty;
-
CCLayerAnimationDelegate* m_layerAnimationDelegate;
};
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes