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

Side by Side Diff: samplecode/SamplePicture.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/SamplePathEffects.cpp ('k') | samplecode/SamplePoints.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 "SkDumpCanvas.h" 9 #include "SkDumpCanvas.h"
10 #include "SkView.h" 10 #include "SkView.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 #ifdef SK_DEVELOPER 158 #ifdef SK_DEVELOPER
159 if (false) { 159 if (false) {
160 SkDebugfDumper dumper; 160 SkDebugfDumper dumper;
161 SkDumpCanvas dumpCanvas(&dumper); 161 SkDumpCanvas dumpCanvas(&dumper);
162 dumpCanvas.drawPicture(*pict); 162 dumpCanvas.drawPicture(*pict);
163 } 163 }
164 #endif 164 #endif
165 165
166 // test that we can re-record a subpicture, and see the results 166 // test that we can re-record a subpicture, and see the results
167 167
168 SkMWCRandom rand(SampleCode::GetAnimTime()); 168 SkRandom rand(SampleCode::GetAnimTime());
169 canvas->translate(SkIntToScalar(10), SkIntToScalar(250)); 169 canvas->translate(SkIntToScalar(10), SkIntToScalar(250));
170 drawCircle(fSubPicture->beginRecording(50, 50), 25, 170 drawCircle(fSubPicture->beginRecording(50, 50), 25,
171 rand.nextU() | 0xFF000000); 171 rand.nextU() | 0xFF000000);
172 canvas->drawPicture(*fPicture); 172 canvas->drawPicture(*fPicture);
173 delayInval(500); 173 delayInval(500);
174 } 174 }
175 175
176 private: 176 private:
177 #define INVAL_ALL_TYPE "inval-all" 177 #define INVAL_ALL_TYPE "inval-all"
178 178
(...skipping 12 matching lines...) Expand all
191 SkPicture* fPicture; 191 SkPicture* fPicture;
192 SkPicture* fSubPicture; 192 SkPicture* fSubPicture;
193 193
194 typedef SampleView INHERITED; 194 typedef SampleView INHERITED;
195 }; 195 };
196 196
197 ////////////////////////////////////////////////////////////////////////////// 197 //////////////////////////////////////////////////////////////////////////////
198 198
199 static SkView* MyFactory() { return new PictureView; } 199 static SkView* MyFactory() { return new PictureView; }
200 static SkViewRegister reg(MyFactory); 200 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SamplePathEffects.cpp ('k') | samplecode/SamplePoints.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698