OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CompositorProxy_h | 5 #ifndef CompositorProxy_h |
6 #define CompositorProxy_h | 6 #define CompositorProxy_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "core/dom/DOMMatrix.h" | 9 #include "core/dom/DOMMatrix.h" |
10 #include "core/dom/Element.h" | 10 #include "core/dom/Element.h" |
11 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
12 #include "wtf/PassOwnPtr.h" | 12 #include "wtf/PassOwnPtr.h" |
13 #include "wtf/PassRefPtr.h" | 13 #include "wtf/PassRefPtr.h" |
14 #include "wtf/RefCounted.h" | 14 #include "wtf/RefCounted.h" |
15 #include "wtf/text/WTFString.h" | 15 #include "wtf/text/WTFString.h" |
16 | 16 |
17 namespace blink { | 17 namespace blink { |
18 | 18 |
19 class DOMMatrix; | 19 class DOMMatrix; |
20 class ExceptionState; | 20 class ExceptionState; |
21 class ExecutionContext; | 21 class ExecutionContext; |
22 | 22 |
23 class CompositorProxy final : public GarbageCollectedFinalized<CompositorProxy>,
public ScriptWrappable { | 23 class CompositorProxy final : public GarbageCollectedFinalized<CompositorProxy>,
public ScriptWrappable { |
24 DEFINE_WRAPPERTYPEINFO(); | 24 DEFINE_WRAPPERTYPEINFO(); |
25 public: | 25 public: |
26 static CompositorProxy* create(ExecutionContext*, Element*, const Vector<Str
ing>& attributeArray, ExceptionState&); | 26 static CompositorProxy* create(ExecutionContext*, Element*, const Vector<Str
ing>& attributeArray, ExceptionState&); |
27 static CompositorProxy* create(uint64_t element, uint32_t attributeFlags); | 27 static CompositorProxy* create(uint64_t element, uint32_t compositorMutableP
roperties); |
28 virtual ~CompositorProxy(); | 28 virtual ~CompositorProxy(); |
29 | 29 |
30 enum class Attributes { | |
31 NONE = 0, | |
32 OPACITY = 1 << 0, | |
33 SCROLL_LEFT = 1 << 1, | |
34 SCROLL_TOP = 1 << 2, | |
35 TOUCH = 1 << 3, | |
36 TRANSFORM = 1 << 4, | |
37 }; | |
38 | |
39 DEFINE_INLINE_TRACE() | 30 DEFINE_INLINE_TRACE() |
40 { | 31 { |
41 visitor->trace(m_transform); | 32 visitor->trace(m_transform); |
42 } | 33 } |
43 | 34 |
44 uint64_t elementId() const { return m_elementId; } | 35 uint64_t elementId() const { return m_elementId; } |
45 uint32_t bitfieldsSupported() const { return m_bitfieldsSupported; } | 36 uint32_t compositorMutableProperties() const { return m_compositorMutablePro
perties; } |
46 bool supports(const String& attribute) const; | 37 bool supports(const String& attribute) const; |
47 | 38 |
48 bool connected() const { return m_connected; } | 39 bool connected() const { return m_connected; } |
49 void disconnect(); | 40 void disconnect(); |
50 | 41 |
51 double opacity(ExceptionState&) const; | 42 double opacity(ExceptionState&) const; |
52 double scrollLeft(ExceptionState&) const; | 43 double scrollLeft(ExceptionState&) const; |
53 double scrollTop(ExceptionState&) const; | 44 double scrollTop(ExceptionState&) const; |
54 DOMMatrix* transform(ExceptionState&) const; | 45 DOMMatrix* transform(ExceptionState&) const; |
55 | 46 |
56 void setOpacity(double, ExceptionState&); | 47 void setOpacity(double, ExceptionState&); |
57 void setScrollLeft(double, ExceptionState&); | 48 void setScrollLeft(double, ExceptionState&); |
58 void setScrollTop(double, ExceptionState&); | 49 void setScrollTop(double, ExceptionState&); |
59 void setTransform(DOMMatrix*, ExceptionState&); | 50 void setTransform(DOMMatrix*, ExceptionState&); |
60 | 51 |
61 protected: | 52 protected: |
62 CompositorProxy(Element&, const Vector<String>& attributeArray); | 53 CompositorProxy(Element&, const Vector<String>& attributeArray); |
63 CompositorProxy(uint64_t element, uint32_t attributeFlags); | 54 CompositorProxy(uint64_t element, uint32_t compositorMutableProperties); |
64 | 55 |
65 private: | 56 private: |
66 bool raiseExceptionIfNotMutable(Attributes, ExceptionState&) const; | 57 bool raiseExceptionIfNotMutable(uint32_t compositorMutableProperty, Exceptio
nState&) const; |
67 | 58 |
68 const uint64_t m_elementId = 0; | 59 const uint64_t m_elementId = 0; |
69 const uint32_t m_bitfieldsSupported = 0; | 60 const uint32_t m_compositorMutableProperties = 0; |
70 uint32_t m_mutatedAttributes = 0; | 61 uint32_t m_mutatedProperties = 0; |
71 | 62 |
72 double m_opacity = 0; | 63 double m_opacity = 0; |
73 double m_scrollLeft = 0; | 64 double m_scrollLeft = 0; |
74 double m_scrollTop = 0; | 65 double m_scrollTop = 0; |
75 Member<DOMMatrix> m_transform; | 66 Member<DOMMatrix> m_transform; |
76 | 67 |
77 bool m_connected = true; | 68 bool m_connected = true; |
78 }; | 69 }; |
79 | 70 |
80 } // namespace blink | 71 } // namespace blink |
81 | 72 |
82 #endif // CompositorProxy_h | 73 #endif // CompositorProxy_h |
OLD | NEW |