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

Side by Side Diff: samplecode/SampleStrokePath.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/SampleSlides.cpp ('k') | samplecode/SampleTextAlpha.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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 SkPaint paint; 153 SkPaint paint;
154 paint.setAntiAlias(true); 154 paint.setAntiAlias(true);
155 155
156 if (true) { 156 if (true) {
157 canvas->drawColor(SK_ColorBLACK); 157 canvas->drawColor(SK_ColorBLACK);
158 158
159 paint.setTextSize(24); 159 paint.setTextSize(24);
160 paint.setColor(SK_ColorWHITE); 160 paint.setColor(SK_ColorWHITE);
161 canvas->translate(10, 30); 161 canvas->translate(10, 30);
162 162
163 static const SkBlurMaskFilter::BlurStyle gStyle[] = { 163 static const SkBlurStyle gStyle[] = {
164 SkBlurMaskFilter::kNormal_BlurStyle, 164 kNormal_SkBlurStyle,
165 SkBlurMaskFilter::kInner_BlurStyle, 165 kInner_SkBlurStyle,
166 SkBlurMaskFilter::kOuter_BlurStyle, 166 kOuter_SkBlurStyle,
167 SkBlurMaskFilter::kSolid_BlurStyle, 167 kSolid_SkBlurStyle,
168 }; 168 };
169 for (int x = 0; x < 5; x++) { 169 for (int x = 0; x < 5; x++) {
170 SkMaskFilter* mf; 170 SkMaskFilter* mf;
171 SkScalar sigma = SkBlurMask::ConvertRadiusToSigma(SkIntToScalar( 4)); 171 SkScalar sigma = SkBlurMask::ConvertRadiusToSigma(SkIntToScalar( 4));
172 for (int y = 0; y < 10; y++) { 172 for (int y = 0; y < 10; y++) {
173 if (x) { 173 if (x) {
174 mf = SkBlurMaskFilter::Create(gStyle[x - 1], sigma); 174 mf = SkBlurMaskFilter::Create(gStyle[x - 1], sigma);
175 paint.setMaskFilter(mf)->unref(); 175 paint.setMaskFilter(mf)->unref();
176 } 176 }
177 canvas->drawText("Title Bar", 9, x*SkIntToScalar(100), y*SkI ntToScalar(30), paint); 177 canvas->drawText("Title Bar", 9, x*SkIntToScalar(100), y*SkI ntToScalar(30), paint);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 return this->INHERITED::onFindClickHandler(x, y, modi); 215 return this->INHERITED::onFindClickHandler(x, y, modi);
216 } 216 }
217 private: 217 private:
218 typedef SampleView INHERITED; 218 typedef SampleView INHERITED;
219 }; 219 };
220 220
221 ////////////////////////////////////////////////////////////////////////////// 221 //////////////////////////////////////////////////////////////////////////////
222 222
223 static SkView* MyFactory() { return new StrokePathView; } 223 static SkView* MyFactory() { return new StrokePathView; }
224 static SkViewRegister reg(MyFactory); 224 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleSlides.cpp ('k') | samplecode/SampleTextAlpha.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698