| 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 finalizeFrame(); |
| 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; |
| 161 RefPtr<StaticBitmapImage> m_overdrawFrame; | 163 RefPtr<StaticBitmapImage> m_currentFrame; |
| 162 bool m_overdrawFrameIsWebGLSoftwareRendering = false; | 164 bool m_currentFrameIsWebGLSoftwareRendering = false; |
| 165 |
| 163 // cc::FrameSinkId is broken into two integer components as this can be used | 166 // cc::FrameSinkId is broken into two integer components as this can be used |
| 164 // in transfer of OffscreenCanvas across threads | 167 // in transfer of OffscreenCanvas across threads |
| 165 // If this object is not created via | 168 // If this object is not created via |
| 166 // HTMLCanvasElement.transferControlToOffscreen(), | 169 // HTMLCanvasElement.transferControlToOffscreen(), |
| 167 // then the following members would remain as initialized zero values. | 170 // then the following members would remain as initialized zero values. |
| 168 uint32_t m_clientId = 0; | 171 uint32_t m_clientId = 0; |
| 169 uint32_t m_sinkId = 0; | 172 uint32_t m_sinkId = 0; |
| 170 }; | 173 }; |
| 171 | 174 |
| 172 } // namespace blink | 175 } // namespace blink |
| 173 | 176 |
| 174 #endif // OffscreenCanvas_h | 177 #endif // OffscreenCanvas_h |
| OLD | NEW |