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

Side by Side Diff: Source/core/rendering/svg/RenderSVGShape.cpp

Issue 571923002: Move geometry generation out of RenderSVGResource*::postApplyResource (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Drop curly braces. Created 6 years, 3 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 * Copyright (C) 2004, 2005, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2008 Rob Buis <buis@kde.org>
4 * Copyright (C) 2005, 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2005, 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. 5 * Copyright (C) 2009 Google, Inc.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
8 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 8 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
9 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> 9 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org>
10 * Copyright (C) 2011 University of Szeged 10 * Copyright (C) 2011 University of Szeged
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 return false; 198 return false;
199 199
200 return resources->markerStart() || resources->markerMid() || resources->mark erEnd(); 200 return resources->markerStart() || resources->markerMid() || resources->mark erEnd();
201 } 201 }
202 202
203 void RenderSVGShape::fillShape(RenderStyle* style, GraphicsContext* context) 203 void RenderSVGShape::fillShape(RenderStyle* style, GraphicsContext* context)
204 { 204 {
205 bool hasFallback; 205 bool hasFallback;
206 if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintin gResource(this, style, hasFallback)) { 206 if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintin gResource(this, style, hasFallback)) {
207 if (fillPaintingResource->applyResource(this, style, context, ApplyToFil lMode)) { 207 if (fillPaintingResource->applyResource(this, style, context, ApplyToFil lMode)) {
208 fillPaintingResource->postApplyResource(this, context, ApplyToFillMo de, 0, this); 208 fillShape(context);
209 fillPaintingResource->postApplyResource(this, context);
209 } else if (hasFallback) { 210 } else if (hasFallback) {
210 RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::s haredSolidPaintingResource(); 211 RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::s haredSolidPaintingResource();
211 if (fallbackResource->applyResource(this, style, context, ApplyToFil lMode)) 212 if (fallbackResource->applyResource(this, style, context, ApplyToFil lMode)) {
212 fallbackResource->postApplyResource(this, context, ApplyToFillMo de, 0, this); 213 fillShape(context);
214 fallbackResource->postApplyResource(this, context);
215 }
213 } 216 }
214 } 217 }
215 } 218 }
216 219
217 void RenderSVGShape::strokeShape(RenderStyle* style, GraphicsContext* context) 220 void RenderSVGShape::strokeShape(RenderStyle* style, GraphicsContext* context)
218 { 221 {
219 bool hasFallback; 222 bool hasFallback;
220 if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePai ntingResource(this, style, hasFallback)) { 223 if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePai ntingResource(this, style, hasFallback)) {
221 if (strokePaintingResource->applyResource(this, style, context, ApplyToS trokeMode)) { 224 if (strokePaintingResource->applyResource(this, style, context, ApplyToS trokeMode)) {
222 strokePaintingResource->postApplyResource(this, context, ApplyToStro keMode, 0, this); 225 strokeShape(context);
226 strokePaintingResource->postApplyResource(this, context);
223 } else if (hasFallback) { 227 } else if (hasFallback) {
224 RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::s haredSolidPaintingResource(); 228 RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::s haredSolidPaintingResource();
225 if (fallbackResource->applyResource(this, style, context, ApplyToStr okeMode)) 229 if (fallbackResource->applyResource(this, style, context, ApplyToStr okeMode)) {
226 fallbackResource->postApplyResource(this, context, ApplyToStroke Mode, 0, this); 230 strokeShape(context);
231 fallbackResource->postApplyResource(this, context);
232 }
227 } 233 }
228 } 234 }
229 } 235 }
230 236
231 void RenderSVGShape::paint(PaintInfo& paintInfo, const LayoutPoint&) 237 void RenderSVGShape::paint(PaintInfo& paintInfo, const LayoutPoint&)
232 { 238 {
233 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this); 239 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this);
234 if (paintInfo.phase != PaintPhaseForeground 240 if (paintInfo.phase != PaintPhaseForeground
235 || style()->visibility() == HIDDEN 241 || style()->visibility() == HIDDEN
236 || isShapeEmpty()) 242 || isShapeEmpty())
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 ASSERT(resources); 462 ASSERT(resources);
457 463
458 RenderSVGResourceMarker* markerStart = resources->markerStart(); 464 RenderSVGResourceMarker* markerStart = resources->markerStart();
459 465
460 SVGMarkerData markerData(m_markerPositions, markerStart ? markerStart->orien tType() == SVGMarkerOrientAutoStartReverse : false); 466 SVGMarkerData markerData(m_markerPositions, markerStart ? markerStart->orien tType() == SVGMarkerOrientAutoStartReverse : false);
461 m_path->apply(&markerData, SVGMarkerData::updateFromPathElement); 467 m_path->apply(&markerData, SVGMarkerData::updateFromPathElement);
462 markerData.pathIsDone(); 468 markerData.pathIsDone();
463 } 469 }
464 470
465 } 471 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceSolidColor.cpp ('k') | Source/core/rendering/svg/SVGInlineTextBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698