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

Side by Side Diff: bench/ReadPixBench.cpp

Issue 23478013: Major bench refactoring. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: merge with head agani Created 7 years, 3 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 | « bench/RTreeBench.cpp ('k') | bench/RectBench.cpp » ('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 /* 2 /*
3 * Copyright 2012 The Android Open Source Project 3 * Copyright 2012 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkBenchmark.h" 9 #include "SkBenchmark.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 27 matching lines...) Expand all
38 38
39 canvas->drawCircle(SkIntToScalar(size.width()/2), 39 canvas->drawCircle(SkIntToScalar(size.width()/2),
40 SkIntToScalar(size.height()/2), 40 SkIntToScalar(size.height()/2),
41 SkIntToScalar(size.width()/2), 41 SkIntToScalar(size.width()/2),
42 paint); 42 paint);
43 43
44 SkBitmap bitmap; 44 SkBitmap bitmap;
45 45
46 bitmap.setConfig(SkBitmap::kARGB_8888_Config, kWindowSize, kWindowSize); 46 bitmap.setConfig(SkBitmap::kARGB_8888_Config, kWindowSize, kWindowSize);
47 47
48 for (int x = 0; x < kNumStepsX; ++x) { 48 for (int i = 0; i < this->getLoops(); i++) {
49 for (int y = 0; y < kNumStepsY; ++y) { 49 for (int x = 0; x < kNumStepsX; ++x) {
50 canvas->readPixels(&bitmap, x * offX, y * offY); 50 for (int y = 0; y < kNumStepsY; ++y) {
51 canvas->readPixels(&bitmap, x * offX, y * offY);
52 }
51 } 53 }
52 } 54 }
53 } 55 }
54 56
55 private: 57 private:
56 static const int kNumStepsX = 30; 58 static const int kNumStepsX = 30;
57 static const int kNumStepsY = 30; 59 static const int kNumStepsY = 30;
58 static const int kWindowSize = 5; 60 static const int kWindowSize = 5;
59 61
60 typedef SkBenchmark INHERITED; 62 typedef SkBenchmark INHERITED;
61 }; 63 };
62 64
63 //////////////////////////////////////////////////////////////////////////////// 65 ////////////////////////////////////////////////////////////////////////////////
64 66
65 static SkBenchmark* fact(void* p) { return new ReadPixBench(p); } 67 static SkBenchmark* fact(void* p) { return new ReadPixBench(p); }
66 static BenchRegistry gReg(fact); 68 static BenchRegistry gReg(fact);
OLDNEW
« no previous file with comments | « bench/RTreeBench.cpp ('k') | bench/RectBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698