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

Unified Diff: third_party/WebKit/Source/core/dom/DOMQuad.cpp

Issue 2638413005: [GeometryInterface] add fromQuad function in DOMQuad. (Closed)
Patch Set: [WIP] formQuad Created 3 years, 11 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 | « third_party/WebKit/Source/core/dom/DOMQuad.h ('k') | third_party/WebKit/Source/core/dom/DOMQuad.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/DOMQuad.cpp
diff --git a/third_party/WebKit/Source/core/dom/DOMQuad.cpp b/third_party/WebKit/Source/core/dom/DOMQuad.cpp
index 1b87a2196f8f044c3a77f6ccbf8b4da5a1cf691a..853e0740e2a90328592cd8861bfa1fd13b31987e 100644
--- a/third_party/WebKit/Source/core/dom/DOMQuad.cpp
+++ b/third_party/WebKit/Source/core/dom/DOMQuad.cpp
@@ -6,6 +6,7 @@
#include "bindings/core/v8/V8ObjectBuilder.h"
#include "core/dom/DOMPoint.h"
+#include "core/dom/DOMQuadInit.h"
#include "core/dom/DOMRectInit.h"
namespace blink {
@@ -21,6 +22,13 @@ DOMQuad* DOMQuad::fromRect(const DOMRectInit& other) {
return new DOMQuad(other.x(), other.y(), other.width(), other.height());
}
+DOMQuad* DOMQuad::fromQuad(const DOMQuadInit& other) {
+ return new DOMQuad(other.hasP1() ? other.p1() : DOMPointInit(),
+ other.hasP2() ? other.p2() : DOMPointInit(),
+ other.hasP3() ? other.p3() : DOMPointInit(),
+ other.hasP3() ? other.p4() : DOMPointInit());
+}
+
DOMQuad::DOMQuad(const DOMPointInit& p1,
const DOMPointInit& p2,
const DOMPointInit& p3,
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMQuad.h ('k') | third_party/WebKit/Source/core/dom/DOMQuad.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698