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 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1188 void LayerTreeHostImpl::DidModifyTilePriorities() { | 1188 void LayerTreeHostImpl::DidModifyTilePriorities() { |
1189 DCHECK(settings_.impl_side_painting); | 1189 DCHECK(settings_.impl_side_painting); |
1190 // Mark priorities as dirty and schedule a ManageTiles(). | 1190 // Mark priorities as dirty and schedule a ManageTiles(). |
1191 tile_priorities_dirty_ = true; | 1191 tile_priorities_dirty_ = true; |
1192 client_->SetNeedsManageTilesOnImplThread(); | 1192 client_->SetNeedsManageTilesOnImplThread(); |
1193 } | 1193 } |
1194 | 1194 |
1195 void LayerTreeHostImpl::DidInitializeVisibleTile() { | 1195 void LayerTreeHostImpl::DidInitializeVisibleTile() { |
1196 // TODO(reveman): Determine tiles that changed and only damage | 1196 // TODO(reveman): Determine tiles that changed and only damage |
1197 // what's necessary. | 1197 // what's necessary. |
1198 SetFullRootLayerDamage(); | 1198 gfx::Rect rect = tile_manager_->GetDamagedRect(); |
| 1199 if (rect.width() * rect.height() <= |
| 1200 DrawViewportSize().width() * DrawViewportSize().height()) |
| 1201 SetViewportDamage(rect); |
| 1202 else |
| 1203 SetFullRootLayerDamage(); |
| 1204 tile_manager_->ResetDamagedRect(); |
| 1205 |
1199 if (client_ && !client_->IsInsideDraw()) | 1206 if (client_ && !client_->IsInsideDraw()) |
1200 client_->DidInitializeVisibleTileOnImplThread(); | 1207 client_->DidInitializeVisibleTileOnImplThread(); |
1201 } | 1208 } |
1202 | 1209 |
1203 void LayerTreeHostImpl::NotifyReadyToActivate() { | 1210 void LayerTreeHostImpl::NotifyReadyToActivate() { |
1204 client_->NotifyReadyToActivate(); | 1211 client_->NotifyReadyToActivate(); |
1205 } | 1212 } |
1206 | 1213 |
1207 void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { | 1214 void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { |
1208 SetManagedMemoryPolicy(policy, zero_budget_); | 1215 SetManagedMemoryPolicy(policy, zero_budget_); |
(...skipping 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3019 swap_promise_monitor_.erase(monitor); | 3026 swap_promise_monitor_.erase(monitor); |
3020 } | 3027 } |
3021 | 3028 |
3022 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { | 3029 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { |
3023 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 3030 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
3024 for (; it != swap_promise_monitor_.end(); it++) | 3031 for (; it != swap_promise_monitor_.end(); it++) |
3025 (*it)->OnSetNeedsRedrawOnImpl(); | 3032 (*it)->OnSetNeedsRedrawOnImpl(); |
3026 } | 3033 } |
3027 | 3034 |
3028 } // namespace cc | 3035 } // namespace cc |
OLD | NEW |