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

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

Issue 217973002: Remove duplicated invalidation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined change for landing (TM) 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
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 } 89 }
90 90
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 if (parent()) { 99 // Do a repaint with the old style first through RenderLayerRepainter.
100 // Do a repaint with the old style first, e.g., for example if we go from 100 // RenderObject::styleWillChange takes care of repainting objects withou t RenderLayers.
101 // having an outline to not having an outline. 101 if (parent() && diff == StyleDifferenceRepaintLayer) {
102 if (diff == StyleDifferenceRepaintLayer) { 102 layer()->repainter().repaintIncludingDescendants();
103 layer()->repainter().repaintIncludingDescendants(); 103 if (oldStyle->clip() != newStyle.clip())
104 if (oldStyle->clip() != newStyle.clip()) 104 layer()->clipper().clearClipRectsIncludingDescendants();
105 layer()->clipper().clearClipRectsIncludingDescendants();
106 } else if (diff == StyleDifferenceRepaint || newStyle.outlineSize() < oldStyle->outlineSize())
107 repaint();
108 } 105 }
109 106
110 if (diff == StyleDifferenceLayout || diff == StyleDifferenceSimplifiedLa yout) { 107 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 108 // 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. 109 // end up being destroyed.
113 if (hasLayer()) { 110 if (hasLayer()) {
114 if (oldStyle->hasClip() != newStyle.hasClip() 111 if (oldStyle->hasClip() != newStyle.hasClip()
115 || oldStyle->clip() != newStyle.clip()) { 112 || oldStyle->clip() != newStyle.clip()) {
116 // Composited layers don't need to be repainted when a paren t's clip changes. 113 // Composited layers don't need to be repainted when a paren t's clip changes.
117 layer()->repainter().repaintIncludingNonCompositingDescendan ts(containerForRepaint()); 114 layer()->repainter().repaintIncludingNonCompositingDescendan ts(containerForRepaint());
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 return m_layer ? m_layer->hasCompositedLayerMapping() : false; 219 return m_layer ? m_layer->hasCompositedLayerMapping() : false;
223 } 220 }
224 221
225 CompositedLayerMapping* RenderLayerModelObject::groupedMapping() const 222 CompositedLayerMapping* RenderLayerModelObject::groupedMapping() const
226 { 223 {
227 return m_layer ? m_layer->groupedMapping() : 0; 224 return m_layer ? m_layer->groupedMapping() : 0;
228 } 225 }
229 226
230 } // namespace WebCore 227 } // namespace WebCore
231 228
OLDNEW
« no previous file with comments | « LayoutTests/platform/win/virtual/softwarecompositing/repaint/invalidations-on-composited-layers-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698