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
3 // found in the LICENSE file.
5 #ifndef CompositorProxy_h
6 #define CompositorProxy_h
8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/dom/DOMMatrix.h"
10 #include "core/dom/Element.h"
11 #include "platform/heap/Handle.h"
12 #include "wtf/PassOwnPtr.h"
13 #include "wtf/PassRefPtr.h"
14 #include "wtf/RefCounted.h"
15 #include "wtf/text/WTFString.h"
21 class ExecutionContext
;
23 class CompositorProxy final
: public GarbageCollectedFinalized
<CompositorProxy
>, public ScriptWrappable
{
24 DEFINE_WRAPPERTYPEINFO();
26 static CompositorProxy
* create(ExecutionContext
*, Element
*, const Vector
<String
>& attributeArray
, ExceptionState
&);
27 static CompositorProxy
* create(uint64_t element
, uint32_t attributeFlags
);
28 virtual ~CompositorProxy();
30 enum class Attributes
{
41 visitor
->trace(m_transform
);
44 uint64_t elementId() const { return m_elementId
; }
45 uint32_t bitfieldsSupported() const { return m_bitfieldsSupported
; }
46 bool supports(const String
& attribute
) const;
48 bool connected() const { return m_connected
; }
51 double opacity(ExceptionState
&) const;
52 double scrollLeft(ExceptionState
&) const;
53 double scrollTop(ExceptionState
&) const;
54 DOMMatrix
* transform(ExceptionState
&) const;
56 void setOpacity(double, ExceptionState
&);
57 void setScrollLeft(double, ExceptionState
&);
58 void setScrollTop(double, ExceptionState
&);
59 void setTransform(DOMMatrix
*, ExceptionState
&);
62 CompositorProxy(Element
&, const Vector
<String
>& attributeArray
);
63 CompositorProxy(uint64_t element
, uint32_t attributeFlags
);
66 bool raiseExceptionIfNotMutable(Attributes
, ExceptionState
&) const;
68 const uint64_t m_elementId
= 0;
69 const uint32_t m_bitfieldsSupported
= 0;
70 uint32_t m_mutatedAttributes
= 0;
73 double m_scrollLeft
= 0;
74 double m_scrollTop
= 0;
75 Member
<DOMMatrix
> m_transform
;
77 bool m_connected
= true;
82 #endif // CompositorProxy_h