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 "content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.h " | 5 #include "content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.h " |
6 | 6 |
7 #include "cc/surfaces/surface.h" | 7 #include "cc/surfaces/surface.h" |
8 #include "cc/surfaces/surface_manager.h" | 8 #include "cc/surfaces/surface_manager.h" |
9 #include "mojo/public/cpp/bindings/strong_binding.h" | 9 #include "mojo/public/cpp/bindings/strong_binding.h" |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... | |
21 frame_sink_id, surface_manager, std::move(client)); | 21 frame_sink_id, surface_manager, std::move(client)); |
22 OffscreenCanvasCompositorFrameSink* compositor_frame_sink = impl.get(); | 22 OffscreenCanvasCompositorFrameSink* compositor_frame_sink = impl.get(); |
23 compositor_frame_sink->binding_ = | 23 compositor_frame_sink->binding_ = |
24 mojo::MakeStrongBinding(std::move(impl), std::move(request)); | 24 mojo::MakeStrongBinding(std::move(impl), std::move(request)); |
25 } | 25 } |
26 | 26 |
27 OffscreenCanvasCompositorFrameSink::OffscreenCanvasCompositorFrameSink( | 27 OffscreenCanvasCompositorFrameSink::OffscreenCanvasCompositorFrameSink( |
28 const cc::FrameSinkId& frame_sink_id, | 28 const cc::FrameSinkId& frame_sink_id, |
29 cc::SurfaceManager* surface_manager, | 29 cc::SurfaceManager* surface_manager, |
30 cc::mojom::MojoCompositorFrameSinkClientPtr client) | 30 cc::mojom::MojoCompositorFrameSinkClientPtr client) |
31 : support_(this, surface_manager, frame_sink_id, nullptr, nullptr), | 31 // TODO(crbug.com/): Pass a valid display so that we can get OnBeginFrame |
Stephen White
2016/12/21 15:14:43
Nit: bug ID?
| |
32 client_(std::move(client)) {} | 32 // notification to drive |
33 : support_(this, surface_manager, frame_sink_id, nullptr /*display*/, | |
34 nullptr), | |
35 client_(std::move(client)) {} | |
33 | 36 |
34 OffscreenCanvasCompositorFrameSink::~OffscreenCanvasCompositorFrameSink() {} | 37 OffscreenCanvasCompositorFrameSink::~OffscreenCanvasCompositorFrameSink() {} |
35 | 38 |
36 void OffscreenCanvasCompositorFrameSink::SetNeedsBeginFrame( | 39 void OffscreenCanvasCompositorFrameSink::SetNeedsBeginFrame( |
37 bool needs_begin_frame) { | 40 bool needs_begin_frame) { |
38 support_.SetNeedsBeginFrame(needs_begin_frame); | 41 support_.SetNeedsBeginFrame(needs_begin_frame); |
39 } | 42 } |
40 | 43 |
41 void OffscreenCanvasCompositorFrameSink::SubmitCompositorFrame( | 44 void OffscreenCanvasCompositorFrameSink::SubmitCompositorFrame( |
42 const cc::LocalFrameId& local_frame_id, | 45 const cc::LocalFrameId& local_frame_id, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 if (client_) | 90 if (client_) |
88 client_->ReclaimResources(resources); | 91 client_->ReclaimResources(resources); |
89 } | 92 } |
90 | 93 |
91 void OffscreenCanvasCompositorFrameSink::WillDrawSurface() { | 94 void OffscreenCanvasCompositorFrameSink::WillDrawSurface() { |
92 if (client_) | 95 if (client_) |
93 client_->WillDrawSurface(); | 96 client_->WillDrawSurface(); |
94 } | 97 } |
95 | 98 |
96 } // namespace content | 99 } // namespace content |
OLD | NEW |