| 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_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1229 // Mark priorities as dirty and schedule a ManageTiles(). | 1229 // Mark priorities as dirty and schedule a ManageTiles(). |
| 1230 tile_priorities_dirty_ = true; | 1230 tile_priorities_dirty_ = true; |
| 1231 client_->SetNeedsManageTilesOnImplThread(); | 1231 client_->SetNeedsManageTilesOnImplThread(); |
| 1232 } | 1232 } |
| 1233 | 1233 |
| 1234 void LayerTreeHostImpl::DidInitializeVisibleTile() { | 1234 void LayerTreeHostImpl::DidInitializeVisibleTile() { |
| 1235 if (client_ && !client_->IsInsideDraw()) | 1235 if (client_ && !client_->IsInsideDraw()) |
| 1236 client_->DidInitializeVisibleTileOnImplThread(); | 1236 client_->DidInitializeVisibleTileOnImplThread(); |
| 1237 } | 1237 } |
| 1238 | 1238 |
| 1239 const std::vector<PictureLayerImpl*>& LayerTreeHostImpl::GetPictureLayers() { |
| 1240 return picture_layers_; |
| 1241 } |
| 1242 |
| 1239 void LayerTreeHostImpl::NotifyReadyToActivate() { | 1243 void LayerTreeHostImpl::NotifyReadyToActivate() { |
| 1240 client_->NotifyReadyToActivate(); | 1244 client_->NotifyReadyToActivate(); |
| 1241 } | 1245 } |
| 1242 | 1246 |
| 1243 void LayerTreeHostImpl::NotifyTileStateChanged(const Tile* tile) { | 1247 void LayerTreeHostImpl::NotifyTileStateChanged(const Tile* tile) { |
| 1244 TRACE_EVENT0("cc", "LayerTreeHostImpl::NotifyTileStateChanged"); | 1248 TRACE_EVENT0("cc", "LayerTreeHostImpl::NotifyTileStateChanged"); |
| 1245 | 1249 |
| 1246 if (active_tree_) { | 1250 if (active_tree_) { |
| 1247 LayerImpl* layer_impl = | 1251 LayerImpl* layer_impl = |
| 1248 active_tree_->FindActiveTreeLayerById(tile->layer_id()); | 1252 active_tree_->FindActiveTreeLayerById(tile->layer_id()); |
| (...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3128 void LayerTreeHostImpl::RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor) { | 3132 void LayerTreeHostImpl::RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor) { |
| 3129 swap_promise_monitor_.erase(monitor); | 3133 swap_promise_monitor_.erase(monitor); |
| 3130 } | 3134 } |
| 3131 | 3135 |
| 3132 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { | 3136 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { |
| 3133 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 3137 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
| 3134 for (; it != swap_promise_monitor_.end(); it++) | 3138 for (; it != swap_promise_monitor_.end(); it++) |
| 3135 (*it)->OnSetNeedsRedrawOnImpl(); | 3139 (*it)->OnSetNeedsRedrawOnImpl(); |
| 3136 } | 3140 } |
| 3137 | 3141 |
| 3142 void LayerTreeHostImpl::RegisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3143 DCHECK(std::find(picture_layers_.begin(), picture_layers_.end(), layer) == |
| 3144 picture_layers_.end()); |
| 3145 picture_layers_.push_back(layer); |
| 3146 } |
| 3147 |
| 3148 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3149 std::vector<PictureLayerImpl*>::iterator it = |
| 3150 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3151 DCHECK(it != picture_layers_.end()); |
| 3152 picture_layers_.erase(it); |
| 3153 } |
| 3154 |
| 3138 } // namespace cc | 3155 } // namespace cc |
| OLD | NEW |