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

Side by Side Diff: cc/resources/picture_pile.cc

Issue 26031002: cc: Remove unused metrics from RenderingStats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed raster_worker_pool_perftest.cc Created 7 years, 2 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/resources/picture.cc ('k') | cc/resources/picture_pile_impl.h » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/resources/picture_pile.h" 5 #include "cc/resources/picture_pile.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 scoped_refptr<Picture> base_picture = Picture::Create(tile); 109 scoped_refptr<Picture> base_picture = Picture::Create(tile);
110 pic_list.push_back(base_picture); 110 pic_list.push_back(base_picture);
111 } 111 }
112 112
113 for (PictureList::iterator pic = pic_list.begin(); 113 for (PictureList::iterator pic = pic_list.begin();
114 pic != pic_list.end(); ++pic) { 114 pic != pic_list.end(); ++pic) {
115 if (!(*pic)->HasRecording()) { 115 if (!(*pic)->HasRecording()) {
116 modified_pile = true; 116 modified_pile = true;
117 TRACE_EVENT0(benchmark_instrumentation::kCategory, 117 TRACE_EVENT0(benchmark_instrumentation::kCategory,
118 benchmark_instrumentation::kRecordLoop); 118 benchmark_instrumentation::kRecordLoop);
119 base::TimeDelta total_duration =
120 base::TimeDelta::FromInternalValue(0);
121 base::TimeDelta best_duration = base::TimeDelta::FromInternalValue( 119 base::TimeDelta best_duration = base::TimeDelta::FromInternalValue(
122 std::numeric_limits<int64>::max()); 120 std::numeric_limits<int64>::max());
123 for (int i = 0; i < repeat_count; i++) { 121 for (int i = 0; i < repeat_count; i++) {
124 base::TimeTicks start_time = stats_instrumentation->StartRecording(); 122 base::TimeTicks start_time = stats_instrumentation->StartRecording();
125 (*pic)->Record(painter, tile_grid_info_); 123 (*pic)->Record(painter, tile_grid_info_);
126 base::TimeDelta duration = 124 base::TimeDelta duration =
127 stats_instrumentation->EndRecording(start_time); 125 stats_instrumentation->EndRecording(start_time);
128 total_duration += duration;
129 best_duration = std::min(duration, best_duration); 126 best_duration = std::min(duration, best_duration);
130 } 127 }
131 int painted_pixels = 128 int recorded_pixel_count =
132 (*pic)->LayerRect().width() * (*pic)->LayerRect().height(); 129 (*pic)->LayerRect().width() * (*pic)->LayerRect().height();
133 stats_instrumentation->AddRecord(total_duration, 130 stats_instrumentation->AddRecord(best_duration, recorded_pixel_count);
134 best_duration, 131 (*pic)->GatherPixelRefs(tile_grid_info_);
135 painted_pixels);
136 (*pic)->GatherPixelRefs(tile_grid_info_, stats_instrumentation);
137 (*pic)->CloneForDrawing(num_raster_threads_); 132 (*pic)->CloneForDrawing(num_raster_threads_);
138 } 133 }
139 } 134 }
140 } 135 }
141 136
142 UpdateRecordedRegion(); 137 UpdateRecordedRegion();
143 138
144 return modified_pile; 139 return modified_pile;
145 } 140 }
146 141
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 180
186 FullyContainedPredicate pred(picture_rect); 181 FullyContainedPredicate pred(picture_rect);
187 picture_list.erase(std::remove_if(picture_list.begin(), 182 picture_list.erase(std::remove_if(picture_list.begin(),
188 picture_list.end(), 183 picture_list.end(),
189 pred), 184 pred),
190 picture_list.end()); 185 picture_list.end());
191 picture_list.push_back(Picture::Create(picture_rect)); 186 picture_list.push_back(Picture::Create(picture_rect));
192 } 187 }
193 188
194 } // namespace cc 189 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture.cc ('k') | cc/resources/picture_pile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698