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

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

Issue 236203020: Separate repaint and layout requirements of StyleDifference (Step 1) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase, Fix break Created 6 years, 8 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
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 void RenderLayerModelObject::styleWillChange(StyleDifference diff, const RenderS tyle& newStyle) 91 void RenderLayerModelObject::styleWillChange(StyleDifference diff, const RenderS tyle& newStyle)
92 { 92 {
93 s_wasFloating = isFloating(); 93 s_wasFloating = isFloating();
94 94
95 // If our z-index changes value or our visibility changes, 95 // If our z-index changes value or our visibility changes,
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 == StyleDifferenceRepaintLayer) { 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 }
107 107
108 if (diff == StyleDifferenceLayout || diff == StyleDifferenceSimplifiedLa yout) { 108 if (diff.needsFullLayout() || diff.needsSimplifiedLayout()) {
109 // When a layout hint happens, we go ahead and do a repaint of the l ayer, since the layer could 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. 110 // end up being destroyed.
111 if (hasLayer()) { 111 if (hasLayer()) {
112 if (oldStyle->hasClip() != newStyle.hasClip() 112 if (oldStyle->hasClip() != newStyle.hasClip()
113 || oldStyle->clip() != newStyle.clip()) { 113 || oldStyle->clip() != newStyle.clip()) {
114 // Composited layers don't need to be repainted when a paren t's clip changes. 114 // Composited layers don't need to be repainted when a paren t's clip changes.
115 layer()->repainter().repaintIncludingNonCompositingDescendan ts(containerForRepaint()); 115 layer()->repainter().repaintIncludingNonCompositingDescendan ts(containerForRepaint());
116 } else if (!layer()->hasCompositedLayerMapping()) { 116 } else if (!layer()->hasCompositedLayerMapping()) {
117 if (oldStyle->position() != newStyle.position() 117 if (oldStyle->position() != newStyle.position()
118 || oldStyle->zIndex() != newStyle.zIndex() 118 || oldStyle->zIndex() != newStyle.zIndex()
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 return m_layer ? m_layer->hasCompositedLayerMapping() : false; 222 return m_layer ? m_layer->hasCompositedLayerMapping() : false;
223 } 223 }
224 224
225 CompositedLayerMapping* RenderLayerModelObject::groupedMapping() const 225 CompositedLayerMapping* RenderLayerModelObject::groupedMapping() const
226 { 226 {
227 return m_layer ? m_layer->groupedMapping() : 0; 227 return m_layer ? m_layer->groupedMapping() : 0;
228 } 228 }
229 229
230 } // namespace WebCore 230 } // namespace WebCore
231 231
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698