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

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

Issue 539833004: [SVG2] Add support for marker orient="auto-start-reverse". (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review fixes 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
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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 354
355 RenderSVGResourceMarker* markerStart = resources->markerStart(); 355 RenderSVGResourceMarker* markerStart = resources->markerStart();
356 RenderSVGResourceMarker* markerMid = resources->markerMid(); 356 RenderSVGResourceMarker* markerMid = resources->markerMid();
357 RenderSVGResourceMarker* markerEnd = resources->markerEnd(); 357 RenderSVGResourceMarker* markerEnd = resources->markerEnd();
358 ASSERT(markerStart || markerMid || markerEnd); 358 ASSERT(markerStart || markerMid || markerEnd);
359 359
360 FloatRect boundaries; 360 FloatRect boundaries;
361 unsigned size = m_markerPositions.size(); 361 unsigned size = m_markerPositions.size();
362 for (unsigned i = 0; i < size; ++i) { 362 for (unsigned i = 0; i < size; ++i) {
363 if (RenderSVGResourceMarker* marker = markerForType(m_markerPositions[i] .type, markerStart, markerMid, markerEnd)) 363 if (RenderSVGResourceMarker* marker = markerForType(m_markerPositions[i] .type, markerStart, markerMid, markerEnd))
364 boundaries.unite(marker->markerBoundaries(marker->markerTransformati on(m_markerPositions[i].origin, m_markerPositions[i].angle, strokeWidth))); 364 boundaries.unite(marker->markerBoundaries(marker->markerTransformati on(m_markerPositions[i].origin, m_markerPositions[i].angle, strokeWidth, m_marke rPositions[i].type == StartMarker)));
365 } 365 }
366 return boundaries; 366 return boundaries;
367 } 367 }
368 368
369 FloatRect RenderSVGShape::calculateObjectBoundingBox() const 369 FloatRect RenderSVGShape::calculateObjectBoundingBox() const
370 { 370 {
371 return path().boundingRect(); 371 return path().boundingRect();
372 } 372 }
373 373
374 FloatRect RenderSVGShape::calculateStrokeBoundingBox() const 374 FloatRect RenderSVGShape::calculateStrokeBoundingBox() const
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 RenderSVGResourceMarker* markerStart = resources->markerStart(); 432 RenderSVGResourceMarker* markerStart = resources->markerStart();
433 RenderSVGResourceMarker* markerMid = resources->markerMid(); 433 RenderSVGResourceMarker* markerMid = resources->markerMid();
434 RenderSVGResourceMarker* markerEnd = resources->markerEnd(); 434 RenderSVGResourceMarker* markerEnd = resources->markerEnd();
435 if (!markerStart && !markerMid && !markerEnd) 435 if (!markerStart && !markerMid && !markerEnd)
436 return; 436 return;
437 437
438 float strokeWidth = this->strokeWidth(); 438 float strokeWidth = this->strokeWidth();
439 unsigned size = m_markerPositions.size(); 439 unsigned size = m_markerPositions.size();
440 for (unsigned i = 0; i < size; ++i) { 440 for (unsigned i = 0; i < size; ++i) {
441 if (RenderSVGResourceMarker* marker = markerForType(m_markerPositions[i] .type, markerStart, markerMid, markerEnd)) 441 if (RenderSVGResourceMarker* marker = markerForType(m_markerPositions[i] .type, markerStart, markerMid, markerEnd))
442 marker->draw(paintInfo, marker->markerTransformation(m_markerPositio ns[i].origin, m_markerPositions[i].angle, strokeWidth)); 442 marker->draw(paintInfo, marker->markerTransformation(m_markerPositio ns[i].origin, m_markerPositions[i].angle, strokeWidth, m_markerPositions[i].type == StartMarker));
443 } 443 }
444 } 444 }
445 445
446 void RenderSVGShape::processMarkerPositions() 446 void RenderSVGShape::processMarkerPositions()
447 { 447 {
448 m_markerPositions.clear(); 448 m_markerPositions.clear();
449 449
450 if (!shouldGenerateMarkerPositions()) 450 if (!shouldGenerateMarkerPositions())
451 return; 451 return;
452 452
453 ASSERT(m_path); 453 ASSERT(m_path);
454 454
455 SVGMarkerData markerData(m_markerPositions); 455 SVGMarkerData markerData(m_markerPositions);
456 m_path->apply(&markerData, SVGMarkerData::updateFromPathElement); 456 m_path->apply(&markerData, SVGMarkerData::updateFromPathElement);
457 markerData.pathIsDone(); 457 markerData.pathIsDone();
458 } 458 }
459 459
460 } 460 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698