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

Side by Side Diff: samplecode/SampleEmboss.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/SampleEffects.cpp ('k') | samplecode/SampleFilterFuzz.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 7
8 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkView.h" 10 #include "SkView.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 return this->INHERITED::onQuery(evt); 44 return this->INHERITED::onQuery(evt);
45 } 45 }
46 46
47 virtual void onDrawContent(SkCanvas* canvas) { 47 virtual void onDrawContent(SkCanvas* canvas) {
48 SkPaint paint; 48 SkPaint paint;
49 49
50 paint.setAntiAlias(true); 50 paint.setAntiAlias(true);
51 paint.setStyle(SkPaint::kStroke_Style); 51 paint.setStyle(SkPaint::kStroke_Style);
52 paint.setStrokeWidth(SkIntToScalar(10)); 52 paint.setStrokeWidth(SkIntToScalar(10));
53 paint.setMaskFilter(SkEmbossMaskFilter::Create( 53 paint.setMaskFilter(SkEmbossMaskFilter::Make(SkBlurMask::ConvertRadiusTo Sigma(4), fLight));
54 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(4)), fLight))->unref( );
55 paint.setShader(SkShader::MakeColorShader(SK_ColorBLUE)); 54 paint.setShader(SkShader::MakeColorShader(SK_ColorBLUE));
56 paint.setDither(true); 55 paint.setDither(true);
57 56
58 canvas->drawCircle(SkIntToScalar(50), SkIntToScalar(50), 57 canvas->drawCircle(SkIntToScalar(50), SkIntToScalar(50),
59 SkIntToScalar(30), paint); 58 SkIntToScalar(30), paint);
60 } 59 }
61 60
62 private: 61 private:
63 62
64 typedef SampleView INHERITED; 63 typedef SampleView INHERITED;
65 }; 64 };
66 65
67 ////////////////////////////////////////////////////////////////////////////// 66 //////////////////////////////////////////////////////////////////////////////
68 67
69 static SkView* MyFactory() { return new EmbossView; } 68 static SkView* MyFactory() { return new EmbossView; }
70 static SkViewRegister reg(MyFactory); 69 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleEffects.cpp ('k') | samplecode/SampleFilterFuzz.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698