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

Side by Side Diff: Source/core/rendering/style/SVGRenderStyle.cpp

Issue 265703012: Separate repaint and layout requirements of StyleDifference (Step 4) (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) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 2004, 2005, 2010 Rob Buis <buis@kde.org> 3 2004, 2005, 2010 Rob Buis <buis@kde.org>
4 Copyright (C) Research In Motion Limited 2010. All rights reserved. 4 Copyright (C) Research In Motion Limited 2010. All rights reserved.
5 5
6 Based on khtml code by: 6 Based on khtml code by:
7 Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 7 Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
8 Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org) 8 Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org)
9 Copyright (C) 2002-2003 Dirk Mueller (mueller@kde.org) 9 Copyright (C) 2002-2003 Dirk Mueller (mueller@kde.org)
10 Copyright (C) 2002 Apple Computer, Inc. 10 Copyright (C) 2002 Apple Computer, Inc.
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 svg_noninherited_flags = other->svg_noninherited_flags; 115 svg_noninherited_flags = other->svg_noninherited_flags;
116 stops = other->stops; 116 stops = other->stops;
117 misc = other->misc; 117 misc = other->misc;
118 resources = other->resources; 118 resources = other->resources;
119 } 119 }
120 120
121 StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const 121 StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const
122 { 122 {
123 StyleDifference styleDifference; 123 StyleDifference styleDifference;
124 124
125 if (diffNeedsLayout(other)) 125 if (diffNeedsLayoutAndRepaint(other)) {
126 styleDifference.setNeedsFullLayout(); 126 styleDifference.setNeedsFullLayout();
127 if (diffNeedsRepaint(other))
128 styleDifference.setNeedsRepaintObject(); 127 styleDifference.setNeedsRepaintObject();
128 } else if (diffNeedsRepaint(other)) {
129 styleDifference.setNeedsRepaintObject();
130 }
129 131
130 return styleDifference; 132 return styleDifference;
131 } 133 }
132 134
133 bool SVGRenderStyle::diffNeedsLayout(const SVGRenderStyle* other) const 135 bool SVGRenderStyle::diffNeedsLayoutAndRepaint(const SVGRenderStyle* other) cons t
134 { 136 {
135 // If resources change, we need a relayout, as the presence of resources inf luences the repaint rect. 137 // If resources change, we need a relayout, as the presence of resources inf luences the repaint rect.
136 if (resources != other->resources) 138 if (resources != other->resources)
137 return true; 139 return true;
138 140
139 // If markers change, we need a relayout, as marker boundaries are cached in RenderSVGPath. 141 // If markers change, we need a relayout, as marker boundaries are cached in RenderSVGPath.
140 if (inheritedResources != other->inheritedResources) 142 if (inheritedResources != other->inheritedResources)
141 return true; 143 return true;
142 144
143 // All text related properties influence layout. 145 // All text related properties influence layout.
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 } 229 }
228 230
229 EPaintOrderType SVGRenderStyle::paintOrderType(unsigned index) const 231 EPaintOrderType SVGRenderStyle::paintOrderType(unsigned index) const
230 { 232 {
231 ASSERT(index < ((1 << kPaintOrderBitwidth)-1)); 233 ASSERT(index < ((1 << kPaintOrderBitwidth)-1));
232 unsigned pt = (paintOrder() >> (kPaintOrderBitwidth*index)) & ((1u << kPaint OrderBitwidth) - 1); 234 unsigned pt = (paintOrder() >> (kPaintOrderBitwidth*index)) & ((1u << kPaint OrderBitwidth) - 1);
233 return (EPaintOrderType)pt; 235 return (EPaintOrderType)pt;
234 } 236 }
235 237
236 } 238 }
OLDNEW
« Source/core/rendering/RenderObject.h ('K') | « Source/core/rendering/style/SVGRenderStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698