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

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

Issue 300223009: Implement basic parts of hit regions on canvas2d. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add clip tests Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/platform/graphics/Path.cpp
diff --git a/Source/platform/graphics/Path.cpp b/Source/platform/graphics/Path.cpp
index 1fb35c058621dc9bf19e4bf90f3aaed9956b8a72..4d778531a885fa7048cd97c4ad286e183541a494 100644
--- a/Source/platform/graphics/Path.cpp
+++ b/Source/platform/graphics/Path.cpp
@@ -51,6 +51,11 @@ Path::Path(const Path& other)
m_path = SkPath(other.m_path);
}
+Path::Path(const SkPath& skPath)
+{
+ m_path = skPath;
+}
+
Path::~Path()
{
}
@@ -482,6 +487,16 @@ void Path::translate(const FloatSize& size)
m_path.offset(WebCoreFloatToSkScalar(size.width()), WebCoreFloatToSkScalar(size.height()));
}
+bool Path::subtractPath(const Path& other)
+{
+ return Op(m_path, other.m_path, kDifference_PathOp, &m_path);
+}
+
+bool Path::intersectPath(const Path& other)
+{
+ return Op(m_path, other.m_path, kIntersect_PathOp, &m_path);
+}
+
bool Path::unionPath(const Path& other)
{
return Op(m_path, other.m_path, kUnion_PathOp, &m_path);
« Source/platform/graphics/GraphicsContext.cpp ('K') | « Source/platform/graphics/Path.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698