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

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

Issue 412373003: Implement DOMQuad of geometry interfaces. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: expected.txt Created 6 years, 5 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..33b50a8a57c1b28917ec64d7d104146b1ace55b7
--- /dev/null
+++ b/Source/core/dom/DOMQuad.h
@@ -0,0 +1,64 @@
+// Copyright 2014 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 "core/dom/DOMPoint.h"
+#include "core/dom/DOMRect.h"
+
+namespace blink {
+
+typedef const Dictionary DOMPointInit;
+typedef const Dictionary DOMRectInit;
+
+class DOMQuad;
+
+class DOMQuadPoint : public DOMPoint {
+public:
+ static DOMQuadPoint* create(DOMPointInit&, Member<DOMQuad>);
+ static DOMQuadPoint* create(double x, double y, Member<DOMQuad>);
+
+ virtual void setX(double) OVERRIDE;
+ virtual void setY(double) OVERRIDE;
+
+ virtual void trace(Visitor*) OVERRIDE;
+
+private:
+ DOMQuadPoint(double x, double y, Member<DOMQuad>);
+
+ Member<DOMQuad> m_quad;
+};
+
+class DOMQuad : public GarbageCollected<DOMQuad> {
+public:
+ static DOMQuad* create(DOMRectInit& = DOMRectInit());
+ static DOMQuad* create(DOMPointInit&, DOMPointInit&,
+ DOMPointInit& = DOMPointInit(), DOMPointInit& = 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();
+
+ void trace(Visitor*);
+
+protected:
+ DOMQuad(double x, double y, double width, double height);
+ DOMQuad(DOMPointInit&, DOMPointInit&, DOMPointInit&, 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