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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/Path.h

Issue 1418663004: SVG animateMotion paths that only cause offsets are no longer ignored (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved.
3 * 2006 Rob Buis <buis@kde.org> 3 * 2006 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007-2008 Torch Mobile, Inc. 4 * Copyright (C) 2007-2008 Torch Mobile, Inc.
5 * Copyright (C) 2013 Google Inc. All rights reserved. 5 * Copyright (C) 2013 Google Inc. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 Path& operator=(const Path&); 75 Path& operator=(const Path&);
76 Path& operator=(const SkPath&); 76 Path& operator=(const SkPath&);
77 bool operator==(const Path&) const; 77 bool operator==(const Path&) const;
78 78
79 bool contains(const FloatPoint&, WindRule = RULE_NONZERO) const; 79 bool contains(const FloatPoint&, WindRule = RULE_NONZERO) const;
80 bool strokeContains(const FloatPoint&, const StrokeData&) const; 80 bool strokeContains(const FloatPoint&, const StrokeData&) const;
81 FloatRect boundingRect() const; 81 FloatRect boundingRect() const;
82 FloatRect strokeBoundingRect(const StrokeData&) const; 82 FloatRect strokeBoundingRect(const StrokeData&) const;
83 83
84 float length() const; 84 float length() const;
85 FloatPoint pointAtLength(float length, bool& ok) const; 85 FloatPoint pointAtLength(float length) const;
86 bool pointAndNormalAtLength(float length, FloatPoint&, float&) const; 86 void pointAndNormalAtLength(float length, FloatPoint&, float&) const;
87 87
88 // Helper for computing a sequence of positions and normals (normal angles) on a path. 88 // Helper for computing a sequence of positions and normals (normal angles) on a path.
89 // The best possible access pattern will be one where the |length| value is 89 // The best possible access pattern will be one where the |length| value is
90 // strictly increasing. 90 // strictly increasing.
91 // For other access patterns, performance will vary depending on curvature 91 // For other access patterns, performance will vary depending on curvature
92 // and number of segments, but should never be worse than that of the 92 // and number of segments, but should never be worse than that of the
93 // state-less method on Path. 93 // state-less method on Path.
94 class PLATFORM_EXPORT PositionCalculator { 94 class PLATFORM_EXPORT PositionCalculator {
95 WTF_MAKE_NONCOPYABLE(PositionCalculator); 95 WTF_MAKE_NONCOPYABLE(PositionCalculator);
96 public: 96 public:
97 explicit PositionCalculator(const Path&); 97 explicit PositionCalculator(const Path&);
98 98
99 bool pointAndNormalAtLength(float length, FloatPoint&, float&); 99 void pointAndNormalAtLength(float length, FloatPoint&, float&);
100 100
101 private: 101 private:
102 SkPath m_path; 102 SkPath m_path;
103 SkPathMeasure m_pathMeasure; 103 SkPathMeasure m_pathMeasure;
104 SkScalar m_accumulatedLength; 104 SkScalar m_accumulatedLength;
105 }; 105 };
106 106
107 void clear(); 107 void clear();
108 bool isEmpty() const; 108 bool isEmpty() const;
109 // Specify whether this path is volatile. Temporary paths that are discarded or 109 // Specify whether this path is volatile. Temporary paths that are discarded or
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 SkPath m_path; 157 SkPath m_path;
158 }; 158 };
159 159
160 #if ENABLE(ASSERT) 160 #if ENABLE(ASSERT)
161 PLATFORM_EXPORT bool ellipseIsRenderable(float startAngle, float endAngle); 161 PLATFORM_EXPORT bool ellipseIsRenderable(float startAngle, float endAngle);
162 #endif 162 #endif
163 163
164 } // namespace blink 164 } // namespace blink
165 165
166 #endif 166 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp ('k') | third_party/WebKit/Source/platform/graphics/Path.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698