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

Side by Side Diff: gm/hittestpath.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 | « gm/getpostextpath.cpp ('k') | gm/linepaths.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 7
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCullPoints.h" 10 #include "SkCullPoints.h"
(...skipping 24 matching lines...) Expand all
35 35
36 protected: 36 protected:
37 virtual SkString onShortName() { 37 virtual SkString onShortName() {
38 return SkString("hittestpath"); 38 return SkString("hittestpath");
39 } 39 }
40 40
41 virtual SkISize onISize() { return SkISize::Make(700, 460); } 41 virtual SkISize onISize() { return SkISize::Make(700, 460); }
42 42
43 virtual void onDraw(SkCanvas* canvas) { 43 virtual void onDraw(SkCanvas* canvas) {
44 SkPath path; 44 SkPath path;
45 SkRandom rand; 45 SkLCGRandom rand;
46 46
47 int scale = 300; 47 int scale = 300;
48 for (int i = 0; i < 4; ++i) { 48 for (int i = 0; i < 4; ++i) {
49 path.lineTo(rand.nextUScalar1() * scale, rand.nextUScalar1() * scale ); 49 path.lineTo(rand.nextUScalar1() * scale, rand.nextUScalar1() * scale );
50 path.quadTo(rand.nextUScalar1() * scale, rand.nextUScalar1() * scale , 50 path.quadTo(rand.nextUScalar1() * scale, rand.nextUScalar1() * scale ,
51 rand.nextUScalar1() * scale, rand.nextUScalar1() * scale ); 51 rand.nextUScalar1() * scale, rand.nextUScalar1() * scale );
52 path.cubicTo(rand.nextUScalar1() * scale, rand.nextUScalar1() * scal e, 52 path.cubicTo(rand.nextUScalar1() * scale, rand.nextUScalar1() * scal e,
53 rand.nextUScalar1() * scale, rand.nextUScalar1() * scal e, 53 rand.nextUScalar1() * scale, rand.nextUScalar1() * scal e,
54 rand.nextUScalar1() * scale, rand.nextUScalar1() * scal e); 54 rand.nextUScalar1() * scale, rand.nextUScalar1() * scal e);
55 } 55 }
(...skipping 10 matching lines...) Expand all
66 } 66 }
67 67
68 private: 68 private:
69 typedef GM INHERITED; 69 typedef GM INHERITED;
70 }; 70 };
71 71
72 ////////////////////////////////////////////////////////////////////////////// 72 //////////////////////////////////////////////////////////////////////////////
73 73
74 static skiagm::GM* MyFactory(void*) { return new HitTestPathGM; } 74 static skiagm::GM* MyFactory(void*) { return new HitTestPathGM; }
75 static skiagm::GMRegistry reg(MyFactory); 75 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/getpostextpath.cpp ('k') | gm/linepaths.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698