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

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

Issue 315393002: Record SkPicture with correct LCD text setting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated unittests Created 6 years, 6 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 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 const int kWarmupRuns = 0; 122 const int kWarmupRuns = 0;
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(visible_content_rect,
133 visible_content_rect, painter, tile_grid_info, false, 0, mode); 133 painter,
134 tile_grid_info,
135 false,
136 false,
137 0,
138 mode);
134 timer.NextLap(); 139 timer.NextLap();
135 } while (!timer.HasTimeLimitExpired()); 140 } while (!timer.HasTimeLimitExpired());
136 base::TimeDelta duration = 141 base::TimeDelta duration =
137 base::TimeDelta::FromMillisecondsD(timer.MsPerLap()); 142 base::TimeDelta::FromMillisecondsD(timer.MsPerLap());
138 if (duration < min_time) 143 if (duration < min_time)
139 min_time = duration; 144 min_time = duration;
140 } 145 }
141 146
142 if (mode == Picture::RECORD_NORMALLY) { 147 if (mode == Picture::RECORD_NORMALLY) {
143 record_results_.pixels_recorded += 148 record_results_.pixels_recorded +=
144 visible_content_rect.width() * visible_content_rect.height(); 149 visible_content_rect.width() * visible_content_rect.height();
145 } 150 }
146 record_results_.total_best_time[mode_index] += min_time; 151 record_results_.total_best_time[mode_index] += min_time;
147 } 152 }
148 } 153 }
149 154
150 RasterizeAndRecordBenchmark::RecordResults::RecordResults() 155 RasterizeAndRecordBenchmark::RecordResults::RecordResults()
151 : pixels_recorded(0) {} 156 : pixels_recorded(0) {}
152 157
153 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} 158 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {}
154 159
155 } // namespace cc 160 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698