| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 void OffscreenCanvasCompositorFrameSink::SetNeedsBeginFrame( | 57 void OffscreenCanvasCompositorFrameSink::SetNeedsBeginFrame( |
| 58 bool needs_begin_frame) { | 58 bool needs_begin_frame) { |
| 59 NOTIMPLEMENTED(); | 59 NOTIMPLEMENTED(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void OffscreenCanvasCompositorFrameSink::EvictFrame() { | 62 void OffscreenCanvasCompositorFrameSink::EvictFrame() { |
| 63 // TODO(fsamuel, staraz): Implement this | 63 // TODO(fsamuel, staraz): Implement this |
| 64 NOTIMPLEMENTED(); | 64 NOTIMPLEMENTED(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void OffscreenCanvasCompositorFrameSink::BeginFrameDidNotDraw( |
| 68 const cc::BeginFrameAck& ack) { |
| 69 NOTIMPLEMENTED(); |
| 70 } |
| 71 |
| 67 void OffscreenCanvasCompositorFrameSink::ReturnResources( | 72 void OffscreenCanvasCompositorFrameSink::ReturnResources( |
| 68 const cc::ReturnedResourceArray& resources) { | 73 const cc::ReturnedResourceArray& resources) { |
| 69 if (resources.empty()) | 74 if (resources.empty()) |
| 70 return; | 75 return; |
| 71 | 76 |
| 72 if (!ack_pending_count_ && client_) { | 77 if (!ack_pending_count_ && client_) { |
| 73 client_->ReclaimResources(resources); | 78 client_->ReclaimResources(resources); |
| 74 return; | 79 return; |
| 75 } | 80 } |
| 76 | 81 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 91 client_->DidReceiveCompositorFrameAck(); | 96 client_->DidReceiveCompositorFrameAck(); |
| 92 DCHECK_GT(ack_pending_count_, 0); | 97 DCHECK_GT(ack_pending_count_, 0); |
| 93 if (!surface_returned_resources_.empty()) { | 98 if (!surface_returned_resources_.empty()) { |
| 94 client_->ReclaimResources(surface_returned_resources_); | 99 client_->ReclaimResources(surface_returned_resources_); |
| 95 surface_returned_resources_.clear(); | 100 surface_returned_resources_.clear(); |
| 96 } | 101 } |
| 97 ack_pending_count_--; | 102 ack_pending_count_--; |
| 98 } | 103 } |
| 99 | 104 |
| 100 } // namespace content | 105 } // namespace content |
| OLD | NEW |