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

Side by Side Diff: tests/PathUtilsTest.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 | « tests/PathTest.cpp ('k') | tests/PictureTest.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 2013 Google Inc. 3 * Copyright 2013 Google Inc.
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 "SkPathUtils.h" 9 #include "SkPathUtils.h"
10 10
11 #include "SkBitmap.h" 11 #include "SkBitmap.h"
12 #include "SkCanvas.h" 12 #include "SkCanvas.h"
13 #include "SkRandom.h" 13 #include "SkRandom.h"
14 #include "SkTime.h" 14 #include "SkTime.h"
15 #include "Test.h" 15 #include "Test.h"
16 16
17 const int kNumIt = 100; 17 const int kNumIt = 100;
18 18
19 static void fill_random_bits(int chars, char* bits){ 19 static void fill_random_bits(int chars, char* bits){
20 SkMWCRandom rand(SkTime::GetMSecs()); 20 SkRandom rand(SkTime::GetMSecs());
21 21
22 for (int i = 0; i < chars; ++i){ 22 for (int i = 0; i < chars; ++i){
23 bits[i] = rand.nextU(); 23 bits[i] = rand.nextU();
24 } 24 }
25 } 25 }
26 26
27 static int get_bit(const char* buffer, int x) { 27 static int get_bit(const char* buffer, int x) {
28 int byte = x >> 3; 28 int byte = x >> 3;
29 int bit = x & 7; 29 int bit = x & 7;
30 30
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 binary_to_skbitmap(binBmp, &bmpTruth, w[i], h, rowBytes); 150 binary_to_skbitmap(binBmp, &bmpTruth, w[i], h, rowBytes);
151 151
152 test_path(reporter, &bmpTruth, binBmp, w[i], h, rowBytes); 152 test_path(reporter, &bmpTruth, binBmp, w[i], h, rowBytes);
153 test_region(reporter, &bmpTruth, binBmp, w[i], h, rowBytes); 153 test_region(reporter, &bmpTruth, binBmp, w[i], h, rowBytes);
154 } 154 }
155 } 155 }
156 } 156 }
157 157
158 #include "TestClassDef.h" 158 #include "TestClassDef.h"
159 DEFINE_TESTCLASS("PathUtils", PathUtils, TestPathUtils) 159 DEFINE_TESTCLASS("PathUtils", PathUtils, TestPathUtils)
OLDNEW
« no previous file with comments | « tests/PathTest.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698