Chromium Code Reviews| 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" | 9 #include "core/CoreExport.h" |
| 10 #include "core/dom/CompositorProxyClient.h" | 10 #include "core/dom/CompositorProxyClient.h" |
| 11 #include "core/dom/DOMMatrix.h" | 11 #include "core/dom/DOMMatrix.h" |
| 12 #include "core/dom/Element.h" | 12 #include "core/dom/Element.h" |
| 13 #include "platform/graphics/CompositorMutableState.h" | |
| 13 #include "platform/heap/Handle.h" | 14 #include "platform/heap/Handle.h" |
| 15 #include "wtf/PtrUtil.h" | |
|
jbroman
2016/06/08 14:59:38
Unused header?
majidvp
2016/06/08 21:50:09
Done.
| |
| 14 #include "wtf/text/WTFString.h" | 16 #include "wtf/text/WTFString.h" |
| 15 | 17 |
| 16 namespace blink { | 18 namespace blink { |
| 17 | 19 |
| 18 class DOMMatrix; | 20 class DOMMatrix; |
| 19 class ExceptionState; | 21 class ExceptionState; |
| 20 class ExecutionContext; | 22 class ExecutionContext; |
| 21 | 23 |
| 22 class CORE_EXPORT CompositorProxy final : public GarbageCollectedFinalized<Compo sitorProxy>, public ScriptWrappable { | 24 class CORE_EXPORT CompositorProxy final : public GarbageCollectedFinalized<Compo sitorProxy>, public ScriptWrappable { |
| 23 DEFINE_WRAPPERTYPEINFO(); | 25 DEFINE_WRAPPERTYPEINFO(); |
| 24 USING_PRE_FINALIZER(CompositorProxy, dispose); | 26 USING_PRE_FINALIZER(CompositorProxy, dispose); |
| 25 public: | 27 public: |
| 26 static CompositorProxy* create(ExecutionContext*, Element*, const Vector<Str ing>& attributeArray, ExceptionState&); | 28 static CompositorProxy* create(ExecutionContext*, Element*, const Vector<Str ing>& attributeArray, ExceptionState&); |
| 27 static CompositorProxy* create(ExecutionContext*, uint64_t element, uint32_t compositorMutableProperties); | 29 static CompositorProxy* create(ExecutionContext*, uint64_t element, uint32_t compositorMutableProperties); |
| 28 virtual ~CompositorProxy(); | 30 virtual ~CompositorProxy(); |
| 29 | 31 |
| 30 DEFINE_INLINE_TRACE() | 32 DEFINE_INLINE_TRACE() |
| 31 { | 33 { |
| 32 visitor->trace(m_transform); | |
| 33 visitor->trace(m_client); | 34 visitor->trace(m_client); |
| 34 } | 35 } |
| 35 | 36 |
| 36 uint64_t elementId() const { return m_elementId; } | 37 uint64_t elementId() const { return m_elementId; } |
| 37 uint32_t compositorMutableProperties() const { return m_compositorMutablePro perties; } | 38 uint32_t compositorMutableProperties() const { return m_compositorMutablePro perties; } |
| 38 bool supports(const String& attribute) const; | 39 bool supports(const String& attribute) const; |
| 39 | 40 |
| 41 bool initialized() const { return m_connected && m_state.get(); } | |
| 40 bool connected() const { return m_connected; } | 42 bool connected() const { return m_connected; } |
| 41 void disconnect(); | 43 void disconnect(); |
| 42 | 44 |
| 43 double opacity(ExceptionState&) const; | 45 double opacity(ExceptionState&) const; |
| 44 double scrollLeft(ExceptionState&) const; | 46 double scrollLeft(ExceptionState&) const; |
| 45 double scrollTop(ExceptionState&) const; | 47 double scrollTop(ExceptionState&) const; |
| 46 DOMMatrix* transform(ExceptionState&) const; | 48 DOMMatrix* transform(ExceptionState&) const; |
| 47 | 49 |
| 48 void setOpacity(double, ExceptionState&); | 50 void setOpacity(double, ExceptionState&); |
| 49 void setScrollLeft(double, ExceptionState&); | 51 void setScrollLeft(double, ExceptionState&); |
| 50 void setScrollTop(double, ExceptionState&); | 52 void setScrollTop(double, ExceptionState&); |
| 51 void setTransform(DOMMatrix*, ExceptionState&); | 53 void setTransform(DOMMatrix*, ExceptionState&); |
| 52 | 54 |
| 55 void takeCompositorMutableState(std::unique_ptr<CompositorMutableState>); | |
|
jbroman
2016/06/08 14:59:38
yutak will switch us to unique_ptr shortly, but fo
majidvp
2016/06/08 21:50:09
There was a PSA earlier that we should start using
jbroman
2016/06/08 21:54:56
OK, I'd missed that PSA, and was assuming it would
| |
| 56 | |
| 53 protected: | 57 protected: |
| 54 CompositorProxy(Element&, const Vector<String>& attributeArray); | 58 CompositorProxy(Element&, const Vector<String>& attributeArray); |
| 55 CompositorProxy(uint64_t element, uint32_t compositorMutableProperties, Comp ositorProxyClient*); | 59 CompositorProxy(uint64_t element, uint32_t compositorMutableProperties, Comp ositorProxyClient*); |
| 56 void dispose(); | 60 void dispose(); |
| 57 | 61 |
| 58 private: | 62 private: |
| 59 bool raiseExceptionIfNotMutable(uint32_t compositorMutableProperty, Exceptio nState&) const; | 63 bool raiseExceptionIfNotMutable(uint32_t compositorMutableProperty, Exceptio nState&) const; |
| 60 | 64 |
| 61 const uint64_t m_elementId = 0; | 65 const uint64_t m_elementId = 0; |
| 62 const uint32_t m_compositorMutableProperties = 0; | 66 const uint32_t m_compositorMutableProperties = 0; |
| 63 uint32_t m_mutatedProperties = 0; | |
| 64 | |
| 65 double m_opacity = 0; | |
| 66 double m_scrollLeft = 0; | |
| 67 double m_scrollTop = 0; | |
| 68 Member<DOMMatrix> m_transform; | |
| 69 | 67 |
| 70 bool m_connected = true; | 68 bool m_connected = true; |
| 71 Member<CompositorProxyClient> m_client; | 69 Member<CompositorProxyClient> m_client; |
| 70 std::unique_ptr<CompositorMutableState> m_state; | |
| 72 }; | 71 }; |
| 73 | 72 |
| 74 } // namespace blink | 73 } // namespace blink |
| 75 | 74 |
| 76 #endif // CompositorProxy_h | 75 #endif // CompositorProxy_h |
| OLD | NEW |