Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <stack> | 8 #include <stack> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 void LayerTreeHost::InitializeProxy(scoped_ptr<Proxy> proxy) { | 139 void LayerTreeHost::InitializeProxy(scoped_ptr<Proxy> proxy) { |
| 140 TRACE_EVENT0("cc", "LayerTreeHost::InitializeForReal"); | 140 TRACE_EVENT0("cc", "LayerTreeHost::InitializeForReal"); |
| 141 | 141 |
| 142 proxy_ = proxy.Pass(); | 142 proxy_ = proxy.Pass(); |
| 143 proxy_->Start(); | 143 proxy_->Start(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 LayerTreeHost::~LayerTreeHost() { | 146 LayerTreeHost::~LayerTreeHost() { |
| 147 TRACE_EVENT0("cc", "LayerTreeHost::~LayerTreeHost"); | 147 TRACE_EVENT0("cc", "LayerTreeHost::~LayerTreeHost"); |
| 148 | 148 |
| 149 BreakSwapPromises(SwapPromise::DID_NOT_SWAP_UNKNOWN); | |
|
piman
2014/05/23 20:26:36
COMMIT_FAILED? Basically if we still have a SwapPr
mkosiba (inactive)
2014/06/18 14:58:02
COMMIT_FAILS makes more sense. If we wanted a spec
| |
| 150 | |
| 149 overhang_ui_resource_.reset(); | 151 overhang_ui_resource_.reset(); |
| 150 | 152 |
| 151 if (root_layer_.get()) | 153 if (root_layer_.get()) |
| 152 root_layer_->SetLayerTreeHost(NULL); | 154 root_layer_->SetLayerTreeHost(NULL); |
| 153 | 155 |
| 154 if (proxy_) { | 156 if (proxy_) { |
| 155 DCHECK(proxy_->IsMainThread()); | 157 DCHECK(proxy_->IsMainThread()); |
| 156 proxy_->Stop(); | 158 proxy_->Stop(); |
| 157 } | 159 } |
| 158 | 160 |
| (...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1234 } | 1236 } |
| 1235 | 1237 |
| 1236 void LayerTreeHost::NotifySwapPromiseMonitorsOfSetNeedsCommit() { | 1238 void LayerTreeHost::NotifySwapPromiseMonitorsOfSetNeedsCommit() { |
| 1237 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 1239 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
| 1238 for (; it != swap_promise_monitor_.end(); it++) | 1240 for (; it != swap_promise_monitor_.end(); it++) |
| 1239 (*it)->OnSetNeedsCommitOnMain(); | 1241 (*it)->OnSetNeedsCommitOnMain(); |
| 1240 } | 1242 } |
| 1241 | 1243 |
| 1242 void LayerTreeHost::QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise) { | 1244 void LayerTreeHost::QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise) { |
| 1243 DCHECK(swap_promise); | 1245 DCHECK(swap_promise); |
| 1244 if (swap_promise_list_.size() > kMaxQueuedSwapPromiseNumber) | |
| 1245 BreakSwapPromises(SwapPromise::SWAP_PROMISE_LIST_OVERFLOW); | |
| 1246 swap_promise_list_.push_back(swap_promise.Pass()); | 1246 swap_promise_list_.push_back(swap_promise.Pass()); |
| 1247 } | 1247 } |
| 1248 | 1248 |
| 1249 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1249 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
| 1250 for (size_t i = 0; i < swap_promise_list_.size(); i++) | 1250 for (size_t i = 0; i < swap_promise_list_.size(); i++) |
| 1251 swap_promise_list_[i]->DidNotSwap(reason); | 1251 swap_promise_list_[i]->DidNotSwap(reason); |
| 1252 swap_promise_list_.clear(); | 1252 swap_promise_list_.clear(); |
| 1253 } | 1253 } |
| 1254 | 1254 |
| 1255 } // namespace cc | 1255 } // namespace cc |
| OLD | NEW |