| 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::LocalSurfaceId& local_surface_id, | 43 const cc::LocalSurfaceId& local_surface_id, |
| 42 cc::CompositorFrame frame) { | 44 cc::CompositorFrame frame) { |
| 43 // TODO(samans): This will need to do something similar to | 45 // TODO(samans): This will need to do something similar to |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 if (client_) | 83 if (client_) |
| 82 client_->WillDrawSurface(); | 84 client_->WillDrawSurface(); |
| 83 } | 85 } |
| 84 | 86 |
| 85 void OffscreenCanvasCompositorFrameSink::OnClientConnectionLost() { | 87 void OffscreenCanvasCompositorFrameSink::OnClientConnectionLost() { |
| 86 provider_->OnCompositorFrameSinkClientConnectionLost( | 88 provider_->OnCompositorFrameSinkClientConnectionLost( |
| 87 support_.frame_sink_id()); | 89 support_.frame_sink_id()); |
| 88 } | 90 } |
| 89 | 91 |
| 90 } // namespace content | 92 } // namespace content |
| OLD | NEW |