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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 Platform::Current()->GetInterfaceProvider()->GetInterface( | 56 Platform::Current()->GetInterfaceProvider()->GetInterface( |
57 mojo::MakeRequest(&provider)); | 57 mojo::MakeRequest(&provider)); |
58 | 58 |
59 cc::mojom::blink::MojoCompositorFrameSinkClientPtr client; | 59 cc::mojom::blink::MojoCompositorFrameSinkClientPtr client; |
60 binding_.Bind(mojo::MakeRequest(&client)); | 60 binding_.Bind(mojo::MakeRequest(&client)); |
61 provider->CreateCompositorFrameSink(frame_sink_id_, std::move(client), | 61 provider->CreateCompositorFrameSink(frame_sink_id_, std::move(client), |
62 mojo::MakeRequest(&sink_)); | 62 mojo::MakeRequest(&sink_)); |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 OffscreenCanvasFrameDispatcherImpl::~OffscreenCanvasFrameDispatcherImpl() { | 66 OffscreenCanvasFrameDispatcherImpl::~OffscreenCanvasFrameDispatcherImpl() {} |
67 } | |
68 | 67 |
69 std::unique_ptr<OffscreenCanvasFrameDispatcherImpl::FrameResource> | 68 std::unique_ptr<OffscreenCanvasFrameDispatcherImpl::FrameResource> |
70 OffscreenCanvasFrameDispatcherImpl::createOrRecycleFrameResource() { | 69 OffscreenCanvasFrameDispatcherImpl::createOrRecycleFrameResource() { |
71 if (recycleable_resource_) { | 70 if (recycleable_resource_) { |
72 recycleable_resource_->spare_lock_ = true; | 71 recycleable_resource_->spare_lock_ = true; |
73 return std::move(recycleable_resource_); | 72 return std::move(recycleable_resource_); |
74 } | 73 } |
75 return std::unique_ptr<FrameResource>(new FrameResource()); | 74 return std::unique_ptr<FrameResource>(new FrameResource()); |
76 } | 75 } |
77 | 76 |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 | 544 |
546 void OffscreenCanvasFrameDispatcherImpl::Reshape(int width, int height) { | 545 void OffscreenCanvasFrameDispatcherImpl::Reshape(int width, int height) { |
547 if (width_ != width || height_ != height) { | 546 if (width_ != width || height_ != height) { |
548 width_ = width; | 547 width_ = width; |
549 height_ = height; | 548 height_ = height; |
550 change_size_for_next_commit_ = true; | 549 change_size_for_next_commit_ = true; |
551 } | 550 } |
552 } | 551 } |
553 | 552 |
554 } // namespace blink | 553 } // namespace blink |
OLD | NEW |