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

Side by Side Diff: src/utils/SkPathUtils.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 | « src/gpu/gl/GrGLProgramDesc.h ('k') | tests/AAClipTest.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 * CAUTION: EXPERIMENTAL CODE 2 * CAUTION: EXPERIMENTAL CODE
3 * 3 *
4 * This code is not to be used and will not be supported 4 * This code is not to be used and will not be supported
5 * if it fails on you. DO NOT USE! 5 * if it fails on you. DO NOT USE!
6 * 6 *
7 */ 7 */
8 8
9 #include "SkPathUtils.h" 9 #include "SkPathUtils.h"
10 10
11 #include "SkPath.h" 11 #include "SkPath.h"
12 #include "SkPathOps.h" // this can't be found, how do I link it? 12 #include "SkPathOps.h" // this can't be found, how do I link it?
13 #include "SkRegion.h" 13 #include "SkRegion.h"
14 14
15 typedef void (*line2path)(SkPath*, const char*, int, int); 15 typedef void (*line2path)(SkPath*, const char*, int, int);
16 #define SQRT_2 1.41421356237f 16 #define SQRT_2 1.41421356237f
17 #define ON 0xFF000000 // black pixel 17 #define ON 0xFF000000 // black pixel
18 #define OFF 0x00000000 // transparent pixel 18 #define OFF 0x00000000 // transparent pixel
19 19
20 // assumes stride is in bytes 20 // assumes stride is in bytes
21 /* 21 /*
22 static void FillRandomBits( int chars, char* bits ){ 22 static void FillRandomBits( int chars, char* bits ){
23 SkTime time; 23 SkTime time;
24 SkMWCRandom rand = SkMWCRandom( time.GetMSecs() ); 24 SkRandom rand = SkRandom( time.GetMSecs() );
25 25
26 for (int i = 0; i < chars; ++i){ 26 for (int i = 0; i < chars; ++i){
27 bits[i] = rand.nextU(); 27 bits[i] = rand.nextU();
28 } 28 }
29 }OA 29 }OA
30 */ 30 */
31 31
32 static int GetBit( const char* buffer, int x ) { 32 static int GetBit( const char* buffer, int x ) {
33 int byte = x >> 3; 33 int byte = x >> 3;
34 int bit = x & 7; 34 int bit = x & 7;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 143
144 } else if ( GetBit(line,w-1) ) { // if last pixel on add rect 144 } else if ( GetBit(line,w-1) ) { // if last pixel on add rect
145 // add the thing here 145 // add the thing here
146 region.op(SkIRect::MakeXYWH(w-1, y, 1, 1), 146 region.op(SkIRect::MakeXYWH(w-1, y, 1, 1),
147 SkRegion::kUnion_Op ); 147 SkRegion::kUnion_Op );
148 } 148 }
149 } 149 }
150 // convert region to path 150 // convert region to path
151 region.getBoundaryPath(path); 151 region.getBoundaryPath(path);
152 } 152 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.h ('k') | tests/AAClipTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698