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

Side by Side Diff: samplecode/SampleBigBlur.cpp

Issue 1852113003: switch maskfilters to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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
« 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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "SampleCode.h" 7 #include "SampleCode.h"
8 #include "SkBlurMask.h" 8 #include "SkBlurMask.h"
9 #include "SkBlurMaskFilter.h" 9 #include "SkBlurMaskFilter.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 11 matching lines...) Expand all
22 SampleCode::TitleR(evt, "BigBlur"); 22 SampleCode::TitleR(evt, "BigBlur");
23 return true; 23 return true;
24 } 24 }
25 return this->INHERITED::onQuery(evt); 25 return this->INHERITED::onQuery(evt);
26 } 26 }
27 27
28 virtual void onDrawContent(SkCanvas* canvas) { 28 virtual void onDrawContent(SkCanvas* canvas) {
29 SkPaint paint; 29 SkPaint paint;
30 canvas->save(); 30 canvas->save();
31 paint.setColor(SK_ColorBLUE); 31 paint.setColor(SK_ColorBLUE);
32 SkMaskFilter* mf = SkBlurMaskFilter::Create( 32 paint.setMaskFilter(SkBlurMaskFilter::Make(
33 kNormal_SkBlurStyle, 33 kNormal_SkBlurStyle,
34 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(128)), 34 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(128)),
35 SkBlurMaskFilter::kHighQuality_BlurFlag); 35 SkBlurMaskFilter::kHighQuality_BlurFlag));
36 paint.setMaskFilter(mf)->unref();
37 canvas->translate(200, 200); 36 canvas->translate(200, 200);
38 canvas->drawCircle(100, 100, 200, paint); 37 canvas->drawCircle(100, 100, 200, paint);
39 canvas->restore(); 38 canvas->restore();
40 } 39 }
41 40
42 private: 41 private:
43 typedef SkView INHERITED; 42 typedef SkView INHERITED;
44 }; 43 };
45 44
46 ////////////////////////////////////////////////////////////////////////////// 45 //////////////////////////////////////////////////////////////////////////////
47 46
48 static SkView* MyFactory() { return new BigBlurView; } 47 static SkView* MyFactory() { return new BigBlurView; }
49 static SkViewRegister reg(MyFactory); 48 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