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 "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "cc/surfaces/surface.h" | 8 #include "cc/surfaces/surface.h" |
9 #include "cc/surfaces/surface_manager.h" | 9 #include "cc/surfaces/surface_manager.h" |
10 #include "content/browser/renderer_host/offscreen_canvas_compositor_frame_sink_p
rovider_impl.h" | 10 #include "content/browser/renderer_host/offscreen_canvas_compositor_frame_sink_p
rovider_impl.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 frame_sink_id, | 23 frame_sink_id, |
24 nullptr, | 24 nullptr, |
25 nullptr), | 25 nullptr), |
26 client_(std::move(client)), | 26 client_(std::move(client)), |
27 binding_(this, std::move(request)) { | 27 binding_(this, std::move(request)) { |
28 binding_.set_connection_error_handler( | 28 binding_.set_connection_error_handler( |
29 base::Bind(&OffscreenCanvasCompositorFrameSink::OnClientConnectionLost, | 29 base::Bind(&OffscreenCanvasCompositorFrameSink::OnClientConnectionLost, |
30 base::Unretained(this))); | 30 base::Unretained(this))); |
31 } | 31 } |
32 | 32 |
33 OffscreenCanvasCompositorFrameSink::~OffscreenCanvasCompositorFrameSink() {} | 33 OffscreenCanvasCompositorFrameSink::~OffscreenCanvasCompositorFrameSink() { |
| 34 provider_->OnCompositorFrameSinkClientDestroyed(support_.frame_sink_id()); |
| 35 } |
34 | 36 |
35 void OffscreenCanvasCompositorFrameSink::SetNeedsBeginFrame( | 37 void OffscreenCanvasCompositorFrameSink::SetNeedsBeginFrame( |
36 bool needs_begin_frame) { | 38 bool needs_begin_frame) { |
37 support_.SetNeedsBeginFrame(needs_begin_frame); | 39 support_.SetNeedsBeginFrame(needs_begin_frame); |
38 } | 40 } |
39 | 41 |
40 void OffscreenCanvasCompositorFrameSink::SubmitCompositorFrame( | 42 void OffscreenCanvasCompositorFrameSink::SubmitCompositorFrame( |
41 const cc::LocalFrameId& local_frame_id, | 43 const cc::LocalFrameId& local_frame_id, |
42 cc::CompositorFrame frame) { | 44 cc::CompositorFrame frame) { |
43 support_.SubmitCompositorFrame(local_frame_id, std::move(frame)); | 45 support_.SubmitCompositorFrame(local_frame_id, std::move(frame)); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 if (client_) | 93 if (client_) |
92 client_->WillDrawSurface(); | 94 client_->WillDrawSurface(); |
93 } | 95 } |
94 | 96 |
95 void OffscreenCanvasCompositorFrameSink::OnClientConnectionLost() { | 97 void OffscreenCanvasCompositorFrameSink::OnClientConnectionLost() { |
96 provider_->OnCompositorFrameSinkClientConnectionLost( | 98 provider_->OnCompositorFrameSinkClientConnectionLost( |
97 support_.frame_sink_id()); | 99 support_.frame_sink_id()); |
98 } | 100 } |
99 | 101 |
100 } // namespace content | 102 } // namespace content |
OLD | NEW |