| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "platform/graphics/OffscreenCanvasFrameDispatcherImpl.h" | 5 #include "platform/graphics/OffscreenCanvasFrameDispatcherImpl.h" |
| 6 | 6 |
| 7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
| 8 #include "cc/quads/texture_draw_quad.h" | 8 #include "cc/quads/texture_draw_quad.h" |
| 9 #include "gpu/command_buffer/client/gles2_interface.h" | 9 #include "gpu/command_buffer/client/gles2_interface.h" |
| 10 #include "platform/CrossThreadFunctional.h" | 10 #include "platform/CrossThreadFunctional.h" |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 242 |
| 243 // After this point, |image| can only be used on the main thread, until | 243 // After this point, |image| can only be used on the main thread, until |
| 244 // it is returned. | 244 // it is returned. |
| 245 image->transfer(); | 245 image->transfer(); |
| 246 std::unique_ptr<WebTaskRunner> dispatcherTaskRunner = | 246 std::unique_ptr<WebTaskRunner> dispatcherTaskRunner = |
| 247 Platform::current()->currentThread()->getWebTaskRunner()->clone(); | 247 Platform::current()->currentThread()->getWebTaskRunner()->clone(); |
| 248 | 248 |
| 249 Platform::current()->mainThread()->getWebTaskRunner()->postTask( | 249 Platform::current()->mainThread()->getWebTaskRunner()->postTask( |
| 250 BLINK_FROM_HERE, | 250 BLINK_FROM_HERE, |
| 251 crossThreadBind(updatePlaceholderImage, this->createWeakPtr(), | 251 crossThreadBind(updatePlaceholderImage, this->createWeakPtr(), |
| 252 passed(std::move(dispatcherTaskRunner)), | 252 WTF::passed(std::move(dispatcherTaskRunner)), |
| 253 m_placeholderCanvasId, std::move(image), resource.id)); | 253 m_placeholderCanvasId, std::move(image), resource.id)); |
| 254 m_spareResourceLocks.add(m_nextResourceId); | 254 m_spareResourceLocks.add(m_nextResourceId); |
| 255 | 255 |
| 256 commitTypeHistogram.count(commitType); | 256 commitTypeHistogram.count(commitType); |
| 257 | 257 |
| 258 m_nextResourceId++; | 258 m_nextResourceId++; |
| 259 frame.resource_list.push_back(std::move(resource)); | 259 frame.resource_list.push_back(std::move(resource)); |
| 260 | 260 |
| 261 cc::TextureDrawQuad* quad = | 261 cc::TextureDrawQuad* quad = |
| 262 pass->CreateAndAppendDrawQuad<cc::TextureDrawQuad>(); | 262 pass->CreateAndAppendDrawQuad<cc::TextureDrawQuad>(); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 return true; | 405 return true; |
| 406 return false; | 406 return false; |
| 407 } | 407 } |
| 408 | 408 |
| 409 void OffscreenCanvasFrameDispatcherImpl::reshape(int width, int height) { | 409 void OffscreenCanvasFrameDispatcherImpl::reshape(int width, int height) { |
| 410 m_width = width; | 410 m_width = width; |
| 411 m_height = height; | 411 m_height = height; |
| 412 } | 412 } |
| 413 | 413 |
| 414 } // namespace blink | 414 } // namespace blink |
| OLD | NEW |