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 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1187 } | 1187 } |
1188 | 1188 |
1189 void LayerTreeHostImpl::DidModifyTilePriorities() { | 1189 void LayerTreeHostImpl::DidModifyTilePriorities() { |
1190 DCHECK(settings_.impl_side_painting); | 1190 DCHECK(settings_.impl_side_painting); |
1191 // Mark priorities as dirty and schedule a ManageTiles(). | 1191 // Mark priorities as dirty and schedule a ManageTiles(). |
1192 tile_priorities_dirty_ = true; | 1192 tile_priorities_dirty_ = true; |
1193 client_->SetNeedsManageTilesOnImplThread(); | 1193 client_->SetNeedsManageTilesOnImplThread(); |
1194 } | 1194 } |
1195 | 1195 |
1196 void LayerTreeHostImpl::DidInitializeVisibleTile() { | 1196 void LayerTreeHostImpl::DidInitializeVisibleTile() { |
1197 // TODO(reveman): Determine tiles that changed and only damage | |
1198 // what's necessary. | |
1199 SetFullRootLayerDamage(); | |
1200 if (client_ && !client_->IsInsideDraw()) | 1197 if (client_ && !client_->IsInsideDraw()) |
1201 client_->DidInitializeVisibleTileOnImplThread(); | 1198 client_->DidInitializeVisibleTileOnImplThread(); |
1202 } | 1199 } |
1203 | 1200 |
1204 void LayerTreeHostImpl::NotifyReadyToActivate() { | 1201 void LayerTreeHostImpl::NotifyReadyToActivate() { |
1205 client_->NotifyReadyToActivate(); | 1202 client_->NotifyReadyToActivate(); |
1206 } | 1203 } |
1207 | 1204 |
1205 void LayerTreeHostImpl::NotifyInitializedTiles(Tile* tile) { | |
1206 LayerImpl* layer_impl = NULL; | |
reveman
2014/04/14 20:03:07
nit: move to where it's first used instead
sohanjg
2014/04/15 10:03:48
Done.
| |
1207 if (active_tree_) { | |
reveman
2014/04/14 20:03:07
nit: maybe cleaner to early out instead of having
sohanjg
2014/04/15 10:03:48
Done.
| |
1208 layer_impl = active_tree_->FindActiveTreeLayerById(tile->layer_id()); | |
1209 if (layer_impl) | |
1210 layer_impl->UnionDamageRect(tile->content_rect()); | |
danakj
2014/04/14 17:17:07
The tile's content rect is in the tiling's content
sohanjg
2014/04/15 10:03:48
Done.
| |
1211 } | |
1212 } | |
1213 | |
1208 void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { | 1214 void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { |
1209 SetManagedMemoryPolicy(policy, zero_budget_); | 1215 SetManagedMemoryPolicy(policy, zero_budget_); |
1210 } | 1216 } |
1211 | 1217 |
1212 void LayerTreeHostImpl::SetTreeActivationCallback( | 1218 void LayerTreeHostImpl::SetTreeActivationCallback( |
1213 const base::Closure& callback) { | 1219 const base::Closure& callback) { |
1214 DCHECK(proxy_->IsImplThread()); | 1220 DCHECK(proxy_->IsImplThread()); |
1215 DCHECK(settings_.impl_side_painting || callback.is_null()); | 1221 DCHECK(settings_.impl_side_painting || callback.is_null()); |
1216 tree_activation_callback_ = callback; | 1222 tree_activation_callback_ = callback; |
1217 } | 1223 } |
(...skipping 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3030 swap_promise_monitor_.erase(monitor); | 3036 swap_promise_monitor_.erase(monitor); |
3031 } | 3037 } |
3032 | 3038 |
3033 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { | 3039 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { |
3034 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 3040 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
3035 for (; it != swap_promise_monitor_.end(); it++) | 3041 for (; it != swap_promise_monitor_.end(); it++) |
3036 (*it)->OnSetNeedsRedrawOnImpl(); | 3042 (*it)->OnSetNeedsRedrawOnImpl(); |
3037 } | 3043 } |
3038 | 3044 |
3039 } // namespace cc | 3045 } // namespace cc |
OLD | NEW |