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

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

Issue 903273002: Update from https://crrev.com/315085 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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/debug/frame_timing_request.h ('k') | cc/debug/rasterize_and_record_benchmark.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 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/picture_record_benchmark.h" 5 #include "cc/debug/picture_record_benchmark.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 int height = dimensions.second; 99 int height = dimensions.second;
100 100
101 int y_limit = std::max(1, content_bounds.height() - height); 101 int y_limit = std::max(1, content_bounds.height() - height);
102 int x_limit = std::max(1, content_bounds.width() - width); 102 int x_limit = std::max(1, content_bounds.width() - width);
103 for (int y = 0; y < y_limit; y += kPositionIncrement) { 103 for (int y = 0; y < y_limit; y += kPositionIncrement) {
104 for (int x = 0; x < x_limit; x += kPositionIncrement) { 104 for (int x = 0; x < x_limit; x += kPositionIncrement) {
105 gfx::Rect rect = gfx::Rect(x, y, width, height); 105 gfx::Rect rect = gfx::Rect(x, y, width, height);
106 106
107 base::TimeTicks start = base::TimeTicks::Now(); 107 base::TimeTicks start = base::TimeTicks::Now();
108 108
109 scoped_refptr<Picture> picture = Picture::Create( 109 scoped_refptr<Picture> picture =
110 rect, painter, tile_grid_size, false, Picture::RECORD_NORMALLY); 110 Picture::Create(rect, painter, tile_grid_size, false,
111 RecordingSource::RECORD_NORMALLY);
111 112
112 base::TimeTicks end = base::TimeTicks::Now(); 113 base::TimeTicks end = base::TimeTicks::Now();
113 base::TimeDelta duration = end - start; 114 base::TimeDelta duration = end - start;
114 TotalTime& total_time = times_[dimensions]; 115 TotalTime& total_time = times_[dimensions];
115 total_time.first += duration; 116 total_time.first += duration;
116 total_time.second++; 117 total_time.second++;
117 } 118 }
118 } 119 }
119 } 120 }
120 } 121 }
121 122
122 } // namespace cc 123 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug/frame_timing_request.h ('k') | cc/debug/rasterize_and_record_benchmark.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698