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 change_size_for_next_commit_(false), | 41 change_size_for_next_commit_(false), |
42 needs_begin_frame_(false), | 42 needs_begin_frame_(false), |
43 next_resource_id_(1u), | 43 next_resource_id_(1u), |
44 binding_(this), | 44 binding_(this), |
45 placeholder_canvas_id_(canvas_id) { | 45 placeholder_canvas_id_(canvas_id) { |
46 if (frame_sink_id_.is_valid()) { | 46 if (frame_sink_id_.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 current_local_surface_id_ = local_surface_id_allocator_.GenerateId(); | 49 current_local_surface_id_ = local_surface_id_allocator_.GenerateId(); |
50 DCHECK(!sink_.is_bound()); | 50 DCHECK(!sink_.is_bound()); |
51 mojom::blink::OffscreenCanvasCompositorFrameSinkProviderPtr provider; | 51 mojom::blink::OffscreenCanvasProviderPtr provider; |
52 Platform::Current()->GetInterfaceProvider()->GetInterface( | 52 Platform::Current()->GetInterfaceProvider()->GetInterface( |
53 mojo::MakeRequest(&provider)); | 53 mojo::MakeRequest(&provider)); |
54 provider->CreateCompositorFrameSink(frame_sink_id_, | 54 provider->CreateCompositorFrameSink(frame_sink_id_, |
55 binding_.CreateInterfacePtrAndBind(), | 55 binding_.CreateInterfacePtrAndBind(), |
56 mojo::MakeRequest(&sink_)); | 56 mojo::MakeRequest(&sink_)); |
57 } | 57 } |
58 } | 58 } |
59 | 59 |
60 OffscreenCanvasFrameDispatcherImpl::~OffscreenCanvasFrameDispatcherImpl() { | 60 OffscreenCanvasFrameDispatcherImpl::~OffscreenCanvasFrameDispatcherImpl() { |
61 } | 61 } |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 | 475 |
476 void OffscreenCanvasFrameDispatcherImpl::Reshape(int width, int height) { | 476 void OffscreenCanvasFrameDispatcherImpl::Reshape(int width, int height) { |
477 if (width_ != width || height_ != height) { | 477 if (width_ != width || height_ != height) { |
478 width_ = width; | 478 width_ = width; |
479 height_ = height; | 479 height_ = height; |
480 change_size_for_next_commit_ = true; | 480 change_size_for_next_commit_ = true; |
481 } | 481 } |
482 } | 482 } |
483 | 483 |
484 } // namespace blink | 484 } // namespace blink |
OLD | NEW |