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

Side by Side Diff: samplecode/SampleSlides.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/SampleRotateCircles.cpp ('k') | samplecode/SampleStrokePath.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 "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 int fCount; 343 int fCount;
344 SkPoint* fVerts; 344 SkPoint* fVerts;
345 SkPoint* fTexs; 345 SkPoint* fTexs;
346 346
347 Rec() : fCount(0), fVerts(NULL), fTexs(NULL) {} 347 Rec() : fCount(0), fVerts(NULL), fTexs(NULL) {}
348 ~Rec() { delete[] fVerts; delete[] fTexs; } 348 ~Rec() { delete[] fVerts; delete[] fTexs; }
349 }; 349 };
350 350
351 static void make_tris(Rec* rec) { 351 static void make_tris(Rec* rec) {
352 int n = 10; 352 int n = 10;
353 SkMWCRandom rand; 353 SkRandom rand;
354 354
355 rec->fMode = SkCanvas::kTriangles_VertexMode; 355 rec->fMode = SkCanvas::kTriangles_VertexMode;
356 rec->fCount = n * 3; 356 rec->fCount = n * 3;
357 rec->fVerts = new SkPoint[rec->fCount]; 357 rec->fVerts = new SkPoint[rec->fCount];
358 358
359 for (int i = 0; i < n; i++) { 359 for (int i = 0; i < n; i++) {
360 SkPoint* v = &rec->fVerts[i*3]; 360 SkPoint* v = &rec->fVerts[i*3];
361 for (int j = 0; j < 3; j++) { 361 for (int j = 0; j < 3; j++) {
362 v[j].set(rand.nextUScalar1() * 250, rand.nextUScalar1() * 250); 362 v[j].set(rand.nextUScalar1() * 250, rand.nextUScalar1() * 250);
363 } 363 }
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 } 725 }
726 726
727 private: 727 private:
728 typedef SampleView INHERITED; 728 typedef SampleView INHERITED;
729 }; 729 };
730 730
731 ////////////////////////////////////////////////////////////////////////////// 731 //////////////////////////////////////////////////////////////////////////////
732 732
733 static SkView* MyFactory() { return new SlideView; } 733 static SkView* MyFactory() { return new SlideView; }
734 static SkViewRegister reg(MyFactory); 734 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleRotateCircles.cpp ('k') | samplecode/SampleStrokePath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698