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

Side by Side Diff: samplecode/SampleEmboss.cpp

Issue 23701006: Push sigma-based blur interface into our GMs/benches/tests/samplecode (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: cleaned up Created 7 years, 3 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/SampleEffects.cpp ('k') | samplecode/SampleFuzz.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 "SkView.h" 10 #include "SkView.h"
10 #include "SkCanvas.h" 11 #include "SkCanvas.h"
11 #include "Sk64.h" 12 #include "Sk64.h"
12 #include "SkColorShader.h" 13 #include "SkColorShader.h"
13 #include "SkEmbossMaskFilter.h" 14 #include "SkEmbossMaskFilter.h"
14 #include "SkGradientShader.h" 15 #include "SkGradientShader.h"
15 #include "SkGraphics.h" 16 #include "SkGraphics.h"
16 #include "SkImageDecoder.h" 17 #include "SkImageDecoder.h"
17 #include "SkKernel33MaskFilter.h" 18 #include "SkKernel33MaskFilter.h"
18 #include "SkPath.h" 19 #include "SkPath.h"
(...skipping 27 matching lines...) Expand all
46 } 47 }
47 return this->INHERITED::onQuery(evt); 48 return this->INHERITED::onQuery(evt);
48 } 49 }
49 50
50 virtual void onDrawContent(SkCanvas* canvas) { 51 virtual void onDrawContent(SkCanvas* canvas) {
51 SkPaint paint; 52 SkPaint paint;
52 53
53 paint.setAntiAlias(true); 54 paint.setAntiAlias(true);
54 paint.setStyle(SkPaint::kStroke_Style); 55 paint.setStyle(SkPaint::kStroke_Style);
55 paint.setStrokeWidth(SkIntToScalar(10)); 56 paint.setStrokeWidth(SkIntToScalar(10));
56 paint.setMaskFilter(new SkEmbossMaskFilter(fLight, SkIntToScalar(4)))->u nref(); 57 paint.setMaskFilter(new SkEmbossMaskFilter(
58 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(4)), fLight))->unref( );
57 paint.setShader(new SkColorShader(SK_ColorBLUE))->unref(); 59 paint.setShader(new SkColorShader(SK_ColorBLUE))->unref();
58 paint.setDither(true); 60 paint.setDither(true);
59 61
60 canvas->drawCircle(SkIntToScalar(50), SkIntToScalar(50), 62 canvas->drawCircle(SkIntToScalar(50), SkIntToScalar(50),
61 SkIntToScalar(30), paint); 63 SkIntToScalar(30), paint);
62 } 64 }
63 65
64 private: 66 private:
65 67
66 typedef SampleView INHERITED; 68 typedef SampleView INHERITED;
67 }; 69 };
68 70
69 ////////////////////////////////////////////////////////////////////////////// 71 //////////////////////////////////////////////////////////////////////////////
70 72
71 static SkView* MyFactory() { return new EmbossView; } 73 static SkView* MyFactory() { return new EmbossView; }
72 static SkViewRegister reg(MyFactory); 74 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleEffects.cpp ('k') | samplecode/SampleFuzz.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698