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

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

Issue 247713003: Separate repaint and layout requirements of StyleDifference (Step 3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments; Rebase on RAL 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 (diffNeedsLayout(other))
126 styleDifference.setNeedsFullLayout(); 126 styleDifference.setNeedsFullLayout();
127 else if (diffNeedsRepaintOnly(other)) 127 if (diffNeedsRepaint(other))
128 styleDifference.setNeedsRepaintObject(); 128 styleDifference.setNeedsRepaintObject();
129 129
130 return styleDifference; 130 return styleDifference;
131 } 131 }
132 132
133 bool SVGRenderStyle::diffNeedsLayout(const SVGRenderStyle* other) const 133 bool SVGRenderStyle::diffNeedsLayout(const SVGRenderStyle* other) const
134 { 134 {
135 // If resources change, we need a relayout, as the presence of resources inf luences the repaint rect. 135 // If resources change, we need a relayout, as the presence of resources inf luences the repaint rect.
136 if (resources != other->resources) 136 if (resources != other->resources)
137 return true; 137 return true;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 || stroke->dashOffset != other->stroke->dashOffset 174 || stroke->dashOffset != other->stroke->dashOffset
175 || stroke->visitedLinkPaintColor != other->stroke->visitedLinkPaintC olor 175 || stroke->visitedLinkPaintColor != other->stroke->visitedLinkPaintC olor
176 || stroke->visitedLinkPaintUri != other->stroke->visitedLinkPaintUri 176 || stroke->visitedLinkPaintUri != other->stroke->visitedLinkPaintUri
177 || stroke->visitedLinkPaintType != other->stroke->visitedLinkPaintTy pe) 177 || stroke->visitedLinkPaintType != other->stroke->visitedLinkPaintTy pe)
178 return true; 178 return true;
179 } 179 }
180 180
181 return false; 181 return false;
182 } 182 }
183 183
184 bool SVGRenderStyle::diffNeedsRepaintOnly(const SVGRenderStyle* other) const 184 bool SVGRenderStyle::diffNeedsRepaint(const SVGRenderStyle* other) const
185 { 185 {
186 if (stroke != other->stroke) { 186 if (stroke->opacity != other->stroke->opacity)
187 // Only the stroke-opacity case remains, where we only need a repaint.
188 ASSERT(stroke->opacity != other->stroke->opacity);
189 return true; 187 return true;
190 }
191 188
192 // Painting related properties only need repaints. 189 // Painting related properties only need repaints.
193 if (misc != other->misc) { 190 if (misc != other->misc) {
194 if (misc->floodColor != other->misc->floodColor 191 if (misc->floodColor != other->misc->floodColor
195 || misc->floodOpacity != other->misc->floodOpacity 192 || misc->floodOpacity != other->misc->floodOpacity
196 || misc->lightingColor != other->misc->lightingColor) 193 || misc->lightingColor != other->misc->lightingColor)
197 return true; 194 return true;
198 } 195 }
199 196
200 // If fill changes, we just need to repaint. Fill boundaries are not influen ced by this, only by the Path, that RenderSVGPath contains. 197 // If fill changes, we just need to repaint. Fill boundaries are not influen ced by this, only by the Path, that RenderSVGPath contains.
(...skipping 25 matching lines...) Expand all
226 } 223 }
227 224
228 EPaintOrderType SVGRenderStyle::paintOrderType(unsigned index) const 225 EPaintOrderType SVGRenderStyle::paintOrderType(unsigned index) const
229 { 226 {
230 ASSERT(index < ((1 << kPaintOrderBitwidth)-1)); 227 ASSERT(index < ((1 << kPaintOrderBitwidth)-1));
231 unsigned pt = (paintOrder() >> (kPaintOrderBitwidth*index)) & ((1u << kPaint OrderBitwidth) - 1); 228 unsigned pt = (paintOrder() >> (kPaintOrderBitwidth*index)) & ((1u << kPaint OrderBitwidth) - 1);
232 return (EPaintOrderType)pt; 229 return (EPaintOrderType)pt;
233 } 230 }
234 231
235 } 232 }
OLDNEW
« no previous file with comments | « Source/core/rendering/style/SVGRenderStyle.h ('k') | Source/core/rendering/style/StyleDifference.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698