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

Side by Side Diff: bench/MatrixBench.cpp

Issue 2234843002: Revert of Change mapRectScaleTranslate to pass args/ret by value (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | include/core/SkMatrix.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 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "Benchmark.h" 7 #include "Benchmark.h"
8 #include "SkMatrix.h" 8 #include "SkMatrix.h"
9 #include "SkMatrixUtils.h" 9 #include "SkMatrixUtils.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 fM.setScale(2, 3); 313 fM.setScale(2, 3);
314 fM.postTranslate(1, 2); 314 fM.postTranslate(1, 2);
315 315
316 fR.set(10, 10, 100, 200); 316 fR.set(10, 10, 100, 200);
317 } 317 }
318 318
319 void performTest() override { 319 void performTest() override {
320 SkRect dst; 320 SkRect dst;
321 if (fScaleTrans) { 321 if (fScaleTrans) {
322 for (int i = 0; i < MEGA_LOOP; ++i) { 322 for (int i = 0; i < MEGA_LOOP; ++i) {
323 dst = fM.mapRectScaleTranslate(fR); 323 fM.mapRectScaleTranslate(&dst, fR);
324 } 324 }
325 } else { 325 } else {
326 for (int i = 0; i < MEGA_LOOP; ++i) { 326 for (int i = 0; i < MEGA_LOOP; ++i) {
327 fM.mapRect(&dst, fR); 327 fM.mapRect(&dst, fR);
328 } 328 }
329 } 329 }
330 } 330 }
331 }; 331 };
332 DEF_BENCH( return new MapRectMatrixBench("maprect", false); ) 332 DEF_BENCH( return new MapRectMatrixBench("maprect", false); )
333 DEF_BENCH( return new MapRectMatrixBench("maprectscaletrans", true); ) 333 DEF_BENCH( return new MapRectMatrixBench("maprectscaletrans", true); )
OLDNEW
« no previous file with comments | « no previous file | include/core/SkMatrix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698