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/html/canvas/CanvasContextCreationAttributes.h" | 8 #include "core/html/canvas/CanvasContextCreationAttributes.h" |
9 #include "core/html/canvas/CanvasRenderingContext.h" | 9 #include "core/html/canvas/CanvasRenderingContext.h" |
10 #include "core/html/canvas/CanvasRenderingContextFactory.h" | 10 #include "core/html/canvas/CanvasRenderingContextFactory.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 | 137 |
138 bool OffscreenCanvas::isPaintable() const | 138 bool OffscreenCanvas::isPaintable() const |
139 { | 139 { |
140 if (!m_context) | 140 if (!m_context) |
141 return ImageBuffer::canCreateImageBuffer(m_size); | 141 return ImageBuffer::canCreateImageBuffer(m_size); |
142 return m_context->isPaintable(); | 142 return m_context->isPaintable(); |
143 } | 143 } |
144 | 144 |
145 OffscreenCanvasFrameDispatcher* OffscreenCanvas::getOrCreateFrameDispatcher() | 145 OffscreenCanvasFrameDispatcher* OffscreenCanvas::getOrCreateFrameDispatcher() |
146 { | 146 { |
147 if (!m_frameDispatcher) | 147 if (!m_frameDispatcher) { |
148 // The frame dispatcher connects the current thread of OffscreenCanvas | |
149 // (either main or worker) to browser process and remains unchanged | |
Justin Novosad
2016/09/07 21:40:15
*the* browser process
xlai (Olivia)
2016/09/08 15:27:15
Done.
| |
150 // throughout the lifetime of this OffscreenCanvas. | |
148 m_frameDispatcher = wrapUnique(new OffscreenCanvasFrameDispatcherImpl(m_ clientId, m_localId, m_nonce, width(), height())); | 151 m_frameDispatcher = wrapUnique(new OffscreenCanvasFrameDispatcherImpl(m_ clientId, m_localId, m_nonce, width(), height())); |
152 } | |
149 return m_frameDispatcher.get(); | 153 return m_frameDispatcher.get(); |
150 } | 154 } |
151 | 155 |
152 DEFINE_TRACE(OffscreenCanvas) | 156 DEFINE_TRACE(OffscreenCanvas) |
153 { | 157 { |
154 visitor->trace(m_context); | 158 visitor->trace(m_context); |
155 } | 159 } |
156 | 160 |
157 } // namespace blink | 161 } // namespace blink |
OLD | NEW |