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