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, |