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

Side by Side Diff: cc/trees/swap_promise_monitor.cc

Issue 2323423002: cc: Add SwapPromiseManager and SurfaceSequenceGenerator. (Closed)
Patch Set: Created 4 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/logging.h" 5 #include "base/logging.h"
6 #include "cc/trees/layer_tree_host.h"
7 #include "cc/trees/layer_tree_host_impl.h" 6 #include "cc/trees/layer_tree_host_impl.h"
7 #include "cc/trees/swap_promise_manager.h"
8 #include "cc/trees/swap_promise_monitor.h" 8 #include "cc/trees/swap_promise_monitor.h"
9 9
10 namespace cc { 10 namespace cc {
11 11
12 SwapPromiseMonitor::SwapPromiseMonitor(LayerTreeHostInterface* layer_tree_host, 12 SwapPromiseMonitor::SwapPromiseMonitor(SwapPromiseManager* swap_promise_manager,
13 LayerTreeHostImpl* layer_tree_host_impl) 13 LayerTreeHostImpl* layer_tree_host_impl)
14 : layer_tree_host_(layer_tree_host), 14 : swap_promise_manager_(swap_promise_manager),
15 layer_tree_host_impl_(layer_tree_host_impl) { 15 layer_tree_host_impl_(layer_tree_host_impl) {
16 DCHECK((layer_tree_host && !layer_tree_host_impl) || 16 DCHECK((swap_promise_manager && !layer_tree_host_impl) ||
17 (!layer_tree_host && layer_tree_host_impl)); 17 (!swap_promise_manager && layer_tree_host_impl));
18 if (layer_tree_host_) 18 if (swap_promise_manager)
19 layer_tree_host_->InsertSwapPromiseMonitor(this); 19 swap_promise_manager->InsertSwapPromiseMonitor(this);
20 if (layer_tree_host_impl_) 20 if (layer_tree_host_impl_)
21 layer_tree_host_impl_->InsertSwapPromiseMonitor(this); 21 layer_tree_host_impl_->InsertSwapPromiseMonitor(this);
22 } 22 }
23 23
24 SwapPromiseMonitor::~SwapPromiseMonitor() { 24 SwapPromiseMonitor::~SwapPromiseMonitor() {
25 if (layer_tree_host_) 25 if (swap_promise_manager_)
26 layer_tree_host_->RemoveSwapPromiseMonitor(this); 26 swap_promise_manager_->RemoveSwapPromiseMonitor(this);
27 if (layer_tree_host_impl_) 27 if (layer_tree_host_impl_)
28 layer_tree_host_impl_->RemoveSwapPromiseMonitor(this); 28 layer_tree_host_impl_->RemoveSwapPromiseMonitor(this);
29 } 29 }
30 30
31 } // namespace cc 31 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698