Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 12259027: cc: Simplify the logic for deciding to update tile priorities. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sper simple x2 Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 void LayerTreeHostImpl::BeginCommit() {} 222 void LayerTreeHostImpl::BeginCommit() {}
223 223
224 void LayerTreeHostImpl::CommitComplete() { 224 void LayerTreeHostImpl::CommitComplete() {
225 TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete"); 225 TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete");
226 226
227 // Impl-side painting needs an update immediately post-commit to have the 227 // Impl-side painting needs an update immediately post-commit to have the
228 // opportunity to create tilings. Other paths can call UpdateDrawProperties 228 // opportunity to create tilings. Other paths can call UpdateDrawProperties
229 // more lazily when needed prior to drawing. 229 // more lazily when needed prior to drawing.
230 if (settings_.impl_side_painting) { 230 if (settings_.impl_side_painting) {
231 pending_tree_->set_needs_update_draw_properties(); 231 pending_tree_->set_needs_update_draw_properties();
232 pending_tree_->UpdateDrawProperties(LayerTreeImpl::UPDATE_PENDING_TREE); 232 pending_tree_->UpdateDrawProperties();
233 } else { 233 } else {
234 active_tree_->set_needs_update_draw_properties(); 234 active_tree_->set_needs_update_draw_properties();
235 } 235 }
236 236
237 client_->SendManagedMemoryStats(); 237 client_->SendManagedMemoryStats();
238 } 238 }
239 239
240 bool LayerTreeHostImpl::CanDraw() { 240 bool LayerTreeHostImpl::CanDraw() {
241 // Note: If you are changing this function or any other function that might 241 // Note: If you are changing this function or any other function that might
242 // affect the result of CanDraw, make sure to call 242 // affect the result of CanDraw, make sure to call
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 it = frame->render_passes.size() - position_from_end; 847 it = frame->render_passes.size() - position_from_end;
848 DCHECK_GE(frame->render_passes.size(), position_from_end); 848 DCHECK_GE(frame->render_passes.size(), position_from_end);
849 } 849 }
850 } 850 }
851 } 851 }
852 852
853 bool LayerTreeHostImpl::PrepareToDraw(FrameData* frame, 853 bool LayerTreeHostImpl::PrepareToDraw(FrameData* frame,
854 gfx::Rect device_viewport_damage_rect) { 854 gfx::Rect device_viewport_damage_rect) {
855 TRACE_EVENT0("cc", "LayerTreeHostImpl::PrepareToDraw"); 855 TRACE_EVENT0("cc", "LayerTreeHostImpl::PrepareToDraw");
856 856
857 active_tree_->UpdateDrawProperties( 857 active_tree_->UpdateDrawProperties();
858 LayerTreeImpl::UPDATE_ACTIVE_TREE_FOR_DRAW);
859 858
860 frame->render_surface_layer_list = &active_tree_->RenderSurfaceLayerList(); 859 frame->render_surface_layer_list = &active_tree_->RenderSurfaceLayerList();
861 frame->render_passes.clear(); 860 frame->render_passes.clear();
862 frame->render_passes_by_id.clear(); 861 frame->render_passes_by_id.clear();
863 frame->will_draw_layers.clear(); 862 frame->will_draw_layers.clear();
864 frame->contains_incomplete_tile = false; 863 frame->contains_incomplete_tile = false;
865 frame->has_no_damage = false; 864 frame->has_no_damage = false;
866 865
867 if (active_tree_->root_layer()) { 866 if (active_tree_->root_layer()) {
868 device_viewport_damage_rect.Union(viewport_damage_rect_); 867 device_viewport_damage_rect.Union(viewport_damage_rect_);
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 if (tile_manager_) 1222 if (tile_manager_)
1224 tile_manager_->CheckForCompletedTileUploads(); 1223 tile_manager_->CheckForCompletedTileUploads();
1225 } 1224 }
1226 1225
1227 bool LayerTreeHostImpl::ActivatePendingTreeIfNeeded() { 1226 bool LayerTreeHostImpl::ActivatePendingTreeIfNeeded() {
1228 if (!pending_tree_) 1227 if (!pending_tree_)
1229 return false; 1228 return false;
1230 1229
1231 CHECK(tile_manager_); 1230 CHECK(tile_manager_);
1232 1231
1233 pending_tree_->UpdateDrawProperties(LayerTreeImpl::UPDATE_PENDING_TREE); 1232 pending_tree_->UpdateDrawProperties();
1234 1233
1235 TRACE_EVENT_ASYNC_STEP1("cc", 1234 TRACE_EVENT_ASYNC_STEP1("cc",
1236 "PendingTree", pending_tree_.get(), "activate", 1235 "PendingTree", pending_tree_.get(), "activate",
1237 "state", ValueToString(ActivationStateAsValue())); 1236 "state", ValueToString(ActivationStateAsValue()));
1238 1237
1239 // Activate once all visible resources in pending tree are ready. 1238 // Activate once all visible resources in pending tree are ready.
1240 if (!pending_tree_->AreVisibleResourcesReady()) 1239 if (!pending_tree_->AreVisibleResourcesReady())
1241 return false; 1240 return false;
1242 1241
1243 ActivatePendingTree(); 1242 ActivatePendingTree();
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1432 active_tree_->UpdateMaxScrollOffset(); 1431 active_tree_->UpdateMaxScrollOffset();
1433 } 1432 }
1434 1433
1435 void LayerTreeHostImpl::DidChangeTopControlsPosition() { 1434 void LayerTreeHostImpl::DidChangeTopControlsPosition() {
1436 client_->SetNeedsRedrawOnImplThread(); 1435 client_->SetNeedsRedrawOnImplThread();
1437 active_tree_->set_needs_update_draw_properties(); 1436 active_tree_->set_needs_update_draw_properties();
1438 SetFullRootLayerDamage(); 1437 SetFullRootLayerDamage();
1439 } 1438 }
1440 1439
1441 bool LayerTreeHostImpl::EnsureRenderSurfaceLayerList() { 1440 bool LayerTreeHostImpl::EnsureRenderSurfaceLayerList() {
1442 active_tree_->UpdateDrawProperties(LayerTreeImpl::UPDATE_ACTIVE_TREE); 1441 active_tree_->UpdateDrawProperties();
1443 return !active_tree_->RenderSurfaceLayerList().empty(); 1442 return !active_tree_->RenderSurfaceLayerList().empty();
1444 } 1443 }
1445 1444
1446 InputHandlerClient::ScrollStatus LayerTreeHostImpl::ScrollBegin( 1445 InputHandlerClient::ScrollStatus LayerTreeHostImpl::ScrollBegin(
1447 gfx::Point viewport_point, InputHandlerClient::ScrollInputType type) { 1446 gfx::Point viewport_point, InputHandlerClient::ScrollInputType type) {
1448 TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBegin"); 1447 TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBegin");
1449 1448
1450 if (top_controls_manager_) 1449 if (top_controls_manager_)
1451 top_controls_manager_->ScrollBegin(); 1450 top_controls_manager_->ScrollBegin();
1452 1451
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
2095 } 2094 }
2096 2095
2097 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { 2096 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) {
2098 if (debug_state_.continuous_painting != debug_state.continuous_painting) 2097 if (debug_state_.continuous_painting != debug_state.continuous_painting)
2099 paint_time_counter_->ClearHistory(); 2098 paint_time_counter_->ClearHistory();
2100 2099
2101 debug_state_ = debug_state; 2100 debug_state_ = debug_state;
2102 } 2101 }
2103 2102
2104 } // namespace cc 2103 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698