| 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 30 matching lines...) Expand all Loading... |
| 41 m_changeSizeForNextCommit(false), | 41 m_changeSizeForNextCommit(false), |
| 42 m_needsBeginFrame(false), | 42 m_needsBeginFrame(false), |
| 43 m_nextResourceId(1u), | 43 m_nextResourceId(1u), |
| 44 m_binding(this), | 44 m_binding(this), |
| 45 m_placeholderCanvasId(canvasId) { | 45 m_placeholderCanvasId(canvasId) { |
| 46 if (m_frameSinkId.is_valid()) { | 46 if (m_frameSinkId.is_valid()) { |
| 47 // Only frameless canvas pass an invalid frame sink id; we don't create | 47 // Only frameless canvas pass an invalid frame sink id; we don't create |
| 48 // mojo channel for this special case. | 48 // mojo channel for this special case. |
| 49 m_currentLocalSurfaceId = m_localSurfaceIdAllocator.GenerateId(); | 49 m_currentLocalSurfaceId = m_localSurfaceIdAllocator.GenerateId(); |
| 50 DCHECK(!m_sink.is_bound()); | 50 DCHECK(!m_sink.is_bound()); |
| 51 mojom::blink::OffscreenCanvasCompositorFrameSinkProviderPtr provider; | 51 mojom::blink::OffscreenCanvasProviderPtr provider; |
| 52 Platform::current()->interfaceProvider()->getInterface( | 52 Platform::current()->interfaceProvider()->getInterface( |
| 53 mojo::MakeRequest(&provider)); | 53 mojo::MakeRequest(&provider)); |
| 54 provider->CreateCompositorFrameSink(m_frameSinkId, | 54 provider->CreateCompositorFrameSink(m_frameSinkId, |
| 55 m_binding.CreateInterfacePtrAndBind(), | 55 m_binding.CreateInterfacePtrAndBind(), |
| 56 mojo::MakeRequest(&m_sink)); | 56 mojo::MakeRequest(&m_sink)); |
| 57 } | 57 } |
| 58 } | 58 } |
| 59 | 59 |
| 60 OffscreenCanvasFrameDispatcherImpl::~OffscreenCanvasFrameDispatcherImpl() { | 60 OffscreenCanvasFrameDispatcherImpl::~OffscreenCanvasFrameDispatcherImpl() { |
| 61 } | 61 } |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 | 472 |
| 473 void OffscreenCanvasFrameDispatcherImpl::reshape(int width, int height) { | 473 void OffscreenCanvasFrameDispatcherImpl::reshape(int width, int height) { |
| 474 if (m_width != width || m_height != height) { | 474 if (m_width != width || m_height != height) { |
| 475 m_width = width; | 475 m_width = width; |
| 476 m_height = height; | 476 m_height = height; |
| 477 m_changeSizeForNextCommit = true; | 477 m_changeSizeForNextCommit = true; |
| 478 } | 478 } |
| 479 } | 479 } |
| 480 | 480 |
| 481 } // namespace blink | 481 } // namespace blink |
| OLD | NEW |