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/CoreExport.h" |
| 10 #include "core/dom/CompositorProxyClient.h" |
9 #include "core/dom/DOMMatrix.h" | 11 #include "core/dom/DOMMatrix.h" |
10 #include "core/dom/Element.h" | 12 #include "core/dom/Element.h" |
11 #include "platform/heap/Handle.h" | 13 #include "platform/heap/Handle.h" |
12 #include "wtf/PassOwnPtr.h" | 14 #include "wtf/PassOwnPtr.h" |
13 #include "wtf/PassRefPtr.h" | 15 #include "wtf/PassRefPtr.h" |
14 #include "wtf/RefCounted.h" | 16 #include "wtf/RefCounted.h" |
15 #include "wtf/text/WTFString.h" | 17 #include "wtf/text/WTFString.h" |
16 | 18 |
17 namespace blink { | 19 namespace blink { |
18 | 20 |
19 class DOMMatrix; | 21 class DOMMatrix; |
20 class ExceptionState; | 22 class ExceptionState; |
21 class ExecutionContext; | 23 class ExecutionContext; |
| 24 class WebCompositorMutableState; |
22 | 25 |
23 class CompositorProxy final : public GarbageCollectedFinalized<CompositorProxy>,
public ScriptWrappable { | 26 class CORE_EXPORT CompositorProxy final : public GarbageCollectedFinalized<Compo
sitorProxy>, public ScriptWrappable { |
24 DEFINE_WRAPPERTYPEINFO(); | 27 DEFINE_WRAPPERTYPEINFO(); |
25 public: | 28 public: |
26 static CompositorProxy* create(ExecutionContext*, Element*, const Vector<Str
ing>& attributeArray, ExceptionState&); | 29 static CompositorProxy* create(ExecutionContext*, Element*, const Vector<Str
ing>& attributeArray, ExceptionState&); |
27 static CompositorProxy* create(uint64_t element, uint32_t compositorMutableP
roperties); | 30 static CompositorProxy* create(ExecutionContext*, uint64_t element, uint32_t
compositorMutableProperties); |
28 virtual ~CompositorProxy(); | 31 virtual ~CompositorProxy(); |
29 | 32 |
30 DEFINE_INLINE_TRACE() | 33 DEFINE_INLINE_TRACE() |
31 { | 34 { |
32 visitor->trace(m_transform); | 35 visitor->trace(m_client); |
33 } | 36 } |
34 | 37 |
35 uint64_t elementId() const { return m_elementId; } | 38 uint64_t elementId() const { return m_elementId; } |
36 uint32_t compositorMutableProperties() const { return m_compositorMutablePro
perties; } | 39 uint32_t compositorMutableProperties() const { return m_compositorMutablePro
perties; } |
37 bool supports(const String& attribute) const; | 40 bool supports(const String& attribute) const; |
38 | 41 |
39 bool connected() const { return m_connected; } | 42 bool connected() const { return m_connected; } |
40 void disconnect(); | 43 void disconnect(); |
41 | 44 |
42 double opacity(ExceptionState&) const; | 45 double opacity(ExceptionState&) const; |
43 double scrollLeft(ExceptionState&) const; | 46 double scrollLeft(ExceptionState&) const; |
44 double scrollTop(ExceptionState&) const; | 47 double scrollTop(ExceptionState&) const; |
45 DOMMatrix* transform(ExceptionState&) const; | 48 DOMMatrix* transform(ExceptionState&) const; |
46 | 49 |
47 void setOpacity(double, ExceptionState&); | 50 void setOpacity(double, ExceptionState&); |
48 void setScrollLeft(double, ExceptionState&); | 51 void setScrollLeft(double, ExceptionState&); |
49 void setScrollTop(double, ExceptionState&); | 52 void setScrollTop(double, ExceptionState&); |
50 void setTransform(DOMMatrix*, ExceptionState&); | 53 void setTransform(DOMMatrix*, ExceptionState&); |
51 | 54 |
| 55 void takeCompositorMutableState(WebCompositorMutableState*); |
| 56 void clearClient() { m_client = nullptr; } |
| 57 |
52 protected: | 58 protected: |
53 CompositorProxy(Element&, const Vector<String>& attributeArray); | 59 CompositorProxy(Element&, const Vector<String>& attributeArray); |
54 CompositorProxy(uint64_t element, uint32_t compositorMutableProperties); | 60 CompositorProxy(uint64_t element, uint32_t compositorMutableProperties, Comp
ositorProxyClient*); |
55 | 61 |
56 private: | 62 private: |
57 bool raiseExceptionIfNotMutable(uint32_t compositorMutableProperty, Exceptio
nState&) const; | 63 bool raiseExceptionIfNotMutable(uint32_t compositorMutableProperty, Exceptio
nState&) const; |
58 | 64 |
| 65 void setNeedsSync(); |
| 66 |
59 const uint64_t m_elementId = 0; | 67 const uint64_t m_elementId = 0; |
60 const uint32_t m_compositorMutableProperties = 0; | 68 const uint32_t m_compositorMutableProperties = 0; |
61 uint32_t m_mutatedProperties = 0; | |
62 | 69 |
63 double m_opacity = 0; | 70 bool m_needsSync = false; |
64 double m_scrollLeft = 0; | |
65 double m_scrollTop = 0; | |
66 Member<DOMMatrix> m_transform; | |
67 | 71 |
68 bool m_connected = true; | 72 bool m_connected = true; |
| 73 RawPtrWillBeMember<CompositorProxyClient> m_client; |
| 74 OwnPtr<WebCompositorMutableState> m_state; |
69 }; | 75 }; |
70 | 76 |
71 } // namespace blink | 77 } // namespace blink |
72 | 78 |
73 #endif // CompositorProxy_h | 79 #endif // CompositorProxy_h |
OLD | NEW |