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

Side by Side Diff: Source/core/rendering/RenderLayerModelObject.cpp

Issue 247713003: Separate repaint and layout requirements of StyleDifference (Step 3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 7 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // we need to dirty our stacking context's z-order list. 96 // we need to dirty our stacking context's z-order list.
97 RenderStyle* oldStyle = style(); 97 RenderStyle* oldStyle = style();
98 if (oldStyle) { 98 if (oldStyle) {
99 // Do a repaint with the old style first through RenderLayerRepainter. 99 // Do a repaint with the old style first through RenderLayerRepainter.
100 // RenderObject::styleWillChange takes care of repainting objects withou t RenderLayers. 100 // RenderObject::styleWillChange takes care of repainting objects withou t RenderLayers.
101 if (parent() && diff.needsRepaintLayer()) { 101 if (parent() && diff.needsRepaintLayer()) {
102 layer()->repainter().repaintIncludingNonCompositingDescendants(conta inerForRepaint()); 102 layer()->repainter().repaintIncludingNonCompositingDescendants(conta inerForRepaint());
103 if (oldStyle->hasClip() != newStyle.hasClip() 103 if (oldStyle->hasClip() != newStyle.hasClip()
104 || oldStyle->clip() != newStyle.clip()) 104 || oldStyle->clip() != newStyle.clip())
105 layer()->clipper().clearClipRectsIncludingDescendants(); 105 layer()->clipper().clearClipRectsIncludingDescendants();
106 } 106 } else if (diff.needsFullLayout()) {
107
108 if (diff.needsFullLayout()) {
109 // When a layout hint happens, we go ahead and do a repaint of the l ayer, since the layer could
110 // end up being destroyed.
111 if (hasLayer()) { 107 if (hasLayer()) {
112 if (oldStyle->hasClip() != newStyle.hasClip() 108 if (!layer()->hasCompositedLayerMapping() && oldStyle->position( ) != newStyle.position())
113 || oldStyle->clip() != newStyle.clip()) {
114 // Composited layers don't need to be repainted when a paren t's clip changes.
115 layer()->repainter().repaintIncludingNonCompositingDescendan ts(containerForRepaint()); 109 layer()->repainter().repaintIncludingNonCompositingDescendan ts(containerForRepaint());
116 } else if (!layer()->hasCompositedLayerMapping()) {
117 if (oldStyle->position() != newStyle.position()
118 || oldStyle->zIndex() != newStyle.zIndex()
119 || oldStyle->hasAutoZIndex() != newStyle.hasAutoZIndex()
120 || oldStyle->opacity() != newStyle.opacity()
121 || oldStyle->transform() != newStyle.transform()
122 || oldStyle->filter() != newStyle.filter())
123 layer()->repainter().repaintIncludingNonCompositingDesce ndants(containerForRepaint());
124 }
125 } else if (newStyle.hasTransform() || newStyle.opacity() < 1 || newS tyle.hasFilter()) { 110 } else if (newStyle.hasTransform() || newStyle.opacity() < 1 || newS tyle.hasFilter()) {
126 // If we don't have a layer yet, but we are going to get one bec ause of transform or opacity, 111 // If we don't have a layer yet, but we are going to get one bec ause of transform or opacity,
127 // then we need to repaint the old position of the object. 112 // then we need to repaint the old position of the object.
128 repaint(); 113 repaint();
129 } 114 }
130 } 115 }
131 } 116 }
132 117
133 RenderObject::styleWillChange(diff, newStyle); 118 RenderObject::styleWillChange(diff, newStyle);
134 } 119 }
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 return m_layer ? m_layer->hasCompositedLayerMapping() : false; 207 return m_layer ? m_layer->hasCompositedLayerMapping() : false;
223 } 208 }
224 209
225 CompositedLayerMapping* RenderLayerModelObject::groupedMapping() const 210 CompositedLayerMapping* RenderLayerModelObject::groupedMapping() const
226 { 211 {
227 return m_layer ? m_layer->groupedMapping() : 0; 212 return m_layer ? m_layer->groupedMapping() : 0;
228 } 213 }
229 214
230 } // namespace WebCore 215 } // namespace WebCore
231 216
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698