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

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

Issue 364063005: Histogram to track missing and incomplete tiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rm confusing missing_tiles++ Created 6 years, 5 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
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 // texture suddenly appearing in the future. 793 // texture suddenly appearing in the future.
794 DrawResult draw_result = DRAW_SUCCESS; 794 DrawResult draw_result = DRAW_SUCCESS;
795 // When we have a copy request for a layer, we need to draw no matter 795 // When we have a copy request for a layer, we need to draw no matter
796 // what, as the layer may disappear after this frame. 796 // what, as the layer may disappear after this frame.
797 bool have_copy_request = false; 797 bool have_copy_request = false;
798 798
799 int layers_drawn = 0; 799 int layers_drawn = 0;
800 800
801 const DrawMode draw_mode = GetDrawMode(); 801 const DrawMode draw_mode = GetDrawMode();
802 802
803 int num_missing_tiles = 0;
804 int num_incomplete_tiles = 0;
805
803 LayerIteratorType end = 806 LayerIteratorType end =
804 LayerIteratorType::End(frame->render_surface_layer_list); 807 LayerIteratorType::End(frame->render_surface_layer_list);
805 for (LayerIteratorType it = 808 for (LayerIteratorType it =
806 LayerIteratorType::Begin(frame->render_surface_layer_list); 809 LayerIteratorType::Begin(frame->render_surface_layer_list);
807 it != end; 810 it != end;
808 ++it) { 811 ++it) {
809 RenderPass::Id target_render_pass_id = 812 RenderPass::Id target_render_pass_id =
810 it.target_render_surface_layer()->render_surface()->RenderPassId(); 813 it.target_render_surface_layer()->render_surface()->RenderPassId();
811 RenderPass* target_render_pass = 814 RenderPass* target_render_pass =
812 frame->render_passes_by_id[target_render_pass_id]; 815 frame->render_passes_by_id[target_render_pass_id];
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 } 871 }
869 872
870 ++layers_drawn; 873 ++layers_drawn;
871 } 874 }
872 875
873 rendering_stats_instrumentation_->AddVisibleContentArea( 876 rendering_stats_instrumentation_->AddVisibleContentArea(
874 append_quads_data.visible_content_area); 877 append_quads_data.visible_content_area);
875 rendering_stats_instrumentation_->AddApproximatedVisibleContentArea( 878 rendering_stats_instrumentation_->AddApproximatedVisibleContentArea(
876 append_quads_data.approximated_visible_content_area); 879 append_quads_data.approximated_visible_content_area);
877 880
881 num_missing_tiles += append_quads_data.num_missing_tiles;
882 num_incomplete_tiles += append_quads_data.num_incomplete_tiles;
883
878 if (append_quads_data.num_missing_tiles) { 884 if (append_quads_data.num_missing_tiles) {
879 bool layer_has_animating_transform = 885 bool layer_has_animating_transform =
880 it->screen_space_transform_is_animating() || 886 it->screen_space_transform_is_animating() ||
881 it->draw_transform_is_animating(); 887 it->draw_transform_is_animating();
882 if (layer_has_animating_transform) 888 if (layer_has_animating_transform)
883 draw_result = DRAW_ABORTED_CHECKERBOARD_ANIMATIONS; 889 draw_result = DRAW_ABORTED_CHECKERBOARD_ANIMATIONS;
884 } 890 }
885 891
886 if (append_quads_data.had_incomplete_tile) { 892 if (append_quads_data.num_incomplete_tiles ||
893 append_quads_data.num_missing_tiles) {
887 frame->contains_incomplete_tile = true; 894 frame->contains_incomplete_tile = true;
888 if (active_tree()->RequiresHighResToDraw()) 895 if (active_tree()->RequiresHighResToDraw())
889 draw_result = DRAW_ABORTED_MISSING_HIGH_RES_CONTENT; 896 draw_result = DRAW_ABORTED_MISSING_HIGH_RES_CONTENT;
890 } 897 }
891 898
892 occlusion_tracker.LeaveLayer(it); 899 occlusion_tracker.LeaveLayer(it);
893 } 900 }
894 901
895 if (have_copy_request || 902 if (have_copy_request ||
896 output_surface_->capabilities().draw_and_swap_full_viewport_every_frame) 903 output_surface_->capabilities().draw_and_swap_full_viewport_every_frame)
(...skipping 30 matching lines...) Expand all
927 while (!active_tree_->LayersWithCopyOutputRequest().empty()) { 934 while (!active_tree_->LayersWithCopyOutputRequest().empty()) {
928 LayerImpl* layer = active_tree_->LayersWithCopyOutputRequest().back(); 935 LayerImpl* layer = active_tree_->LayersWithCopyOutputRequest().back();
929 layer->TakeCopyRequestsAndTransformToTarget(&requests_to_abort); 936 layer->TakeCopyRequestsAndTransformToTarget(&requests_to_abort);
930 } 937 }
931 for (size_t i = 0; i < requests_to_abort.size(); ++i) 938 for (size_t i = 0; i < requests_to_abort.size(); ++i)
932 requests_to_abort[i]->SendEmptyResult(); 939 requests_to_abort[i]->SendEmptyResult();
933 940
934 // If we're making a frame to draw, it better have at least one render pass. 941 // If we're making a frame to draw, it better have at least one render pass.
935 DCHECK(!frame->render_passes.empty()); 942 DCHECK(!frame->render_passes.empty());
936 943
944 if (IsCurrentlyScrolling()) {
945 UMA_HISTOGRAM_COUNTS_100(
946 "Compositing.RenderPass.AppendQuadData.NumMissingTiles",
947 num_missing_tiles);
948 UMA_HISTOGRAM_COUNTS_100(
949 "Compositing.RenderPass.AppendQuadData.NumIncompleteTiles",
950 num_incomplete_tiles);
951 }
952
937 // Should only have one render pass in resourceless software mode. 953 // Should only have one render pass in resourceless software mode.
938 DCHECK(draw_mode != DRAW_MODE_RESOURCELESS_SOFTWARE || 954 DCHECK(draw_mode != DRAW_MODE_RESOURCELESS_SOFTWARE ||
939 frame->render_passes.size() == 1u) 955 frame->render_passes.size() == 1u)
940 << frame->render_passes.size(); 956 << frame->render_passes.size();
941 957
942 return draw_result; 958 return draw_result;
943 } 959 }
944 960
945 void LayerTreeHostImpl::MainThreadHasStoppedFlinging() { 961 void LayerTreeHostImpl::MainThreadHasStoppedFlinging() {
946 if (input_handler_client_) 962 if (input_handler_client_)
(...skipping 2299 matching lines...) Expand 10 before | Expand all | Expand 10 after
3246 } 3262 }
3247 3263
3248 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { 3264 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) {
3249 std::vector<PictureLayerImpl*>::iterator it = 3265 std::vector<PictureLayerImpl*>::iterator it =
3250 std::find(picture_layers_.begin(), picture_layers_.end(), layer); 3266 std::find(picture_layers_.begin(), picture_layers_.end(), layer);
3251 DCHECK(it != picture_layers_.end()); 3267 DCHECK(it != picture_layers_.end());
3252 picture_layers_.erase(it); 3268 picture_layers_.erase(it);
3253 } 3269 }
3254 3270
3255 } // namespace cc 3271 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698