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

Side by Side Diff: cc/surfaces/compositor_frame_sink_support.cc

Issue 2565783002: Moves ownership of the cc::Display's BeginFrameSource out of Display. (Closed)
Patch Set: rebase. Created 4 years 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 "cc/surfaces/compositor_frame_sink_support.h" 5 #include "cc/surfaces/compositor_frame_sink_support.h"
6 6
7 #include "cc/output/compositor_frame.h" 7 #include "cc/output/compositor_frame.h"
8 #include "cc/scheduler/begin_frame_source.h" 8 #include "cc/scheduler/begin_frame_source.h"
9 #include "cc/surfaces/compositor_frame_sink_support_client.h" 9 #include "cc/surfaces/compositor_frame_sink_support_client.h"
10 #include "cc/surfaces/display.h" 10 #include "cc/surfaces/display.h"
11 #include "cc/surfaces/surface.h" 11 #include "cc/surfaces/surface.h"
12 #include "cc/surfaces/surface_manager.h" 12 #include "cc/surfaces/surface_manager.h"
13 13
14 namespace cc { 14 namespace cc {
15 15
16 CompositorFrameSinkSupport::CompositorFrameSinkSupport( 16 CompositorFrameSinkSupport::CompositorFrameSinkSupport(
17 CompositorFrameSinkSupportClient* client, 17 CompositorFrameSinkSupportClient* client,
18 SurfaceManager* surface_manager, 18 SurfaceManager* surface_manager,
19 const FrameSinkId& frame_sink_id, 19 const FrameSinkId& frame_sink_id,
20 std::unique_ptr<Display> display) 20 std::unique_ptr<Display> display,
21 std::unique_ptr<BeginFrameSource> display_begin_frame_source)
21 : client_(client), 22 : client_(client),
22 surface_manager_(surface_manager), 23 surface_manager_(surface_manager),
23 frame_sink_id_(frame_sink_id), 24 frame_sink_id_(frame_sink_id),
25 display_begin_frame_source_(std::move(display_begin_frame_source)),
24 display_(std::move(display)), 26 display_(std::move(display)),
25 surface_factory_(frame_sink_id_, surface_manager_, this), 27 surface_factory_(frame_sink_id_, surface_manager_, this),
26 weak_factory_(this) { 28 weak_factory_(this) {
27 surface_manager_->RegisterFrameSinkId(frame_sink_id_); 29 surface_manager_->RegisterFrameSinkId(frame_sink_id_);
28 surface_manager_->RegisterSurfaceFactoryClient(frame_sink_id_, this); 30 surface_manager_->RegisterSurfaceFactoryClient(frame_sink_id_, this);
29 31
30 if (display_) { 32 if (display_) {
31 display_->Initialize(this, surface_manager_); 33 display_->Initialize(this, surface_manager_);
32 display_->SetVisible(true); 34 display_->SetVisible(true);
33 } 35 }
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 return; 193 return;
192 194
193 added_frame_observer_ = needs_begin_frame_; 195 added_frame_observer_ = needs_begin_frame_;
194 if (needs_begin_frame_) 196 if (needs_begin_frame_)
195 begin_frame_source_->AddObserver(this); 197 begin_frame_source_->AddObserver(this);
196 else 198 else
197 begin_frame_source_->RemoveObserver(this); 199 begin_frame_source_->RemoveObserver(this);
198 } 200 }
199 201
200 } // namespace cc 202 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/compositor_frame_sink_support.h ('k') | cc/surfaces/direct_compositor_frame_sink_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698