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

Side by Side Diff: cc/debug/rasterize_and_record_benchmark.cc

Issue 362073002: cc: Remove all traces of SkPicture cloning. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 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
« no previous file with comments | « cc/debug/picture_record_benchmark.cc ('k') | cc/debug/rasterize_and_record_benchmark_impl.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/debug/rasterize_and_record_benchmark.h" 5 #include "cc/debug/rasterize_and_record_benchmark.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 10
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 const int kTimeCheckInterval = 1; 123 const int kTimeCheckInterval = 1;
124 124
125 for (int i = 0; i < record_repeat_count_; ++i) { 125 for (int i = 0; i < record_repeat_count_; ++i) {
126 // Run for a minimum amount of time to avoid problems with timer 126 // Run for a minimum amount of time to avoid problems with timer
127 // quantization when the layer is very small. 127 // quantization when the layer is very small.
128 LapTimer timer(kWarmupRuns, 128 LapTimer timer(kWarmupRuns,
129 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), 129 base::TimeDelta::FromMilliseconds(kTimeLimitMillis),
130 kTimeCheckInterval); 130 kTimeCheckInterval);
131 do { 131 do {
132 scoped_refptr<Picture> picture = Picture::Create( 132 scoped_refptr<Picture> picture = Picture::Create(
133 visible_content_rect, painter, tile_grid_info, false, 0, mode); 133 visible_content_rect, painter, tile_grid_info, false, mode);
134 timer.NextLap(); 134 timer.NextLap();
135 } while (!timer.HasTimeLimitExpired()); 135 } while (!timer.HasTimeLimitExpired());
136 base::TimeDelta duration = 136 base::TimeDelta duration =
137 base::TimeDelta::FromMillisecondsD(timer.MsPerLap()); 137 base::TimeDelta::FromMillisecondsD(timer.MsPerLap());
138 if (duration < min_time) 138 if (duration < min_time)
139 min_time = duration; 139 min_time = duration;
140 } 140 }
141 141
142 if (mode == Picture::RECORD_NORMALLY) { 142 if (mode == Picture::RECORD_NORMALLY) {
143 record_results_.pixels_recorded += 143 record_results_.pixels_recorded +=
144 visible_content_rect.width() * visible_content_rect.height(); 144 visible_content_rect.width() * visible_content_rect.height();
145 } 145 }
146 record_results_.total_best_time[mode_index] += min_time; 146 record_results_.total_best_time[mode_index] += min_time;
147 } 147 }
148 } 148 }
149 149
150 RasterizeAndRecordBenchmark::RecordResults::RecordResults() 150 RasterizeAndRecordBenchmark::RecordResults::RecordResults()
151 : pixels_recorded(0) {} 151 : pixels_recorded(0) {}
152 152
153 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} 153 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {}
154 154
155 } // namespace cc 155 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug/picture_record_benchmark.cc ('k') | cc/debug/rasterize_and_record_benchmark_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698