Chromium Code Reviews| 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 27 matching lines...) Expand all Loading... | |
| 38 void OffscreenCanvasCompositorFrameSink::Create( | 38 void OffscreenCanvasCompositorFrameSink::Create( |
| 39 const cc::SurfaceId& surface_id, | 39 const cc::SurfaceId& surface_id, |
| 40 cc::mojom::MojoCompositorFrameSinkClientPtr client, | 40 cc::mojom::MojoCompositorFrameSinkClientPtr client, |
| 41 cc::mojom::MojoCompositorFrameSinkRequest request) { | 41 cc::mojom::MojoCompositorFrameSinkRequest request) { |
| 42 mojo::MakeStrongBinding(base::MakeUnique<OffscreenCanvasCompositorFrameSink>( | 42 mojo::MakeStrongBinding(base::MakeUnique<OffscreenCanvasCompositorFrameSink>( |
| 43 surface_id, std::move(client)), | 43 surface_id, std::move(client)), |
| 44 std::move(request)); | 44 std::move(request)); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void OffscreenCanvasCompositorFrameSink::SubmitCompositorFrame( | 47 void OffscreenCanvasCompositorFrameSink::SubmitCompositorFrame( |
| 48 const cc::LocalFrameId& local_frame_Id, | |
|
sadrul
2016/11/22 19:53:29
*id
Fady Samuel
2016/11/22 20:17:26
Done.
| |
| 48 cc::CompositorFrame frame) { | 49 cc::CompositorFrame frame) { |
| 49 ++ack_pending_count_; | 50 ++ack_pending_count_; |
| 50 surface_factory_->SubmitCompositorFrame( | 51 surface_factory_->SubmitCompositorFrame( |
| 51 surface_id_.local_frame_id(), std::move(frame), | 52 surface_id_.local_frame_id(), std::move(frame), |
|
sadrul
2016/11/22 19:53:29
Do you want to use |local_frame_id| here instead?
Fady Samuel
2016/11/22 20:17:26
Not yet. I don't want to change offscreen canvas y
| |
| 52 base::Bind( | 53 base::Bind( |
| 53 &OffscreenCanvasCompositorFrameSink::DidReceiveCompositorFrameAck, | 54 &OffscreenCanvasCompositorFrameSink::DidReceiveCompositorFrameAck, |
| 54 base::Unretained(this))); | 55 base::Unretained(this))); |
| 55 } | 56 } |
| 56 | 57 |
| 57 void OffscreenCanvasCompositorFrameSink::SetNeedsBeginFrame( | 58 void OffscreenCanvasCompositorFrameSink::SetNeedsBeginFrame( |
| 58 bool needs_begin_frame) { | 59 bool needs_begin_frame) { |
| 59 NOTIMPLEMENTED(); | 60 NOTIMPLEMENTED(); |
| 60 } | 61 } |
| 61 | 62 |
| (...skipping 24 matching lines...) Expand all 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 |