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

Side by Side Diff: components/viz/frame_sinks/mojo_frame_sink_manager.cc

Issue 2802773002: Pick surface lifetime type with arg. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « components/viz/frame_sinks/mojo_frame_sink_manager.h ('k') | services/ui/gpu/gpu_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/viz/frame_sinks/mojo_frame_sink_manager.h" 5 #include "components/viz/frame_sinks/mojo_frame_sink_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "cc/base/switches.h" 11 #include "cc/base/switches.h"
12 #include "cc/scheduler/begin_frame_source.h" 12 #include "cc/scheduler/begin_frame_source.h"
13 #include "cc/surfaces/display.h" 13 #include "cc/surfaces/display.h"
14 #include "cc/surfaces/surface_dependency_tracker.h" 14 #include "cc/surfaces/surface_dependency_tracker.h"
15 #include "components/viz/frame_sinks/display_provider.h" 15 #include "components/viz/frame_sinks/display_provider.h"
16 #include "components/viz/frame_sinks/gpu_compositor_frame_sink.h" 16 #include "components/viz/frame_sinks/gpu_compositor_frame_sink.h"
17 #include "components/viz/frame_sinks/gpu_root_compositor_frame_sink.h" 17 #include "components/viz/frame_sinks/gpu_root_compositor_frame_sink.h"
18 18
19 namespace viz { 19 namespace viz {
20 20
21 MojoFrameSinkManager::MojoFrameSinkManager( 21 MojoFrameSinkManager::MojoFrameSinkManager(
22 bool use_surface_references,
22 DisplayProvider* display_provider, 23 DisplayProvider* display_provider,
23 cc::mojom::FrameSinkManagerRequest request, 24 cc::mojom::FrameSinkManagerRequest request,
24 cc::mojom::FrameSinkManagerClientPtr client) 25 cc::mojom::FrameSinkManagerClientPtr client)
25 : manager_(cc::SurfaceManager::LifetimeType::REFERENCES), 26 : manager_(use_surface_references
27 ? cc::SurfaceManager::LifetimeType::REFERENCES
28 : cc::SurfaceManager::LifetimeType::SEQUENCES),
26 display_provider_(display_provider), 29 display_provider_(display_provider),
27 client_(std::move(client)), 30 client_(std::move(client)),
28 binding_(this, std::move(request)) { 31 binding_(this, std::move(request)) {
29 manager_.AddObserver(this); 32 manager_.AddObserver(this);
30 } 33 }
31 34
32 MojoFrameSinkManager::~MojoFrameSinkManager() { 35 MojoFrameSinkManager::~MojoFrameSinkManager() {
33 DCHECK(thread_checker_.CalledOnValidThread()); 36 DCHECK(thread_checker_.CalledOnValidThread());
34 manager_.RemoveObserver(this); 37 manager_.RemoveObserver(this);
35 } 38 }
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 138
136 void MojoFrameSinkManager::OnPrivateConnectionLost( 139 void MojoFrameSinkManager::OnPrivateConnectionLost(
137 const cc::FrameSinkId& frame_sink_id, 140 const cc::FrameSinkId& frame_sink_id,
138 bool destroy_compositor_frame_sink) { 141 bool destroy_compositor_frame_sink) {
139 DCHECK(thread_checker_.CalledOnValidThread()); 142 DCHECK(thread_checker_.CalledOnValidThread());
140 if (destroy_compositor_frame_sink) 143 if (destroy_compositor_frame_sink)
141 DestroyCompositorFrameSink(frame_sink_id); 144 DestroyCompositorFrameSink(frame_sink_id);
142 } 145 }
143 146
144 } // namespace viz 147 } // namespace viz
OLDNEW
« no previous file with comments | « components/viz/frame_sinks/mojo_frame_sink_manager.h ('k') | services/ui/gpu/gpu_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698