| 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 "content/browser/compositor/surface_utils.h" | 9 #include "content/browser/compositor/surface_utils.h" |
| 10 #include "mojo/public/cpp/bindings/strong_binding.h" | 10 #include "mojo/public/cpp/bindings/strong_binding.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 void OffscreenCanvasCompositorFrameSink::RemoveSurfaceReferences( | 67 void OffscreenCanvasCompositorFrameSink::RemoveSurfaceReferences( |
| 68 const std::vector<cc::SurfaceReference>& references) { | 68 const std::vector<cc::SurfaceReference>& references) { |
| 69 NOTIMPLEMENTED(); | 69 NOTIMPLEMENTED(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void OffscreenCanvasCompositorFrameSink::EvictFrame() { | 72 void OffscreenCanvasCompositorFrameSink::EvictFrame() { |
| 73 // TODO(fsamuel, staraz): Implement this | 73 // TODO(fsamuel, staraz): Implement this |
| 74 NOTIMPLEMENTED(); | 74 NOTIMPLEMENTED(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void OffscreenCanvasCompositorFrameSink::Require( |
| 78 const cc::LocalFrameId& local_frame_id, |
| 79 const cc::SurfaceSequence& sequence) { |
| 80 // TODO(staraz): Implement this. |
| 81 NOTIMPLEMENTED(); |
| 82 } |
| 83 |
| 84 void OffscreenCanvasCompositorFrameSink::Satisfy( |
| 85 const cc::SurfaceSequence& sequence) { |
| 86 // TODO(staraz): Implement this. |
| 87 NOTIMPLEMENTED(); |
| 88 } |
| 89 |
| 77 void OffscreenCanvasCompositorFrameSink::ReturnResources( | 90 void OffscreenCanvasCompositorFrameSink::ReturnResources( |
| 78 const cc::ReturnedResourceArray& resources) { | 91 const cc::ReturnedResourceArray& resources) { |
| 79 if (resources.empty()) | 92 if (resources.empty()) |
| 80 return; | 93 return; |
| 81 | 94 |
| 82 if (!ack_pending_count_ && client_) { | 95 if (!ack_pending_count_ && client_) { |
| 83 client_->ReclaimResources(resources); | 96 client_->ReclaimResources(resources); |
| 84 return; | 97 return; |
| 85 } | 98 } |
| 86 | 99 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 101 client_->DidReceiveCompositorFrameAck(); | 114 client_->DidReceiveCompositorFrameAck(); |
| 102 DCHECK_GT(ack_pending_count_, 0); | 115 DCHECK_GT(ack_pending_count_, 0); |
| 103 if (!surface_returned_resources_.empty()) { | 116 if (!surface_returned_resources_.empty()) { |
| 104 client_->ReclaimResources(surface_returned_resources_); | 117 client_->ReclaimResources(surface_returned_resources_); |
| 105 surface_returned_resources_.clear(); | 118 surface_returned_resources_.clear(); |
| 106 } | 119 } |
| 107 ack_pending_count_--; | 120 ack_pending_count_--; |
| 108 } | 121 } |
| 109 | 122 |
| 110 } // namespace content | 123 } // namespace content |
| OLD | NEW |