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

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

Issue 917763003: cc: Move occlusion debug rects into the debug layer borders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
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 #include <limits> 8 #include <limits>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 if (active_tree_->hud_layer()) { 756 if (active_tree_->hud_layer()) {
757 RenderPass* root_pass = frame->render_passes.back(); 757 RenderPass* root_pass = frame->render_passes.back();
758 root_pass->damage_rect = root_pass->output_rect; 758 root_pass->damage_rect = root_pass->output_rect;
759 } 759 }
760 760
761 OcclusionTracker<LayerImpl> occlusion_tracker( 761 OcclusionTracker<LayerImpl> occlusion_tracker(
762 active_tree_->root_layer()->render_surface()->content_rect()); 762 active_tree_->root_layer()->render_surface()->content_rect());
763 occlusion_tracker.set_minimum_tracking_size( 763 occlusion_tracker.set_minimum_tracking_size(
764 settings_.minimum_occlusion_tracking_size); 764 settings_.minimum_occlusion_tracking_size);
765 765
766 if (debug_state_.show_occluding_rects) {
767 occlusion_tracker.set_occluding_screen_space_rects_container(
768 &frame->occluding_screen_space_rects);
769 }
770 if (debug_state_.show_non_occluding_rects) {
771 occlusion_tracker.set_non_occluding_screen_space_rects_container(
772 &frame->non_occluding_screen_space_rects);
773 }
774
775 // Add quads to the Render passes in front-to-back order to allow for testing 766 // Add quads to the Render passes in front-to-back order to allow for testing
776 // occlusion and performing culling during the tree walk. 767 // occlusion and performing culling during the tree walk.
777 typedef LayerIterator<LayerImpl> LayerIteratorType; 768 typedef LayerIterator<LayerImpl> LayerIteratorType;
778 769
779 // Typically when we are missing a texture and use a checkerboard quad, we 770 // Typically when we are missing a texture and use a checkerboard quad, we
780 // still draw the frame. However when the layer being checkerboarded is moving 771 // still draw the frame. However when the layer being checkerboarded is moving
781 // due to an impl-animation, we drop the frame to avoid flashing due to the 772 // due to an impl-animation, we drop the frame to avoid flashing due to the
782 // texture suddenly appearing in the future. 773 // texture suddenly appearing in the future.
783 DrawResult draw_result = DRAW_SUCCESS; 774 DrawResult draw_result = DRAW_SUCCESS;
784 // When we have a copy request for a layer, we need to draw no matter 775 // When we have a copy request for a layer, we need to draw no matter
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
1517 if (tile_manager_) { 1508 if (tile_manager_) {
1518 memory_history_->SaveEntry( 1509 memory_history_->SaveEntry(
1519 tile_manager_->memory_stats_from_last_assign()); 1510 tile_manager_->memory_stats_from_last_assign());
1520 } 1511 }
1521 1512
1522 if (debug_state_.ShowHudRects()) { 1513 if (debug_state_.ShowHudRects()) {
1523 debug_rect_history_->SaveDebugRectsForCurrentFrame( 1514 debug_rect_history_->SaveDebugRectsForCurrentFrame(
1524 active_tree_->root_layer(), 1515 active_tree_->root_layer(),
1525 active_tree_->hud_layer(), 1516 active_tree_->hud_layer(),
1526 *frame->render_surface_layer_list, 1517 *frame->render_surface_layer_list,
1527 frame->occluding_screen_space_rects,
1528 frame->non_occluding_screen_space_rects,
1529 debug_state_); 1518 debug_state_);
1530 } 1519 }
1531 1520
1532 if (!settings_.impl_side_painting && debug_state_.continuous_painting) { 1521 if (!settings_.impl_side_painting && debug_state_.continuous_painting) {
1533 const RenderingStats& stats = 1522 const RenderingStats& stats =
1534 rendering_stats_instrumentation_->GetRenderingStats(); 1523 rendering_stats_instrumentation_->GetRenderingStats();
1535 paint_time_counter_->SavePaintTime( 1524 paint_time_counter_->SavePaintTime(
1536 stats.begin_main_frame_to_commit_duration.GetLastTimeDelta()); 1525 stats.begin_main_frame_to_commit_duration.GetLastTimeDelta());
1537 } 1526 }
1538 1527
(...skipping 1990 matching lines...) Expand 10 before | Expand all | Expand 10 after
3529 } 3518 }
3530 3519
3531 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { 3520 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) {
3532 std::vector<PictureLayerImpl*>::iterator it = 3521 std::vector<PictureLayerImpl*>::iterator it =
3533 std::find(picture_layers_.begin(), picture_layers_.end(), layer); 3522 std::find(picture_layers_.begin(), picture_layers_.end(), layer);
3534 DCHECK(it != picture_layers_.end()); 3523 DCHECK(it != picture_layers_.end());
3535 picture_layers_.erase(it); 3524 picture_layers_.erase(it);
3536 } 3525 }
3537 3526
3538 } // namespace cc 3527 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698