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

Side by Side Diff: samplecode/SampleTextAlpha.cpp

Issue 253833002: move common blur types into central header (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 years, 7 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/SampleStrokePath.cpp ('k') | samplecode/SampleTextureDomain.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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 virtual void onDrawContent(SkCanvas* canvas) { 63 virtual void onDrawContent(SkCanvas* canvas) {
64 const char* str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 64 const char* str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
65 SkPaint paint; 65 SkPaint paint;
66 SkScalar x = SkIntToScalar(10); 66 SkScalar x = SkIntToScalar(10);
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(kNormal_SkBlurStyle,
74 SkBlurMask::ConvertRadiusToSigma(SkIntToScal ar(3)))); 74 SkBlurMask::ConvertRadiusToSigma(SkIntToScal ar(3))));
75 paint.getMaskFilter()->unref(); 75 paint.getMaskFilter()->unref();
76 76
77 SkRandom 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);
(...skipping 30 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/SampleStrokePath.cpp ('k') | samplecode/SampleTextureDomain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698