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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 uint32_t clientId() const { return m_clientId; } | 84 uint32_t clientId() const { return m_clientId; } |
85 uint32_t sinkId() const { return m_sinkId; } | 85 uint32_t sinkId() const { return m_sinkId; } |
86 | 86 |
87 void setExecutionContext(ExecutionContext* context) { | 87 void setExecutionContext(ExecutionContext* context) { |
88 m_executionContext = context; | 88 m_executionContext = context; |
89 } | 89 } |
90 | 90 |
91 ScriptPromise commit(RefPtr<StaticBitmapImage>, | 91 ScriptPromise commit(RefPtr<StaticBitmapImage>, |
92 bool isWebGLSoftwareRendering, | 92 bool isWebGLSoftwareRendering, |
93 ScriptState*); | 93 ScriptState*); |
94 void doCommitAtEndOfTask(); | |
94 | 95 |
95 void detachContext() { m_context = nullptr; } | 96 void detachContext() { m_context = nullptr; } |
96 | 97 |
97 // OffscreenCanvasFrameDispatcherClient implementation | 98 // OffscreenCanvasFrameDispatcherClient implementation |
98 void beginFrame() final; | 99 void beginFrame() final; |
99 | 100 |
100 // EventTarget implementation | 101 // EventTarget implementation |
101 const AtomicString& interfaceName() const final { | 102 const AtomicString& interfaceName() const final { |
102 return EventTargetNames::OffscreenCanvas; | 103 return EventTargetNames::OffscreenCanvas; |
103 } | 104 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
150 | 151 |
151 IntSize m_size; | 152 IntSize m_size; |
152 bool m_isNeutered = false; | 153 bool m_isNeutered = false; |
153 | 154 |
154 bool m_originClean = true; | 155 bool m_originClean = true; |
155 bool m_disableReadingFromCanvas = false; | 156 bool m_disableReadingFromCanvas = false; |
156 | 157 |
157 bool isPaintable() const; | 158 bool isPaintable() const; |
158 | 159 |
159 std::unique_ptr<OffscreenCanvasFrameDispatcher> m_frameDispatcher; | 160 std::unique_ptr<OffscreenCanvasFrameDispatcher> m_frameDispatcher; |
161 | |
160 Member<ScriptPromiseResolver> m_commitPromiseResolver; | 162 Member<ScriptPromiseResolver> m_commitPromiseResolver; |
163 RefPtr<StaticBitmapImage> m_currentFrame; | |
Justin Novosad
2017/03/24 17:41:53
Could we call this m_frameToDispatchAtEndOfTask
xlai (Olivia)
2017/03/24 18:18:52
I don't think this name is suitable. With the late
| |
164 bool m_currentFrameIsWebGLSoftwareRendering = false; | |
161 RefPtr<StaticBitmapImage> m_overdrawFrame; | 165 RefPtr<StaticBitmapImage> m_overdrawFrame; |
162 bool m_overdrawFrameIsWebGLSoftwareRendering = false; | 166 bool m_overdrawFrameIsWebGLSoftwareRendering = false; |
167 | |
163 // cc::FrameSinkId is broken into two integer components as this can be used | 168 // cc::FrameSinkId is broken into two integer components as this can be used |
164 // in transfer of OffscreenCanvas across threads | 169 // in transfer of OffscreenCanvas across threads |
165 // If this object is not created via | 170 // If this object is not created via |
166 // HTMLCanvasElement.transferControlToOffscreen(), | 171 // HTMLCanvasElement.transferControlToOffscreen(), |
167 // then the following members would remain as initialized zero values. | 172 // then the following members would remain as initialized zero values. |
168 uint32_t m_clientId = 0; | 173 uint32_t m_clientId = 0; |
169 uint32_t m_sinkId = 0; | 174 uint32_t m_sinkId = 0; |
170 }; | 175 }; |
171 | 176 |
172 } // namespace blink | 177 } // namespace blink |
173 | 178 |
174 #endif // OffscreenCanvas_h | 179 #endif // OffscreenCanvas_h |
OLD | NEW |