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

Unified Diff: Source/core/dom/DOMQuad.h

Issue 964333002: Implement DOMQuad of geometry interfaces. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: expected Created 5 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/dom/DOMPointReadOnly.h ('k') | Source/core/dom/DOMQuad.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DOMQuad.h
diff --git a/Source/core/dom/DOMQuad.h b/Source/core/dom/DOMQuad.h
new file mode 100644
index 0000000000000000000000000000000000000000..474d7cb3929b0fb96be6ea095db9340cc6b0a1f4
--- /dev/null
+++ b/Source/core/dom/DOMQuad.h
@@ -0,0 +1,73 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DOMQuad_h
+#define DOMQuad_h
+
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "core/dom/DOMPoint.h"
+#include "core/dom/DOMRect.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class DOMRectInit;
+class DOMQuad;
+
+class DOMQuadPoint final : public DOMPoint {
+public:
+ static DOMQuadPoint* create(const DOMPointInit&, Member<DOMQuad>);
+ static DOMQuadPoint* create(double x, double y, Member<DOMQuad>);
+
+ virtual void setX(double) override;
+ virtual void setY(double) override;
+
+ DEFINE_INLINE_VIRTUAL_TRACE() { visitor->trace(m_quad); DOMPoint::trace(visitor); }
+
+private:
+ DOMQuadPoint(double x, double y, Member<DOMQuad>);
+
+ Member<DOMQuad> m_quad;
+};
+
+class DOMQuad final : public GarbageCollected<DOMQuad>, public ScriptWrappable {
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ static DOMQuad* create(const DOMRectInit&);
+ static DOMQuad* create(const DOMPointInit&, const DOMPointInit&,
+ const DOMPointInit&, const DOMPointInit&);
+
+ DOMPoint* p1() const { return m_p1.get(); }
+ DOMPoint* p2() const { return m_p2.get(); }
+ DOMPoint* p3() const { return m_p3.get(); }
+ DOMPoint* p4() const { return m_p4.get(); }
+ DOMRectReadOnly* bounds();
+
+ void updateHorizontalBounds();
+ void updateVerticalBounds();
+
+ DEFINE_INLINE_TRACE()
+ {
+ visitor->trace(m_p1);
+ visitor->trace(m_p2);
+ visitor->trace(m_p3);
+ visitor->trace(m_p4);
+ visitor->trace(m_bounds);
+ }
+
+protected:
+ DOMQuad(const DOMRectInit&);
+ DOMQuad(const DOMPointInit&, const DOMPointInit&,
+ const DOMPointInit&, const DOMPointInit&);
+
+ Member<DOMPoint> m_p1;
+ Member<DOMPoint> m_p2;
+ Member<DOMPoint> m_p3;
+ Member<DOMPoint> m_p4;
+ Member<DOMRect> m_bounds;
+};
+
+} // namespace blink
+
+#endif
« no previous file with comments | « Source/core/dom/DOMPointReadOnly.h ('k') | Source/core/dom/DOMQuad.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698