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

Side by Side Diff: Source/core/style/SVGComputedStyle.cpp

Issue 1252933003: Shrink SVG paint-order to take less bits (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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
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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 if (stops != other->stops) 229 if (stops != other->stops)
230 return true; 230 return true;
231 231
232 // Changes of these flags only cause paint invalidations. 232 // Changes of these flags only cause paint invalidations.
233 if (svg_inherited_flags._colorRendering != other->svg_inherited_flags._color Rendering 233 if (svg_inherited_flags._colorRendering != other->svg_inherited_flags._color Rendering
234 || svg_inherited_flags._shapeRendering != other->svg_inherited_flags._sh apeRendering 234 || svg_inherited_flags._shapeRendering != other->svg_inherited_flags._sh apeRendering
235 || svg_inherited_flags._clipRule != other->svg_inherited_flags._clipRule 235 || svg_inherited_flags._clipRule != other->svg_inherited_flags._clipRule
236 || svg_inherited_flags._fillRule != other->svg_inherited_flags._fillRule 236 || svg_inherited_flags._fillRule != other->svg_inherited_flags._fillRule
237 || svg_inherited_flags._colorInterpolation != other->svg_inherited_flags ._colorInterpolation 237 || svg_inherited_flags._colorInterpolation != other->svg_inherited_flags ._colorInterpolation
238 || svg_inherited_flags._colorInterpolationFilters != other->svg_inherite d_flags._colorInterpolationFilters 238 || svg_inherited_flags._colorInterpolationFilters != other->svg_inherite d_flags._colorInterpolationFilters
239 || svg_inherited_flags._paintOrder != other->svg_inherited_flags._paintO rder) 239 || svg_inherited_flags.paintOrder != other->svg_inherited_flags.paintOrd er)
240 return true; 240 return true;
241 241
242 if (svg_noninherited_flags.f.bufferedRendering != other->svg_noninherited_fl ags.f.bufferedRendering) 242 if (svg_noninherited_flags.f.bufferedRendering != other->svg_noninherited_fl ags.f.bufferedRendering)
243 return true; 243 return true;
244 244
245 if (svg_noninherited_flags.f.maskType != other->svg_noninherited_flags.f.mas kType) 245 if (svg_noninherited_flags.f.maskType != other->svg_noninherited_flags.f.mas kType)
246 return true; 246 return true;
247 247
248 return false; 248 return false;
249 } 249 }
250 250
251 EPaintOrderType SVGComputedStyle::paintOrderType(unsigned index) const 251 Vector<EPaintOrderType, 3> SVGComputedStyle::paintTypesForPaintOrder() const
pdr. 2015/07/29 05:20:50 Returning a Vector seems a bit heavy for this code
Shanmuga Pandi 2015/07/29 06:55:04 Ok. I will try to change the code as you suggested
252 { 252 {
253 ASSERT(index < ((1 << kPaintOrderBitwidth)-1)); 253 Vector<EPaintOrderType, 3> paintOrder;
254 unsigned pt = (paintOrder() >> (kPaintOrderBitwidth*index)) & ((1u << kPaint OrderBitwidth) - 1); 254 switch (this->paintOrder()) {
255 return (EPaintOrderType)pt; 255 case PaintOrderNormal:
256 case PaintOrderFill:
257 paintOrder.append(PT_FILL);
258 paintOrder.append(PT_STROKE);
259 paintOrder.append(PT_MARKERS);
260 break;
261 case PaintOrderFillMarkers:
262 paintOrder.append(PT_FILL);
263 paintOrder.append(PT_MARKERS);
264 paintOrder.append(PT_STROKE);
265 break;
266 case PaintOrderStroke:
267 paintOrder.append(PT_STROKE);
268 paintOrder.append(PT_FILL);
269 paintOrder.append(PT_MARKERS);
270 break;
271 case PaintOrderStrokeMarkers:
272 paintOrder.append(PT_STROKE);
273 paintOrder.append(PT_MARKERS);
274 paintOrder.append(PT_FILL);
275 break;
276 case PaintOrderMarkers:
277 paintOrder.append(PT_MARKERS);
278 paintOrder.append(PT_FILL);
279 paintOrder.append(PT_STROKE);
280 break;
281 case PaintOrderMarkersStroke:
282 paintOrder.append(PT_MARKERS);
283 paintOrder.append(PT_STROKE);
284 paintOrder.append(PT_FILL);
285 break;
286 }
287
288 return paintOrder;
256 } 289 }
257 290
258 } 291 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698