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

Side by Side Diff: samplecode/SampleBigBlur.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/SampleAnimBlur.cpp ('k') | samplecode/SampleBlur.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 13 matching lines...) Expand all
24 return true; 24 return true;
25 } 25 }
26 return this->INHERITED::onQuery(evt); 26 return this->INHERITED::onQuery(evt);
27 } 27 }
28 28
29 virtual void onDrawContent(SkCanvas* canvas) { 29 virtual void onDrawContent(SkCanvas* canvas) {
30 SkPaint paint; 30 SkPaint paint;
31 canvas->save(); 31 canvas->save();
32 paint.setColor(SK_ColorBLUE); 32 paint.setColor(SK_ColorBLUE);
33 SkMaskFilter* mf = SkBlurMaskFilter::Create( 33 SkMaskFilter* mf = SkBlurMaskFilter::Create(
34 SkBlurMaskFilter::kNormal_BlurStyle, 34 kNormal_SkBlurStyle,
35 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(128)), 35 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(128)),
36 SkBlurMaskFilter::kHighQuality_BlurFlag); 36 SkBlurMaskFilter::kHighQuality_BlurFlag);
37 paint.setMaskFilter(mf)->unref(); 37 paint.setMaskFilter(mf)->unref();
38 canvas->translate(200, 200); 38 canvas->translate(200, 200);
39 canvas->drawCircle(100, 100, 200, paint); 39 canvas->drawCircle(100, 100, 200, paint);
40 canvas->restore(); 40 canvas->restore();
41 } 41 }
42 42
43 private: 43 private:
44 typedef SkView INHERITED; 44 typedef SkView INHERITED;
45 }; 45 };
46 46
47 ////////////////////////////////////////////////////////////////////////////// 47 //////////////////////////////////////////////////////////////////////////////
48 48
49 static SkView* MyFactory() { return new BigBlurView; } 49 static SkView* MyFactory() { return new BigBlurView; }
50 static SkViewRegister reg(MyFactory); 50 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleAnimBlur.cpp ('k') | samplecode/SampleBlur.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698