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

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

Issue 1799883002: cc: Refactor SkipImageCanvas and create it during playback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 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_impl.h" 5 #include "cc/debug/rasterize_and_record_benchmark_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 SkColor color = SK_ColorTRANSPARENT; 46 SkColor color = SK_ColorTRANSPARENT;
47 *is_solid_color = raster_source->PerformSolidColorAnalysis( 47 *is_solid_color = raster_source->PerformSolidColorAnalysis(
48 content_rect, contents_scale, &color); 48 content_rect, contents_scale, &color);
49 49
50 do { 50 do {
51 SkBitmap bitmap; 51 SkBitmap bitmap;
52 bitmap.allocPixels(SkImageInfo::MakeN32Premul(content_rect.width(), 52 bitmap.allocPixels(SkImageInfo::MakeN32Premul(content_rect.width(),
53 content_rect.height())); 53 content_rect.height()));
54 SkCanvas canvas(bitmap); 54 SkCanvas canvas(bitmap);
55 55
56 const bool include_images = true;
56 raster_source->PlaybackToCanvas(&canvas, content_rect, content_rect, 57 raster_source->PlaybackToCanvas(&canvas, content_rect, content_rect,
57 contents_scale); 58 contents_scale, include_images);
58 59
59 timer.NextLap(); 60 timer.NextLap();
60 } while (!timer.HasTimeLimitExpired()); 61 } while (!timer.HasTimeLimitExpired());
61 base::TimeDelta duration = 62 base::TimeDelta duration =
62 base::TimeDelta::FromMillisecondsD(timer.MsPerLap()); 63 base::TimeDelta::FromMillisecondsD(timer.MsPerLap());
63 if (duration < *min_time) 64 if (duration < *min_time)
64 *min_time = duration; 65 *min_time = duration;
65 } 66 }
66 } 67 }
67 68
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 total_memory_usage(0), 216 total_memory_usage(0),
216 total_layers(0), 217 total_layers(0),
217 total_picture_layers(0), 218 total_picture_layers(0),
218 total_picture_layers_with_no_content(0), 219 total_picture_layers_with_no_content(0),
219 total_picture_layers_off_screen(0) { 220 total_picture_layers_off_screen(0) {
220 } 221 }
221 222
222 RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {} 223 RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {}
223 224
224 } // namespace cc 225 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698