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 "content/browser/renderer_host/offscreen_canvas_surface_manager.h" |
10 #include "mojo/public/cpp/bindings/strong_binding.h" | 11 #include "mojo/public/cpp/bindings/strong_binding.h" |
11 | 12 |
12 namespace content { | 13 namespace content { |
13 | 14 |
14 OffscreenCanvasCompositorFrameSink::OffscreenCanvasCompositorFrameSink( | 15 OffscreenCanvasCompositorFrameSink::OffscreenCanvasCompositorFrameSink( |
15 const cc::SurfaceId& surface_id, | 16 const cc::SurfaceId& surface_id, |
16 cc::mojom::MojoCompositorFrameSinkClientPtr client) | 17 cc::mojom::MojoCompositorFrameSinkClientPtr client) |
17 : surface_id_(surface_id), client_(std::move(client)) { | 18 : surface_id_(surface_id), client_(std::move(client)) { |
18 cc::SurfaceManager* manager = GetSurfaceManager(); | 19 cc::SurfaceManager* manager = GetSurfaceManager(); |
19 surface_factory_ = base::MakeUnique<cc::SurfaceFactory>( | 20 surface_factory_ = base::MakeUnique<cc::SurfaceFactory>( |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 client_->DidReceiveCompositorFrameAck(); | 87 client_->DidReceiveCompositorFrameAck(); |
87 DCHECK_GT(ack_pending_count_, 0); | 88 DCHECK_GT(ack_pending_count_, 0); |
88 if (!surface_returned_resources_.empty()) { | 89 if (!surface_returned_resources_.empty()) { |
89 client_->ReclaimResources(surface_returned_resources_); | 90 client_->ReclaimResources(surface_returned_resources_); |
90 surface_returned_resources_.clear(); | 91 surface_returned_resources_.clear(); |
91 } | 92 } |
92 ack_pending_count_--; | 93 ack_pending_count_--; |
93 } | 94 } |
94 | 95 |
95 } // namespace content | 96 } // namespace content |
OLD | NEW |