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/Element.h" | 10 #include "core/dom/Element.h" |
10 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
11 #include "wtf/PassOwnPtr.h" | 12 #include "wtf/PassOwnPtr.h" |
12 #include "wtf/PassRefPtr.h" | 13 #include "wtf/PassRefPtr.h" |
13 #include "wtf/RefCounted.h" | 14 #include "wtf/RefCounted.h" |
14 #include "wtf/text/WTFString.h" | 15 #include "wtf/text/WTFString.h" |
15 | 16 |
16 namespace blink { | 17 namespace blink { |
17 | 18 |
19 class DOMMatrix; | |
18 class ExceptionState; | 20 class ExceptionState; |
19 class ExecutionContext; | 21 class ExecutionContext; |
20 | 22 |
21 class CompositorProxy final : public GarbageCollectedFinalized<CompositorProxy>, public ScriptWrappable { | 23 class CompositorProxy final : public GarbageCollectedFinalized<CompositorProxy>, public ScriptWrappable { |
22 DEFINE_WRAPPERTYPEINFO(); | 24 DEFINE_WRAPPERTYPEINFO(); |
23 public: | 25 public: |
24 static CompositorProxy* create(ExecutionContext*, Element*, const Vector<Str ing>& attributeArray, ExceptionState&); | 26 static CompositorProxy* create(ExecutionContext*, Element*, const Vector<Str ing>& attributeArray, ExceptionState&); |
25 static CompositorProxy* create(uint64_t element, uint32_t attributeFlags); | 27 static CompositorProxy* create(uint64_t element, uint32_t attributeFlags); |
26 virtual ~CompositorProxy(); | 28 virtual ~CompositorProxy(); |
27 | 29 |
28 enum class Attributes { | 30 enum class Attributes { |
29 NONE = 0, | 31 NONE = 0, |
30 OPACITY = 1 << 0, | 32 OPACITY = 1 << 0, |
31 SCROLL_LEFT = 1 << 2, | 33 SCROLL_LEFT = 1 << 1, |
32 SCROLL_TOP = 1 << 3, | 34 SCROLL_TOP = 1 << 2, |
33 TOUCH = 1 << 4, | 35 TOUCH = 1 << 3, |
34 TRANSFORM = 1 << 5, | 36 TRANSFORM = 1 << 4, |
35 }; | 37 }; |
36 | 38 |
37 DEFINE_INLINE_TRACE() { } | 39 DEFINE_INLINE_TRACE() |
40 { | |
41 visitor->trace(m_transform); | |
42 } | |
38 | 43 |
39 uint64_t elementId() const { return m_elementId; } | 44 uint64_t elementId() const { return m_elementId; } |
40 uint32_t bitfieldsSupported() const { return m_bitfieldsSupported; } | 45 uint32_t bitfieldsSupported() const { return m_bitfieldsSupported; } |
41 bool supports(const String& attribute) const; | 46 bool supports(const String& attribute) const; |
42 | 47 |
48 double opacity(ExceptionState&) const; | |
49 double scrollLeft(ExceptionState&) const; | |
50 double scrollTop(ExceptionState&) const; | |
51 DOMMatrix* transform(ExceptionState&) const; | |
52 | |
53 void setOpacity(double, ExceptionState&); | |
54 void setScrollLeft(double, ExceptionState&); | |
55 void setScrollTop(double, ExceptionState&); | |
56 void setTransform(DOMMatrix*, ExceptionState&); | |
57 | |
43 protected: | 58 protected: |
44 CompositorProxy(Element&, const Vector<String>& attributeArray); | 59 CompositorProxy(Element&, const Vector<String>& attributeArray); |
45 CompositorProxy(uint64_t element, uint32_t attributeFlags); | 60 CompositorProxy(uint64_t element, uint32_t attributeFlags); |
46 | 61 |
47 private: | 62 private: |
63 bool raiseExceptionIfNotMutable(Attributes, ExceptionState&) const; | |
64 | |
48 const uint64_t m_elementId; | 65 const uint64_t m_elementId; |
49 const uint32_t m_bitfieldsSupported; | 66 const uint32_t m_bitfieldsSupported; |
67 uint32_t m_mutatedAttributes; | |
esprehn
2015/03/29 04:44:56
Why not set all of these to = 0 also?
sadrul
2015/03/30 16:07:45
Good point. Done.
| |
68 | |
69 double m_opacity = 0; | |
esprehn
2015/03/29 04:44:56
Is this allowed in blink C++11 style? :)
sadrul
2015/03/30 16:07:45
Oh, I hadn't considered the blink style guide. I t
| |
70 double m_scrollLeft = 0; | |
71 double m_scrollTop = 0; | |
72 Member<DOMMatrix> m_transform; | |
50 }; | 73 }; |
51 | 74 |
52 } // namespace blink | 75 } // namespace blink |
53 | 76 |
54 #endif // CompositorProxy_h | 77 #endif // CompositorProxy_h |
OLD | NEW |