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

Side by Side Diff: bench/PathUtilsBench.cpp

Issue 23576015: Change old PRG to be SkLCGRandom; change new one to SkRandom (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix some spurious SkMWCRandoms 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/PathIterBench.cpp ('k') | bench/PictureRecordBench.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 * 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 "SkBenchmark.h" 7 #include "SkBenchmark.h"
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkPathUtils.h" 9 #include "SkPathUtils.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
11 #include "SkTime.h" 11 #include "SkTime.h"
12 #include "SkString.h" 12 #include "SkString.h"
13 13
14 #define H 16 14 #define H 16
15 #define W 16 15 #define W 16
16 #define STRIDE 2 16 #define STRIDE 2
17 17
18 //this function is redefined for sample, test, and bench. is there anywhere 18 //this function is redefined for sample, test, and bench. is there anywhere
19 // I can put it to avoid code duplcation? 19 // I can put it to avoid code duplcation?
20 static void fillRandomBits( int chars, char* bits ){ 20 static void fillRandomBits( int chars, char* bits ){
21 SkMWCRandom rand(SkTime::GetMSecs()); 21 SkRandom rand(SkTime::GetMSecs());
22 22
23 for (int i = 0; i < chars; ++i){ 23 for (int i = 0; i < chars; ++i){
24 bits[i] = rand.nextU(); 24 bits[i] = rand.nextU();
25 } 25 }
26 } 26 }
27 27
28 static void path_proc(char* bits, SkPath* path) { 28 static void path_proc(char* bits, SkPath* path) {
29 SkPathUtils::BitsToPath_Path(path, bits, H, W, STRIDE); 29 SkPathUtils::BitsToPath_Path(path, bits, H, W, STRIDE);
30 } 30 }
31 31
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 private: 69 private:
70 typedef SkBenchmark INHERITED; 70 typedef SkBenchmark INHERITED;
71 }; 71 };
72 72
73 static SkBenchmark* PU_path(void* p) { return SkNEW_ARGS(PathUtilsBench, (p, pat h_proc, "path")); } 73 static SkBenchmark* PU_path(void* p) { return SkNEW_ARGS(PathUtilsBench, (p, pat h_proc, "path")); }
74 static SkBenchmark* PU_region(void* p) { return SkNEW_ARGS(PathUtilsBench, (p, r egion_proc, "region")); } 74 static SkBenchmark* PU_region(void* p) { return SkNEW_ARGS(PathUtilsBench, (p, r egion_proc, "region")); }
75 75
76 static BenchRegistry PU_Path(PU_path); 76 static BenchRegistry PU_Path(PU_path);
77 static BenchRegistry PU_Region(PU_region); 77 static BenchRegistry PU_Region(PU_region);
OLDNEW
« no previous file with comments | « bench/PathIterBench.cpp ('k') | bench/PictureRecordBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698