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 OffscreenCanvas_h | 5 #ifndef OffscreenCanvas_h |
6 #define OffscreenCanvas_h | 6 #define OffscreenCanvas_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
10 #include "bindings/core/v8/ScriptWrappable.h" | 10 #include "bindings/core/v8/ScriptWrappable.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 private: | 92 private: |
93 explicit OffscreenCanvas(const IntSize&); | 93 explicit OffscreenCanvas(const IntSize&); |
94 | 94 |
95 using ContextFactoryVector = | 95 using ContextFactoryVector = |
96 Vector<std::unique_ptr<CanvasRenderingContextFactory>>; | 96 Vector<std::unique_ptr<CanvasRenderingContextFactory>>; |
97 static ContextFactoryVector& renderingContextFactories(); | 97 static ContextFactoryVector& renderingContextFactories(); |
98 static CanvasRenderingContextFactory* getRenderingContextFactory(int); | 98 static CanvasRenderingContextFactory* getRenderingContextFactory(int); |
99 | 99 |
100 Member<CanvasRenderingContext> m_context; | 100 Member<CanvasRenderingContext> m_context; |
101 int m_canvasId = | 101 int m_canvasId = -1; // DOMNodeIds starts from 0, using -1 to indicate no |
102 -1; // DOMNodeIds starts from 0, using -1 to indicate no associated canva
s element. | 102 // associated canvas element. |
103 IntSize m_size; | 103 IntSize m_size; |
104 bool m_isNeutered = false; | 104 bool m_isNeutered = false; |
105 | 105 |
106 bool m_originClean; | 106 bool m_originClean; |
107 bool m_disableReadingFromCanvas = false; | 107 bool m_disableReadingFromCanvas = false; |
108 | 108 |
109 bool isPaintable() const; | 109 bool isPaintable() const; |
110 | 110 |
111 std::unique_ptr<OffscreenCanvasFrameDispatcher> m_frameDispatcher; | 111 std::unique_ptr<OffscreenCanvasFrameDispatcher> m_frameDispatcher; |
112 // cc::SurfaceId is broken into three integer components as this can be used | 112 // cc::SurfaceId is broken into three integer components as this can be used |
113 // in transfer of OffscreenCanvas across threads | 113 // in transfer of OffscreenCanvas across threads |
114 // If this object is not created via HTMLCanvasElement.transferControlToOffscr
een(), | 114 // If this object is not created via |
| 115 // HTMLCanvasElement.transferControlToOffscreen(), |
115 // then the following members would remain as initialized zero values. | 116 // then the following members would remain as initialized zero values. |
116 uint32_t m_clientId = 0; | 117 uint32_t m_clientId = 0; |
117 uint32_t m_localId = 0; | 118 uint32_t m_localId = 0; |
118 uint64_t m_nonce = 0; | 119 uint64_t m_nonce = 0; |
119 }; | 120 }; |
120 | 121 |
121 } // namespace blink | 122 } // namespace blink |
122 | 123 |
123 #endif // OffscreenCanvas_h | 124 #endif // OffscreenCanvas_h |
OLD | NEW |