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 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 } | 1199 } |
1200 | 1200 |
1201 void LayerTreeHostImpl::DidModifyTilePriorities() { | 1201 void LayerTreeHostImpl::DidModifyTilePriorities() { |
1202 DCHECK(settings_.impl_side_painting); | 1202 DCHECK(settings_.impl_side_painting); |
1203 // Mark priorities as dirty and schedule a ManageTiles(). | 1203 // Mark priorities as dirty and schedule a ManageTiles(). |
1204 tile_priorities_dirty_ = true; | 1204 tile_priorities_dirty_ = true; |
1205 client_->SetNeedsManageTilesOnImplThread(); | 1205 client_->SetNeedsManageTilesOnImplThread(); |
1206 } | 1206 } |
1207 | 1207 |
1208 void LayerTreeHostImpl::DidInitializeVisibleTile() { | 1208 void LayerTreeHostImpl::DidInitializeVisibleTile() { |
1209 // TODO(reveman): Determine tiles that changed and only damage | |
1210 // what's necessary. | |
1211 SetFullRootLayerDamage(); | |
1212 if (client_ && !client_->IsInsideDraw()) | 1209 if (client_ && !client_->IsInsideDraw()) |
1213 client_->DidInitializeVisibleTileOnImplThread(); | 1210 client_->DidInitializeVisibleTileOnImplThread(); |
1214 } | 1211 } |
1215 | 1212 |
1216 void LayerTreeHostImpl::NotifyReadyToActivate() { | 1213 void LayerTreeHostImpl::NotifyReadyToActivate() { |
1217 client_->NotifyReadyToActivate(); | 1214 client_->NotifyReadyToActivate(); |
1218 } | 1215 } |
1219 | 1216 |
| 1217 void LayerTreeHostImpl::NotifyTileInitialized(const Tile* tile) { |
| 1218 if (!active_tree_) |
| 1219 return; |
| 1220 |
| 1221 LayerImpl* layer_impl = |
| 1222 active_tree_->FindActiveTreeLayerById(tile->layer_id()); |
| 1223 if (layer_impl) { |
| 1224 gfx::RectF layer_damage_rect = |
| 1225 gfx::ScaleRect(tile->content_rect(), 1.f / tile->contents_scale()); |
| 1226 layer_impl->AddDamageRect(layer_damage_rect); |
| 1227 } |
| 1228 } |
| 1229 |
1220 void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { | 1230 void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { |
1221 SetManagedMemoryPolicy(policy, zero_budget_); | 1231 SetManagedMemoryPolicy(policy, zero_budget_); |
1222 } | 1232 } |
1223 | 1233 |
1224 void LayerTreeHostImpl::SetTreeActivationCallback( | 1234 void LayerTreeHostImpl::SetTreeActivationCallback( |
1225 const base::Closure& callback) { | 1235 const base::Closure& callback) { |
1226 DCHECK(proxy_->IsImplThread()); | 1236 DCHECK(proxy_->IsImplThread()); |
1227 DCHECK(settings_.impl_side_painting || callback.is_null()); | 1237 DCHECK(settings_.impl_side_painting || callback.is_null()); |
1228 tree_activation_callback_ = callback; | 1238 tree_activation_callback_ = callback; |
1229 } | 1239 } |
(...skipping 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3057 swap_promise_monitor_.erase(monitor); | 3067 swap_promise_monitor_.erase(monitor); |
3058 } | 3068 } |
3059 | 3069 |
3060 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { | 3070 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { |
3061 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 3071 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
3062 for (; it != swap_promise_monitor_.end(); it++) | 3072 for (; it != swap_promise_monitor_.end(); it++) |
3063 (*it)->OnSetNeedsRedrawOnImpl(); | 3073 (*it)->OnSetNeedsRedrawOnImpl(); |
3064 } | 3074 } |
3065 | 3075 |
3066 } // namespace cc | 3076 } // namespace cc |
OLD | NEW |