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

Side by Side Diff: samplecode/SampleStrokePath.cpp

Issue 21835004: Blur refactoring (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: hide constant Created 7 years, 4 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
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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkParsePath.h" 10 #include "SkParsePath.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 SkBlurMaskFilter::kNormal_BlurStyle, 164 SkBlurMaskFilter::kNormal_BlurStyle,
165 SkBlurMaskFilter::kInner_BlurStyle, 165 SkBlurMaskFilter::kInner_BlurStyle,
166 SkBlurMaskFilter::kOuter_BlurStyle, 166 SkBlurMaskFilter::kOuter_BlurStyle,
167 SkBlurMaskFilter::kSolid_BlurStyle, 167 SkBlurMaskFilter::kSolid_BlurStyle,
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 radius = 4; 171 SkScalar radius = 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(radius, gStyle[x - 1]); 174 mf = SkBlurMaskFilter::Create(radius, gStyle[x - 1],
175 SkBlurMaskFilter::kNone_Bl urFlag);
175 paint.setMaskFilter(mf)->unref(); 176 paint.setMaskFilter(mf)->unref();
176 } 177 }
177 canvas->drawText("Title Bar", 9, x*SkIntToScalar(100), y*SkI ntToScalar(30), paint); 178 canvas->drawText("Title Bar", 9, x*SkIntToScalar(100), y*SkI ntToScalar(30), paint);
178 radius *= 0.75f; 179 radius *= 0.75f;
179 } 180 }
180 181
181 } 182 }
182 return; 183 return;
183 } 184 }
184 185
(...skipping 30 matching lines...) Expand all
215 return this->INHERITED::onFindClickHandler(x, y, modi); 216 return this->INHERITED::onFindClickHandler(x, y, modi);
216 } 217 }
217 private: 218 private:
218 typedef SampleView INHERITED; 219 typedef SampleView INHERITED;
219 }; 220 };
220 221
221 ////////////////////////////////////////////////////////////////////////////// 222 //////////////////////////////////////////////////////////////////////////////
222 223
223 static SkView* MyFactory() { return new StrokePathView; } 224 static SkView* MyFactory() { return new StrokePathView; }
224 static SkViewRegister reg(MyFactory); 225 static SkViewRegister reg(MyFactory);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698