| 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 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 frame->render_passes.clear(); | 1096 frame->render_passes.clear(); |
| 1097 frame->render_passes_by_id.clear(); | 1097 frame->render_passes_by_id.clear(); |
| 1098 frame->will_draw_layers.clear(); | 1098 frame->will_draw_layers.clear(); |
| 1099 frame->contains_incomplete_tile = false; | 1099 frame->contains_incomplete_tile = false; |
| 1100 frame->has_no_damage = false; | 1100 frame->has_no_damage = false; |
| 1101 | 1101 |
| 1102 gfx::Rect device_viewport_damage_rect(damage_rect); | 1102 gfx::Rect device_viewport_damage_rect(damage_rect); |
| 1103 if (active_tree_->root_layer()) { | 1103 if (active_tree_->root_layer()) { |
| 1104 device_viewport_damage_rect.Union(viewport_damage_rect_); | 1104 device_viewport_damage_rect.Union(viewport_damage_rect_); |
| 1105 viewport_damage_rect_ = gfx::Rect(); | 1105 viewport_damage_rect_ = gfx::Rect(); |
| 1106 | |
| 1107 active_tree_->root_layer()->render_surface()->damage_tracker()-> | 1106 active_tree_->root_layer()->render_surface()->damage_tracker()-> |
| 1108 AddDamageNextUpdate(device_viewport_damage_rect); | 1107 AddDamageNextUpdate(device_viewport_damage_rect); |
| 1109 } | 1108 } |
| 1110 | 1109 |
| 1111 DrawSwapReadbackResult::DrawResult draw_result = CalculateRenderPasses(frame); | 1110 DrawSwapReadbackResult::DrawResult draw_result = CalculateRenderPasses(frame); |
| 1112 if (draw_result != DrawSwapReadbackResult::DRAW_SUCCESS) { | 1111 if (draw_result != DrawSwapReadbackResult::DRAW_SUCCESS) { |
| 1113 DCHECK(!output_surface_->capabilities() | 1112 DCHECK(!output_surface_->capabilities() |
| 1114 .draw_and_swap_full_viewport_every_frame); | 1113 .draw_and_swap_full_viewport_every_frame); |
| 1115 return draw_result; | 1114 return draw_result; |
| 1116 } | 1115 } |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1187 } | 1186 } |
| 1188 | 1187 |
| 1189 void LayerTreeHostImpl::DidModifyTilePriorities() { | 1188 void LayerTreeHostImpl::DidModifyTilePriorities() { |
| 1190 DCHECK(settings_.impl_side_painting); | 1189 DCHECK(settings_.impl_side_painting); |
| 1191 // Mark priorities as dirty and schedule a ManageTiles(). | 1190 // Mark priorities as dirty and schedule a ManageTiles(). |
| 1192 tile_priorities_dirty_ = true; | 1191 tile_priorities_dirty_ = true; |
| 1193 client_->SetNeedsManageTilesOnImplThread(); | 1192 client_->SetNeedsManageTilesOnImplThread(); |
| 1194 } | 1193 } |
| 1195 | 1194 |
| 1196 void LayerTreeHostImpl::DidInitializeVisibleTile() { | 1195 void LayerTreeHostImpl::DidInitializeVisibleTile() { |
| 1197 // TODO(reveman): Determine tiles that changed and only damage | 1196 std::map<int, gfx::Rect> map = tile_manager_->GetTileRectLayerMap(); |
| 1198 // what's necessary. | 1197 for (std::map<int, gfx::Rect>::iterator it = map.begin(); it != map.end(); |
| 1199 SetFullRootLayerDamage(); | 1198 ++it) { |
| 1199 if (active_tree_) |
| 1200 active_tree_->FindActiveTreeLayerById(it->first) |
| 1201 ->SetInitializedTileRect(it->second); |
| 1202 } |
| 1203 tile_manager_->ResetTileRectLayerMap(); |
| 1204 |
| 1200 if (client_ && !client_->IsInsideDraw()) | 1205 if (client_ && !client_->IsInsideDraw()) |
| 1201 client_->DidInitializeVisibleTileOnImplThread(); | 1206 client_->DidInitializeVisibleTileOnImplThread(); |
| 1202 } | 1207 } |
| 1203 | 1208 |
| 1204 void LayerTreeHostImpl::NotifyReadyToActivate() { | 1209 void LayerTreeHostImpl::NotifyReadyToActivate() { |
| 1205 client_->NotifyReadyToActivate(); | 1210 client_->NotifyReadyToActivate(); |
| 1206 } | 1211 } |
| 1207 | 1212 |
| 1208 void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { | 1213 void LayerTreeHostImpl::SetMemoryPolicy(const ManagedMemoryPolicy& policy) { |
| 1209 SetManagedMemoryPolicy(policy, zero_budget_); | 1214 SetManagedMemoryPolicy(policy, zero_budget_); |
| (...skipping 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3030 swap_promise_monitor_.erase(monitor); | 3035 swap_promise_monitor_.erase(monitor); |
| 3031 } | 3036 } |
| 3032 | 3037 |
| 3033 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { | 3038 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { |
| 3034 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 3039 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
| 3035 for (; it != swap_promise_monitor_.end(); it++) | 3040 for (; it != swap_promise_monitor_.end(); it++) |
| 3036 (*it)->OnSetNeedsRedrawOnImpl(); | 3041 (*it)->OnSetNeedsRedrawOnImpl(); |
| 3037 } | 3042 } |
| 3038 | 3043 |
| 3039 } // namespace cc | 3044 } // namespace cc |
| OLD | NEW |