OLD | NEW |
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 "SkBlurMaskFilter.h" | 9 #include "SkBlurMaskFilter.h" |
10 #include "SkView.h" | 10 #include "SkView.h" |
(...skipping 12 matching lines...) Expand all Loading... |
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 SkMaskFilter* mf = SkBlurMaskFilter::Create( |
33 128, | |
34 SkBlurMaskFilter::kNormal_BlurStyle, | 33 SkBlurMaskFilter::kNormal_BlurStyle, |
| 34 SkFloatToScalar(74.4008f), |
35 SkBlurMaskFilter::kHighQuality_BlurFlag); | 35 SkBlurMaskFilter::kHighQuality_BlurFlag); |
36 paint.setMaskFilter(mf)->unref(); | 36 paint.setMaskFilter(mf)->unref(); |
37 canvas->translate(200, 200); | 37 canvas->translate(200, 200); |
38 canvas->drawCircle(100, 100, 200, paint); | 38 canvas->drawCircle(100, 100, 200, paint); |
39 canvas->restore(); | 39 canvas->restore(); |
40 } | 40 } |
41 | 41 |
42 private: | 42 private: |
43 typedef SkView INHERITED; | 43 typedef SkView INHERITED; |
44 }; | 44 }; |
45 | 45 |
46 ////////////////////////////////////////////////////////////////////////////// | 46 ////////////////////////////////////////////////////////////////////////////// |
47 | 47 |
48 static SkView* MyFactory() { return new BigBlurView; } | 48 static SkView* MyFactory() { return new BigBlurView; } |
49 static SkViewRegister reg(MyFactory); | 49 static SkViewRegister reg(MyFactory); |
OLD | NEW |