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

Unified Diff: Source/core/html/canvas/DOMPath.h

Issue 170503002: Implement addPath() method for Path object (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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
« no previous file with comments | « Source/core/html/canvas/CanvasPathMethods.h ('k') | Source/core/html/canvas/Path.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/DOMPath.h
diff --git a/Source/core/html/canvas/DOMPath.h b/Source/core/html/canvas/DOMPath.h
index abb01a6fd71745ea202006276c032113dc686b11..e80fc867af7d9a4e0f37e747f7648be22c33328a 100644
--- a/Source/core/html/canvas/DOMPath.h
+++ b/Source/core/html/canvas/DOMPath.h
@@ -30,7 +30,9 @@
#include "bindings/v8/ScriptWrappable.h"
#include "core/html/canvas/CanvasPathMethods.h"
+#include "core/svg/SVGMatrixTearOff.h"
#include "core/svg/SVGPathUtilities.h"
+#include "platform/transforms/AffineTransform.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
@@ -48,6 +50,16 @@ public:
const Path& path() const { return m_path; }
virtual ~DOMPath() { }
+
+ void addPath(DOMPath* path, SVGMatrixTearOff* transform, ExceptionState& exceptionState)
+ {
+ if (!path) {
+ exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::argumentNullOrIncorrectType(1, "Path"));
+ return;
+ }
+ Path src = path->path();
+ m_path.addPath(src, transform ? transform->value() : AffineTransform(1, 0, 0, 1, 0, 0));
+ }
private:
DOMPath() : CanvasPathMethods()
{
@@ -55,17 +67,15 @@ private:
}
DOMPath(const Path& path)
- : CanvasPathMethods()
+ : CanvasPathMethods(path)
{
ScriptWrappable::init(this);
- m_path = path;
}
DOMPath(DOMPath* path)
- : CanvasPathMethods()
+ : CanvasPathMethods(path->path())
{
ScriptWrappable::init(this);
- m_path = path->path();
}
DOMPath(const String& pathData)
« no previous file with comments | « Source/core/html/canvas/CanvasPathMethods.h ('k') | Source/core/html/canvas/Path.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698