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

Side by Side Diff: samplecode/SampleEffects.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 "SkPaint.h" 10 #include "SkPaint.h"
11 #include "SkView.h" 11 #include "SkView.h"
12 12
13 #include "SkBlurMaskFilter.h" 13 #include "SkBlurMaskFilter.h"
14 #include "SkColorMatrixFilter.h" 14 #include "SkColorMatrixFilter.h"
15 #include "SkDiscretePathEffect.h" 15 #include "SkDiscretePathEffect.h"
16 #include "SkGradientShader.h" 16 #include "SkGradientShader.h"
17 17
18 //#define COLOR 0xFFFF8844 18 //#define COLOR 0xFFFF8844
19 #define COLOR 0xFF888888 19 #define COLOR 0xFF888888
20 20
21 static void paint_proc0(SkPaint*) { 21 static void paint_proc0(SkPaint*) {
22 } 22 }
23 23
24 static void paint_proc1(SkPaint* paint) { 24 static void paint_proc1(SkPaint* paint) {
25 paint->setMaskFilter(SkBlurMaskFilter::Create(2, 25 paint->setMaskFilter(SkBlurMaskFilter::Create(2,
26 SkBlurMaskFilter::kNormal_BlurStyle))->unref(); 26 SkBlurMaskFilter::kNormal_BlurStyle,
27 SkBlurMaskFilter::kNone_BlurFlag))->unref();
27 } 28 }
28 29
29 static void paint_proc2(SkPaint* paint) { 30 static void paint_proc2(SkPaint* paint) {
30 SkScalar dir[3] = { 1, 1, 1}; 31 SkScalar dir[3] = { 1, 1, 1};
31 paint->setMaskFilter( 32 paint->setMaskFilter(
32 SkBlurMaskFilter::CreateEmboss(dir, 0.1f, 0.05f, 1))->unref (); 33 SkBlurMaskFilter::CreateEmboss(dir, 0.1f, 0.05f, 1))->unref ();
33 } 34 }
34 35
35 static void paint_proc3(SkPaint* paint) { 36 static void paint_proc3(SkPaint* paint) {
36 SkColor colors[] = { SK_ColorRED, COLOR, SK_ColorBLUE }; 37 SkColor colors[] = { SK_ColorRED, COLOR, SK_ColorBLUE };
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 110 }
110 111
111 private: 112 private:
112 typedef SampleView INHERITED; 113 typedef SampleView INHERITED;
113 }; 114 };
114 115
115 /////////////////////////////////////////////////////////////////////////////// 116 ///////////////////////////////////////////////////////////////////////////////
116 117
117 static SkView* MyFactory() { return new EffectsView; } 118 static SkView* MyFactory() { return new EffectsView; }
118 static SkViewRegister reg(MyFactory); 119 static SkViewRegister reg(MyFactory);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698