| 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 20 matching lines...) Expand all Loading... |
| 31 } | 31 } |
| 32 | 32 |
| 33 OffscreenCanvasCompositorFrameSink::~OffscreenCanvasCompositorFrameSink() {} | 33 OffscreenCanvasCompositorFrameSink::~OffscreenCanvasCompositorFrameSink() {} |
| 34 | 34 |
| 35 void OffscreenCanvasCompositorFrameSink::SetNeedsBeginFrame( | 35 void OffscreenCanvasCompositorFrameSink::SetNeedsBeginFrame( |
| 36 bool needs_begin_frame) { | 36 bool needs_begin_frame) { |
| 37 support_.SetNeedsBeginFrame(needs_begin_frame); | 37 support_.SetNeedsBeginFrame(needs_begin_frame); |
| 38 } | 38 } |
| 39 | 39 |
| 40 void OffscreenCanvasCompositorFrameSink::SubmitCompositorFrame( | 40 void OffscreenCanvasCompositorFrameSink::SubmitCompositorFrame( |
| 41 const cc::LocalFrameId& local_frame_id, | 41 const cc::LocalSurfaceId& local_surface_id, |
| 42 cc::CompositorFrame frame) { | 42 cc::CompositorFrame frame) { |
| 43 // TODO(samans): This will need to do something similar to | 43 // TODO(samans): This will need to do something similar to |
| 44 // GpuCompositorFrameSink. | 44 // GpuCompositorFrameSink. |
| 45 support_.SubmitCompositorFrame(local_frame_id, std::move(frame)); | 45 support_.SubmitCompositorFrame(local_surface_id, std::move(frame)); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void OffscreenCanvasCompositorFrameSink::EvictFrame() { | 48 void OffscreenCanvasCompositorFrameSink::EvictFrame() { |
| 49 support_.EvictFrame(); | 49 support_.EvictFrame(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void OffscreenCanvasCompositorFrameSink::Require( | 52 void OffscreenCanvasCompositorFrameSink::Require( |
| 53 const cc::LocalFrameId& local_frame_id, | 53 const cc::LocalSurfaceId& local_surface_id, |
| 54 const cc::SurfaceSequence& sequence) { | 54 const cc::SurfaceSequence& sequence) { |
| 55 support_.Require(local_frame_id, sequence); | 55 support_.Require(local_surface_id, sequence); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void OffscreenCanvasCompositorFrameSink::Satisfy( | 58 void OffscreenCanvasCompositorFrameSink::Satisfy( |
| 59 const cc::SurfaceSequence& sequence) { | 59 const cc::SurfaceSequence& sequence) { |
| 60 support_.Satisfy(sequence); | 60 support_.Satisfy(sequence); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void OffscreenCanvasCompositorFrameSink::DidReceiveCompositorFrameAck() { | 63 void OffscreenCanvasCompositorFrameSink::DidReceiveCompositorFrameAck() { |
| 64 if (client_) | 64 if (client_) |
| 65 client_->DidReceiveCompositorFrameAck(); | 65 client_->DidReceiveCompositorFrameAck(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 81 if (client_) | 81 if (client_) |
| 82 client_->WillDrawSurface(); | 82 client_->WillDrawSurface(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void OffscreenCanvasCompositorFrameSink::OnClientConnectionLost() { | 85 void OffscreenCanvasCompositorFrameSink::OnClientConnectionLost() { |
| 86 provider_->OnCompositorFrameSinkClientConnectionLost( | 86 provider_->OnCompositorFrameSinkClientConnectionLost( |
| 87 support_.frame_sink_id()); | 87 support_.frame_sink_id()); |
| 88 } | 88 } |
| 89 | 89 |
| 90 } // namespace content | 90 } // namespace content |
| OLD | NEW |