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

Side by Side Diff: samplecode/SampleTextAlpha.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/SampleText.cpp ('k') | samplecode/SampleVertices.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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 SkScalar y = SkIntToScalar(20); 67 SkScalar y = SkIntToScalar(20);
68 68
69 paint.setFlags(0x105); 69 paint.setFlags(0x105);
70 70
71 paint.setARGB(fByte, 0xFF, 0xFF, 0xFF); 71 paint.setARGB(fByte, 0xFF, 0xFF, 0xFF);
72 72
73 paint.setMaskFilter(SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_B lurStyle, 73 paint.setMaskFilter(SkBlurMaskFilter::Create(SkBlurMaskFilter::kNormal_B lurStyle,
74 SkBlurMask::ConvertRadiusToSigma(SkIntToScal ar(3)))); 74 SkBlurMask::ConvertRadiusToSigma(SkIntToScal ar(3))));
75 paint.getMaskFilter()->unref(); 75 paint.getMaskFilter()->unref();
76 76
77 SkMWCRandom rand; 77 SkRandom rand;
78 78
79 for (int ps = 6; ps <= 35; ps++) { 79 for (int ps = 6; ps <= 35; ps++) {
80 paint.setColor(rand.nextU() | (0xFF << 24)); 80 paint.setColor(rand.nextU() | (0xFF << 24));
81 paint.setTextSize(SkIntToScalar(ps)); 81 paint.setTextSize(SkIntToScalar(ps));
82 paint.setTextSize(SkIntToScalar(24)); 82 paint.setTextSize(SkIntToScalar(24));
83 canvas->drawText(str, strlen(str), x, y, paint); 83 canvas->drawText(str, strlen(str), x, y, paint);
84 y += paint.getFontMetrics(NULL); 84 y += paint.getFontMetrics(NULL);
85 } 85 }
86 if (false) { // avoid bit rot, suppress warning 86 if (false) { // avoid bit rot, suppress warning
87 check_for_nonwhite(canvas->getDevice()->accessBitmap(false), fByte); 87 check_for_nonwhite(canvas->getDevice()->accessBitmap(false), fByte);
(...skipping 26 matching lines...) Expand all
114 private: 114 private:
115 int fByte; 115 int fByte;
116 116
117 typedef SampleView INHERITED; 117 typedef SampleView INHERITED;
118 }; 118 };
119 119
120 ////////////////////////////////////////////////////////////////////////////// 120 //////////////////////////////////////////////////////////////////////////////
121 121
122 static SkView* MyFactory() { return new TextAlphaView; } 122 static SkView* MyFactory() { return new TextAlphaView; }
123 static SkViewRegister reg(MyFactory); 123 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleText.cpp ('k') | samplecode/SampleVertices.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698