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 #include "core/offscreencanvas/OffscreenCanvas.h" | 5 #include "core/offscreencanvas/OffscreenCanvas.h" |
6 | 6 |
7 #include "core/dom/ExceptionCode.h" | 7 #include "core/dom/ExceptionCode.h" |
8 #include "core/fileapi/Blob.h" | 8 #include "core/fileapi/Blob.h" |
9 #include "core/frame/ImageBitmap.h" | 9 #include "core/frame/ImageBitmap.h" |
10 #include "core/html/ImageData.h" | 10 #include "core/html/ImageData.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 bool OffscreenCanvas::isAccelerated() const { | 206 bool OffscreenCanvas::isAccelerated() const { |
207 return m_context && m_context->isAccelerated(); | 207 return m_context && m_context->isAccelerated(); |
208 } | 208 } |
209 | 209 |
210 OffscreenCanvasFrameDispatcher* OffscreenCanvas::getOrCreateFrameDispatcher() { | 210 OffscreenCanvasFrameDispatcher* OffscreenCanvas::getOrCreateFrameDispatcher() { |
211 if (!m_frameDispatcher) { | 211 if (!m_frameDispatcher) { |
212 // The frame dispatcher connects the current thread of OffscreenCanvas | 212 // The frame dispatcher connects the current thread of OffscreenCanvas |
213 // (either main or worker) to the browser process and remains unchanged | 213 // (either main or worker) to the browser process and remains unchanged |
214 // throughout the lifetime of this OffscreenCanvas. | 214 // throughout the lifetime of this OffscreenCanvas. |
215 m_frameDispatcher = WTF::wrapUnique(new OffscreenCanvasFrameDispatcherImpl( | 215 m_frameDispatcher = WTF::wrapUnique(new OffscreenCanvasFrameDispatcherImpl( |
216 m_clientId, m_sinkId, m_localId, m_nonceHigh, m_nonceLow, | 216 m_clientId, m_sinkId, m_placeholderCanvasId, m_size.width(), |
217 m_placeholderCanvasId, m_size.width(), m_size.height())); | 217 m_size.height())); |
218 } | 218 } |
219 return m_frameDispatcher.get(); | 219 return m_frameDispatcher.get(); |
220 } | 220 } |
221 | 221 |
222 ScriptPromise OffscreenCanvas::convertToBlob(ScriptState* scriptState, | 222 ScriptPromise OffscreenCanvas::convertToBlob(ScriptState* scriptState, |
223 const ImageEncodeOptions& options, | 223 const ImageEncodeOptions& options, |
224 ExceptionState& exceptionState) { | 224 ExceptionState& exceptionState) { |
225 if (this->isNeutered()) { | 225 if (this->isNeutered()) { |
226 exceptionState.throwDOMException(InvalidStateError, | 226 exceptionState.throwDOMException(InvalidStateError, |
227 "OffscreenCanvas object is detached."); | 227 "OffscreenCanvas object is detached."); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 return resolver->promise(); | 268 return resolver->promise(); |
269 } | 269 } |
270 | 270 |
271 DEFINE_TRACE(OffscreenCanvas) { | 271 DEFINE_TRACE(OffscreenCanvas) { |
272 visitor->trace(m_context); | 272 visitor->trace(m_context); |
273 visitor->trace(m_executionContext); | 273 visitor->trace(m_executionContext); |
274 EventTargetWithInlineData::trace(visitor); | 274 EventTargetWithInlineData::trace(visitor); |
275 } | 275 } |
276 | 276 |
277 } // namespace blink | 277 } // namespace blink |
OLD | NEW |