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

Unified Diff: third_party/WebKit/Source/platform/graphics/Path.cpp

Issue 1532923002: Add a Path::contains() version that use the Path's winding rule (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forward declare Path in GC.h Created 5 years 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
Index: third_party/WebKit/Source/platform/graphics/Path.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/Path.cpp b/third_party/WebKit/Source/platform/graphics/Path.cpp
index b23f1aab70619fb43b0b0626e974e0cbf46700fd..32fd602081e6e29a922e4419b2b2bb64eed088fd 100644
--- a/third_party/WebKit/Source/platform/graphics/Path.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Path.cpp
@@ -72,9 +72,14 @@ bool Path::operator==(const Path& other) const
return m_path == other.m_path;
}
+bool Path::contains(const FloatPoint& point) const
+{
+ return SkPathContainsPoint(m_path, point, m_path.getFillType());
+}
+
bool Path::contains(const FloatPoint& point, WindRule rule) const
{
- return SkPathContainsPoint(m_path, point, static_cast<SkPath::FillType>(rule));
+ return SkPathContainsPoint(m_path, point, WebCoreWindRuleToSkFillType(rule));
}
// FIXME: this method ignores the CTM and may yield inaccurate results for large scales.
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/Path.h ('k') | third_party/WebKit/Source/platform/graphics/skia/SkiaUtils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698