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

Side by Side Diff: samplecode/SampleHairCurves.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 | « samplecode/SampleFontCache.cpp ('k') | samplecode/SampleManyRects.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 2011 Google Inc. 3 * Copyright 2011 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 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 16 matching lines...) Expand all
27 } 27 }
28 28
29 29
30 virtual void onDrawContent(SkCanvas* canvas) { 30 virtual void onDrawContent(SkCanvas* canvas) {
31 SkPaint paint; 31 SkPaint paint;
32 paint.setAntiAlias(true); 32 paint.setAntiAlias(true);
33 paint.setStyle(SkPaint::kStroke_Style); 33 paint.setStyle(SkPaint::kStroke_Style);
34 paint.setStrokeWidth(0); 34 paint.setStrokeWidth(0);
35 canvas->save(); 35 canvas->save();
36 canvas->scale(1000 * SK_Scalar1, 1000 * SK_Scalar1); 36 canvas->scale(1000 * SK_Scalar1, 1000 * SK_Scalar1);
37 SkMWCRandom rand; 37 SkRandom rand;
38 SkMWCRandom randW; 38 SkRandom randW;
39 SkPath curves; 39 SkPath curves;
40 SkPath hulls; 40 SkPath hulls;
41 SkPath ctrlPts; 41 SkPath ctrlPts;
42 for (int i = 0; i < 100; ++i) { 42 for (int i = 0; i < 100; ++i) {
43 SkScalar pts[] = { 43 SkScalar pts[] = {
44 rand.nextUScalar1(), rand.nextUScalar1(), 44 rand.nextUScalar1(), rand.nextUScalar1(),
45 rand.nextUScalar1(), rand.nextUScalar1(), 45 rand.nextUScalar1(), rand.nextUScalar1(),
46 rand.nextUScalar1(), rand.nextUScalar1(), 46 rand.nextUScalar1(), rand.nextUScalar1(),
47 rand.nextUScalar1(), rand.nextUScalar1() 47 rand.nextUScalar1(), rand.nextUScalar1()
48 }; 48 };
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } 124 }
125 125
126 private: 126 private:
127 typedef SampleView INHERITED; 127 typedef SampleView INHERITED;
128 }; 128 };
129 129
130 ////////////////////////////////////////////////////////////////////////////// 130 //////////////////////////////////////////////////////////////////////////////
131 131
132 static SkView* MyFactory() { return new HairCurvesView; } 132 static SkView* MyFactory() { return new HairCurvesView; }
133 static SkViewRegister reg(MyFactory); 133 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleFontCache.cpp ('k') | samplecode/SampleManyRects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698