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

Unified Diff: Source/core/rendering/RenderLayerModelObject.cpp

Issue 182383019: Should not repaint if a CSS property change can be composited (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: as your wish! (remove table) Created 6 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
« no previous file with comments | « LayoutTests/compositing/repaint/should-not-repaint-composited-styles-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayerModelObject.cpp
diff --git a/Source/core/rendering/RenderLayerModelObject.cpp b/Source/core/rendering/RenderLayerModelObject.cpp
index 82b423b6d1e9e948e10fed043cf89f8d26c50929..d4514dd585bc64be0f932437e780dc5d72053e57 100644
--- a/Source/core/rendering/RenderLayerModelObject.cpp
+++ b/Source/core/rendering/RenderLayerModelObject.cpp
@@ -111,16 +111,19 @@ void RenderLayerModelObject::styleWillChange(StyleDifference diff, const RenderS
// When a layout hint happens, we go ahead and do a repaint of the layer, since the layer could
// end up being destroyed.
if (hasLayer()) {
- if (oldStyle->position() != newStyle->position()
- || oldStyle->zIndex() != newStyle->zIndex()
- || oldStyle->hasAutoZIndex() != newStyle->hasAutoZIndex()
- || !(oldStyle->clip() == newStyle->clip())
- || oldStyle->hasClip() != newStyle->hasClip()
- || oldStyle->opacity() != newStyle->opacity()
- || oldStyle->transform() != newStyle->transform()
- || oldStyle->filter() != newStyle->filter()
- )
- layer()->repainter().repaintIncludingDescendants();
+ if (oldStyle->hasClip() != newStyle->hasClip()
+ || oldStyle->clip() != newStyle->clip()) {
+ // Composited layers don't need to be repainted when a parent's clip changes.
+ layer()->repainter().repaintIncludingNonCompositingDescendants(this);
+ } else if (!layer()->hasCompositedLayerMapping()) {
+ if (oldStyle->position() != newStyle->position()
+ || oldStyle->zIndex() != newStyle->zIndex()
+ || oldStyle->hasAutoZIndex() != newStyle->hasAutoZIndex()
+ || oldStyle->opacity() != newStyle->opacity()
+ || oldStyle->transform() != newStyle->transform()
+ || oldStyle->filter() != newStyle->filter())
+ layer()->repainter().repaintIncludingDescendants();
+ }
} else if (newStyle->hasTransform() || newStyle->opacity() < 1 || newStyle->hasFilter()) {
// If we don't have a layer yet, but we are going to get one because of transform or opacity,
// then we need to repaint the old position of the object.
« no previous file with comments | « LayoutTests/compositing/repaint/should-not-repaint-composited-styles-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698