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

Side by Side Diff: samplecode/SampleEmptyPath.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/SampleCull.cpp ('k') | samplecode/SampleFontCache.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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 titlePaint.setColor(SK_ColorBLACK); 66 titlePaint.setColor(SK_ColorBLACK);
67 titlePaint.setAntiAlias(true); 67 titlePaint.setAntiAlias(true);
68 titlePaint.setLCDRenderText(true); 68 titlePaint.setLCDRenderText(true);
69 titlePaint.setTextSize(24 * SK_Scalar1); 69 titlePaint.setTextSize(24 * SK_Scalar1);
70 const char title[] = "Empty Paths Drawn Into Rectangle Clips With Indica ted Style and Fill"; 70 const char title[] = "Empty Paths Drawn Into Rectangle Clips With Indica ted Style and Fill";
71 canvas->drawText(title, strlen(title), 71 canvas->drawText(title, strlen(title),
72 40 * SK_Scalar1, 72 40 * SK_Scalar1,
73 100*SK_Scalar1, 73 100*SK_Scalar1,
74 titlePaint); 74 titlePaint);
75 75
76 SkMWCRandom rand; 76 SkRandom rand;
77 SkRect rect = SkRect::MakeWH(125*SK_Scalar1, 100*SK_Scalar1); 77 SkRect rect = SkRect::MakeWH(125*SK_Scalar1, 100*SK_Scalar1);
78 int i = 0; 78 int i = 0;
79 canvas->save(); 79 canvas->save();
80 canvas->translate(80 * SK_Scalar1, 0); 80 canvas->translate(80 * SK_Scalar1, 0);
81 canvas->save(); 81 canvas->save();
82 for (size_t style = 0; style < SK_ARRAY_COUNT(gStyles); ++style) { 82 for (size_t style = 0; style < SK_ARRAY_COUNT(gStyles); ++style) {
83 for (size_t fill = 0; fill < SK_ARRAY_COUNT(gFills); ++fill) { 83 for (size_t fill = 0; fill < SK_ARRAY_COUNT(gFills); ++fill) {
84 if (0 == i % 4) { 84 if (0 == i % 4) {
85 canvas->restore(); 85 canvas->restore();
86 canvas->translate(0, rect.height() + 50 * SK_Scalar1); 86 canvas->translate(0, rect.height() + 50 * SK_Scalar1);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 120 }
121 121
122 private: 122 private:
123 typedef SampleView INHERITED; 123 typedef SampleView INHERITED;
124 }; 124 };
125 125
126 ////////////////////////////////////////////////////////////////////////////// 126 //////////////////////////////////////////////////////////////////////////////
127 127
128 static SkView* MyFactory() { return new EmptyPathView; } 128 static SkView* MyFactory() { return new EmptyPathView; }
129 static SkViewRegister reg(MyFactory); 129 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleCull.cpp ('k') | samplecode/SampleFontCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698