| 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 22 matching lines...) Expand all Loading... |
| 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::LocalFrameId& local_frame_id, |
| 42 cc::CompositorFrame frame) { | 42 cc::CompositorFrame frame) { |
| 43 // TODO(samans): This will need to do something similar to |
| 44 // GpuCompositorFrameSink. |
| 43 support_.SubmitCompositorFrame(local_frame_id, std::move(frame)); | 45 support_.SubmitCompositorFrame(local_frame_id, std::move(frame)); |
| 44 } | 46 } |
| 45 | 47 |
| 46 void OffscreenCanvasCompositorFrameSink::AddSurfaceReferences( | |
| 47 const std::vector<cc::SurfaceReference>& references) { | |
| 48 // TODO(fsamuel, staraz): Implement this. | |
| 49 NOTIMPLEMENTED(); | |
| 50 } | |
| 51 | |
| 52 void OffscreenCanvasCompositorFrameSink::RemoveSurfaceReferences( | |
| 53 const std::vector<cc::SurfaceReference>& references) { | |
| 54 // TODO(fsamuel, staraz): Implement this. | |
| 55 NOTIMPLEMENTED(); | |
| 56 } | |
| 57 | |
| 58 void OffscreenCanvasCompositorFrameSink::EvictFrame() { | 48 void OffscreenCanvasCompositorFrameSink::EvictFrame() { |
| 59 support_.EvictFrame(); | 49 support_.EvictFrame(); |
| 60 } | 50 } |
| 61 | 51 |
| 62 void OffscreenCanvasCompositorFrameSink::Require( | 52 void OffscreenCanvasCompositorFrameSink::Require( |
| 63 const cc::LocalFrameId& local_frame_id, | 53 const cc::LocalFrameId& local_frame_id, |
| 64 const cc::SurfaceSequence& sequence) { | 54 const cc::SurfaceSequence& sequence) { |
| 65 support_.Require(local_frame_id, sequence); | 55 support_.Require(local_frame_id, sequence); |
| 66 } | 56 } |
| 67 | 57 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 91 if (client_) | 81 if (client_) |
| 92 client_->WillDrawSurface(); | 82 client_->WillDrawSurface(); |
| 93 } | 83 } |
| 94 | 84 |
| 95 void OffscreenCanvasCompositorFrameSink::OnClientConnectionLost() { | 85 void OffscreenCanvasCompositorFrameSink::OnClientConnectionLost() { |
| 96 provider_->OnCompositorFrameSinkClientConnectionLost( | 86 provider_->OnCompositorFrameSinkClientConnectionLost( |
| 97 support_.frame_sink_id()); | 87 support_.frame_sink_id()); |
| 98 } | 88 } |
| 99 | 89 |
| 100 } // namespace content | 90 } // namespace content |
| OLD | NEW |