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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010, 2012 Google Inc. All rights reserved. 7 * Copyright (C) 2010, 2012 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 if (oldStyle->clip() != newStyle->clip()) 104 if (oldStyle->clip() != newStyle->clip())
105 layer()->clipper().clearClipRectsIncludingDescendants(); 105 layer()->clipper().clearClipRectsIncludingDescendants();
106 } else if (diff == StyleDifferenceRepaint || newStyle->outlineSize() < oldStyle->outlineSize()) 106 } else if (diff == StyleDifferenceRepaint || newStyle->outlineSize() < oldStyle->outlineSize())
107 repaint(); 107 repaint();
108 } 108 }
109 109
110 if (diff == StyleDifferenceLayout || diff == StyleDifferenceSimplifiedLa yout) { 110 if (diff == StyleDifferenceLayout || diff == StyleDifferenceSimplifiedLa yout) {
111 // When a layout hint happens, we go ahead and do a repaint of the l ayer, since the layer could 111 // When a layout hint happens, we go ahead and do a repaint of the l ayer, since the layer could
112 // end up being destroyed. 112 // end up being destroyed.
113 if (hasLayer()) { 113 if (hasLayer()) {
114 if (oldStyle->position() != newStyle->position() 114 if (!(oldStyle->clip() == newStyle->clip())
esprehn 2014/03/05 00:09:49 Use != instead
115 || oldStyle->zIndex() != newStyle->zIndex() 115 || oldStyle->hasClip() != newStyle->hasClip()) {
116 || oldStyle->hasAutoZIndex() != newStyle->hasAutoZIndex() 116 // Composited layers don't need to be repainted when
117 || !(oldStyle->clip() == newStyle->clip()) 117 // a parent's clip changes.
esprehn 2014/03/05 00:09:49 Don't wrap the comment.
118 || oldStyle->hasClip() != newStyle->hasClip() 118 layer()->repainter().repaintIncludingNonCompositingDescendan ts(this);
119 || oldStyle->opacity() != newStyle->opacity() 119 } else if (!layer()->hasCompositedLayerMapping()) {
esprehn 2014/03/05 00:09:49 How do we know this is safe? The other properties
120 || oldStyle->transform() != newStyle->transform() 120 if (oldStyle->position() != newStyle->position()
121 || oldStyle->filter() != newStyle->filter() 121 || oldStyle->zIndex() != newStyle->zIndex()
122 ) 122 || oldStyle->hasAutoZIndex() != newStyle->hasAutoZIndex( )
123 layer()->repainter().repaintIncludingDescendants(); 123 || oldStyle->opacity() != newStyle->opacity()
124 || oldStyle->transform() != newStyle->transform()
125 || oldStyle->filter() != newStyle->filter()
126 )
esprehn 2014/03/05 00:09:49 paren should be in the previous line
127 layer()->repainter().repaintIncludingDescendants();
128 }
124 } else if (newStyle->hasTransform() || newStyle->opacity() < 1 || ne wStyle->hasFilter()) { 129 } else if (newStyle->hasTransform() || newStyle->opacity() < 1 || ne wStyle->hasFilter()) {
125 // If we don't have a layer yet, but we are going to get one bec ause of transform or opacity, 130 // If we don't have a layer yet, but we are going to get one bec ause of transform or opacity,
126 // then we need to repaint the old position of the object. 131 // then we need to repaint the old position of the object.
127 repaint(); 132 repaint();
128 } 133 }
129 } 134 }
130 } 135 }
131 136
132 RenderObject::styleWillChange(diff, newStyle); 137 RenderObject::styleWillChange(diff, newStyle);
133 } 138 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 return m_layer ? m_layer->hasCompositedLayerMapping() : false; 219 return m_layer ? m_layer->hasCompositedLayerMapping() : false;
215 } 220 }
216 221
217 CompositedLayerMapping* RenderLayerModelObject::groupedMapping() const 222 CompositedLayerMapping* RenderLayerModelObject::groupedMapping() const
218 { 223 {
219 return m_layer ? m_layer->groupedMapping() : 0; 224 return m_layer ? m_layer->groupedMapping() : 0;
220 } 225 }
221 226
222 } // namespace WebCore 227 } // namespace WebCore
223 228
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698