Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(390)

Side by Side Diff: Source/core/dom/CompositorProxy.h

Issue 1024233002: compositor-worker: Introduce CompositorProxy. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #ifndef CompositorProxy_h
6 #define CompositorProxy_h
7
8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/dom/Element.h"
10 #include "platform/heap/Handle.h"
11 #include "wtf/PassOwnPtr.h"
12 #include "wtf/PassRefPtr.h"
13 #include "wtf/RefCounted.h"
14 #include "wtf/text/WTFString.h"
15
16 namespace blink {
17
18 class ExceptionState;
19 class ExecutionContext;
20
21 class CompositorProxy final : public GarbageCollectedFinalized<CompositorProxy>, public ScriptWrappable {
22 DEFINE_WRAPPERTYPEINFO();
23 public:
24 static CompositorProxy* create(ExecutionContext*, Element*, const Vector<Str ing>& attributeArray, ExceptionState&);
25 static CompositorProxy* create(uint64_t element, uint32_t attributeFlags);
26 virtual ~CompositorProxy();
27
28 enum class Attributes {
29 NONE = 0,
30 OPACITY = 1 << 0,
31 SCROLL_LEFT = 1 << 2,
32 SCROLL_TOP = 1 << 3,
33 TOUCH = 1 << 4,
34 TRANSFORM = 1 << 5,
35 };
36
37 DEFINE_INLINE_TRACE() { }
38
39 union AttributesBitfield {
40 AttributesBitfield(uint32_t flags) : m_flags(flags) { }
41 struct {
42 unsigned m_opacity : 1;
43 unsigned m_scrollLeft : 1;
44 unsigned m_scrollTop : 1;
45 unsigned m_touch : 1;
46 unsigned m_transform : 1;
47 } m_attributes;
48 uint32_t m_flags;
49 };
50
51 uint64_t elementId() const { return m_elementId; }
52 uint32_t bitfieldsSupported() const { return m_bitfieldsSupported.m_flags; }
53 bool supports(const String& attribute) const;
54
55 protected:
56 CompositorProxy(Element&, const Vector<String>& attributeArray);
57 CompositorProxy(uint64_t element, uint32_t attributeFlags);
58
59 private:
60 const uint64_t m_elementId;
61 const AttributesBitfield m_bitfieldsSupported;
62 };
63
64 } // namespace blink
65
66 #endif // CompositorProxy_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698