Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Unified Diff: Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp

Issue 9958025: Merge 112436 - [chromium] layer->clipRect() is not initialized for layers that create a renderSurfa… (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp
===================================================================
--- Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp (revision 112701)
+++ Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp (working copy)
@@ -370,6 +370,10 @@
// surface and is therefore expressed in the parent's coordinate system.
renderSurface->setClipRect(layer->parent() ? layer->parent()->clipRect() : layer->clipRect());
+ // The layer's clipRect can be reset here. The renderSurface will correctly clip the subtree.
+ layer->setUsesLayerClipping(false);
+ layer->setClipRect(IntRect());
+
if (layer->maskLayer()) {
renderSurface->setMaskLayer(layer->maskLayer());
layer->maskLayer()->setTargetRenderSurface(renderSurface);
@@ -406,13 +410,18 @@
// Layers without their own renderSurface will render into the nearest ancestor surface.
layer->setTargetRenderSurface(layer->parent()->targetRenderSurface());
}
+ }
- if (layer->masksToBounds()) {
- IntRect clipRect = transformedLayerRect;
+ if (layer->masksToBounds()) {
+ IntRect clipRect = transformedLayerRect;
+
+ // If the layer already inherited a clipRect, we need to intersect with it before
+ // overriding the layer's clipRect and usesLayerClipping.
+ if (layer->usesLayerClipping())
clipRect.intersect(layer->clipRect());
- layer->setClipRect(clipRect);
- layer->setUsesLayerClipping(true);
- }
+
+ layer->setClipRect(clipRect);
+ layer->setUsesLayerClipping(true);
}
// Note that at this point, layer->drawTransform() is not necessarily the same as local variable drawTransform.

Powered by Google App Engine
This is Rietveld 408576698