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

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

Issue 2168133002: Compute exact bounds for SVGPathElement::getBBox() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 4 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) 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 Path(const Path&); 72 Path(const Path&);
73 Path(const SkPath&); 73 Path(const SkPath&);
74 Path& operator=(const Path&); 74 Path& operator=(const Path&);
75 Path& operator=(const SkPath&); 75 Path& operator=(const SkPath&);
76 bool operator==(const Path&) const; 76 bool operator==(const Path&) const;
77 77
78 bool contains(const FloatPoint&) const; 78 bool contains(const FloatPoint&) const;
79 bool contains(const FloatPoint&, WindRule) const; 79 bool contains(const FloatPoint&, WindRule) const;
80 bool strokeContains(const FloatPoint&, const StrokeData&) const; 80 bool strokeContains(const FloatPoint&, const StrokeData&) const;
81 FloatRect boundingRect() const; 81
82 FloatRect strokeBoundingRect(const StrokeData&) const; 82 enum class BoundsType {
83 Conservative, // Fast version, includes control points.
84 Exact, // Tight, slower version.
85 };
86 FloatRect boundingRect(BoundsType = BoundsType::Conservative) const;
87 FloatRect strokeBoundingRect(const StrokeData&, BoundsType = BoundsType::Con servative) const;
83 88
84 float length() const; 89 float length() const;
85 FloatPoint pointAtLength(float length) const; 90 FloatPoint pointAtLength(float length) const;
86 void pointAndNormalAtLength(float length, FloatPoint&, float&) const; 91 void pointAndNormalAtLength(float length, FloatPoint&, float&) const;
87 92
88 // Helper for computing a sequence of positions and normals (normal angles) on a path. 93 // 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 94 // The best possible access pattern will be one where the |length| value is
90 // strictly increasing. 95 // strictly increasing.
91 // For other access patterns, performance will vary depending on curvature 96 // For other access patterns, performance will vary depending on curvature
92 // and number of segments, but should never be worse than that of the 97 // and number of segments, but should never be worse than that of the
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 SkPath m_path; 165 SkPath m_path;
161 }; 166 };
162 167
163 #if ENABLE(ASSERT) 168 #if ENABLE(ASSERT)
164 PLATFORM_EXPORT bool ellipseIsRenderable(float startAngle, float endAngle); 169 PLATFORM_EXPORT bool ellipseIsRenderable(float startAngle, float endAngle);
165 #endif 170 #endif
166 171
167 } // namespace blink 172 } // namespace blink
168 173
169 #endif 174 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGPathElement.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