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

Unified Diff: third_party/WebKit/Source/core/layout/svg/SVGMarkerData.h

Issue 2540513005: Cleanup SVGMarkerData::updateFromPathElement (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/svg/SVGMarkerData.h
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGMarkerData.h b/third_party/WebKit/Source/core/layout/svg/SVGMarkerData.h
index 95560159e17d36e28c438ebc6da7ec76609d04b2..20527e24b7041c21c56f2aac63ba1219d957010a 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGMarkerData.h
+++ b/third_party/WebKit/Source/core/layout/svg/SVGMarkerData.h
@@ -52,23 +52,7 @@ class SVGMarkerData {
m_autoStartReverse(autoStartReverse) {}
static void updateFromPathElement(void* info, const PathElement* element) {
- SVGMarkerData* markerData = static_cast<SVGMarkerData*>(info);
-
- // First update the outslope for the previous element.
- markerData->updateOutslope(element->points[0]);
-
- // Record the marker for the previous element.
- if (markerData->m_elementIndex > 0) {
- SVGMarkerType markerType =
- markerData->m_elementIndex == 1 ? StartMarker : MidMarker;
- markerData->m_positions.append(
- MarkerPosition(markerType, markerData->m_origin,
- markerData->currentAngle(markerType)));
- }
-
- // Update our marker data for this element.
- markerData->updateMarkerDataForPathElement(element);
- ++markerData->m_elementIndex;
+ static_cast<SVGMarkerData*>(info)->updateFromPathElement(*element);
}
void pathIsDone() {
@@ -127,10 +111,26 @@ class SVGMarkerData {
m_outslopePoints[1] = point;
}
- void updateMarkerDataForPathElement(const PathElement* element) {
- FloatPoint* points = element->points;
+ void updateFromPathElement(const PathElement& element) {
+ // First update the outslope for the previous element.
+ updateOutslope(element.points[0]);
+
+ // Record the marker for the previous element.
+ if (m_elementIndex > 0) {
+ SVGMarkerType markerType = m_elementIndex == 1 ? StartMarker : MidMarker;
+ m_positions.append(
+ MarkerPosition(markerType, m_origin, currentAngle(markerType)));
+ }
+
+ // Update our marker data for this element.
+ updateMarkerDataForPathElement(element);
+ ++m_elementIndex;
+ }
+
+ void updateMarkerDataForPathElement(const PathElement& element) {
+ const FloatPoint* points = element.points;
- switch (element->type) {
+ switch (element.type) {
case PathElementAddQuadCurveToPoint:
m_inslopePoints[0] = points[0];
m_inslopePoints[1] = points[1];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698