Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Side by Side Diff: content/browser/renderer_host/offscreen_canvas_compositor_frame_sink.cc

Issue 2430653002: Mus+Ash: Towards Unifying CompositorFrameSink terminology (Closed)
Patch Set: Fix bitmap_uploader Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 23 matching lines...) Expand all
34 void OffscreenCanvasCompositorFrameSink::Create( 34 void OffscreenCanvasCompositorFrameSink::Create(
35 const cc::SurfaceId& surface_id, 35 const cc::SurfaceId& surface_id,
36 cc::mojom::MojoCompositorFrameSinkClientPtr client, 36 cc::mojom::MojoCompositorFrameSinkClientPtr client,
37 cc::mojom::MojoCompositorFrameSinkRequest request) { 37 cc::mojom::MojoCompositorFrameSinkRequest request) {
38 mojo::MakeStrongBinding(base::MakeUnique<OffscreenCanvasCompositorFrameSink>( 38 mojo::MakeStrongBinding(base::MakeUnique<OffscreenCanvasCompositorFrameSink>(
39 surface_id, std::move(client)), 39 surface_id, std::move(client)),
40 std::move(request)); 40 std::move(request));
41 } 41 }
42 42
43 void OffscreenCanvasCompositorFrameSink::SubmitCompositorFrame( 43 void OffscreenCanvasCompositorFrameSink::SubmitCompositorFrame(
44 cc::CompositorFrame frame, 44 cc::CompositorFrame frame) {
45 const SubmitCompositorFrameCallback& callback) {
46 if (!surface_factory_) { 45 if (!surface_factory_) {
47 cc::SurfaceManager* manager = GetSurfaceManager(); 46 cc::SurfaceManager* manager = GetSurfaceManager();
48 surface_factory_ = base::MakeUnique<cc::SurfaceFactory>( 47 surface_factory_ = base::MakeUnique<cc::SurfaceFactory>(
49 surface_id_.frame_sink_id(), manager, this); 48 surface_id_.frame_sink_id(), manager, this);
50 surface_factory_->Create(surface_id_.local_frame_id()); 49 surface_factory_->Create(surface_id_.local_frame_id());
51 50
52 manager->RegisterFrameSinkId(surface_id_.frame_sink_id()); 51 manager->RegisterFrameSinkId(surface_id_.frame_sink_id());
53 } 52 }
54 surface_factory_->SubmitCompositorFrame(surface_id_.local_frame_id(), 53 surface_factory_->SubmitCompositorFrame(
55 std::move(frame), callback); 54 surface_id_.local_frame_id(), std::move(frame),
55 base::Bind(
56 &OffscreenCanvasCompositorFrameSink::DidReceiveCompositorFrameAck,
57 base::Unretained(this)));
56 } 58 }
57 59
58 void OffscreenCanvasCompositorFrameSink::SetNeedsBeginFrame( 60 void OffscreenCanvasCompositorFrameSink::SetNeedsBeginFrame(
59 bool needs_begin_frame) { 61 bool needs_begin_frame) {
60 NOTIMPLEMENTED(); 62 NOTIMPLEMENTED();
61 } 63 }
62 64
63 void OffscreenCanvasCompositorFrameSink::ReturnResources( 65 void OffscreenCanvasCompositorFrameSink::ReturnResources(
64 const cc::ReturnedResourceArray& resources) { 66 const cc::ReturnedResourceArray& resources) {
65 client_->ReturnResources(resources); 67 client_->ReclaimResources(resources);
66 } 68 }
67 69
68 void OffscreenCanvasCompositorFrameSink::WillDrawSurface( 70 void OffscreenCanvasCompositorFrameSink::WillDrawSurface(
69 const cc::LocalFrameId& id, 71 const cc::LocalFrameId& id,
70 const gfx::Rect& damage_rect) {} 72 const gfx::Rect& damage_rect) {}
71 73
72 void OffscreenCanvasCompositorFrameSink::SetBeginFrameSource( 74 void OffscreenCanvasCompositorFrameSink::SetBeginFrameSource(
73 cc::BeginFrameSource* begin_frame_source) {} 75 cc::BeginFrameSource* begin_frame_source) {}
74 76
77 void OffscreenCanvasCompositorFrameSink::DidReceiveCompositorFrameAck() {
78 client_->DidReceiveCompositorFrameAck();
79 }
80
75 } // namespace content 81 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698