OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 The Android Open Source Project |
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 | 8 |
9 #ifndef SkMagnifierImageFilter_DEFINED | 9 #ifndef SkMagnifierImageFilter_DEFINED |
10 #define SkMagnifierImageFilter_DEFINED | 10 #define SkMagnifierImageFilter_DEFINED |
11 | 11 |
12 #include "SkRect.h" | 12 #include "SkRect.h" |
13 #include "SkImageFilter.h" | 13 #include "SkImageFilter.h" |
14 | 14 |
15 class SK_API SkMagnifierImageFilter : public SkImageFilter { | 15 class SK_API SkMagnifierImageFilter : public SkImageFilter { |
16 public: | 16 public: |
17 SkMagnifierImageFilter(SkRect srcRect, SkScalar inset); | 17 static SkMagnifierImageFilter* Create(const SkRect& srcRect, SkScalar inset)
{ |
| 18 return SkNEW_ARGS(SkMagnifierImageFilter, (srcRect, inset)); |
| 19 } |
18 | 20 |
19 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter) | 21 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter) |
20 | 22 |
21 protected: | 23 protected: |
22 explicit SkMagnifierImageFilter(SkReadBuffer& buffer); | 24 explicit SkMagnifierImageFilter(SkReadBuffer& buffer); |
23 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 25 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
24 | 26 |
25 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, | 27 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, |
26 SkBitmap* result, SkIPoint* offset) const SK_OVER
RIDE; | 28 SkBitmap* result, SkIPoint* offset) const SK_OVER
RIDE; |
27 #if SK_SUPPORT_GPU | 29 #if SK_SUPPORT_GPU |
28 virtual bool asNewEffect(GrEffectRef** effect, GrTexture* texture, const SkM
atrix& matrix, const SkIRect& bounds) const SK_OVERRIDE; | 30 virtual bool asNewEffect(GrEffectRef** effect, GrTexture* texture, const SkM
atrix& matrix, const SkIRect& bounds) const SK_OVERRIDE; |
29 #endif | 31 #endif |
30 | 32 |
| 33 #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS |
| 34 public: |
| 35 #endif |
| 36 SkMagnifierImageFilter(const SkRect& srcRect, SkScalar inset); |
| 37 |
31 private: | 38 private: |
32 SkRect fSrcRect; | 39 SkRect fSrcRect; |
33 SkScalar fInset; | 40 SkScalar fInset; |
34 typedef SkImageFilter INHERITED; | 41 typedef SkImageFilter INHERITED; |
35 }; | 42 }; |
36 | 43 |
37 #endif | 44 #endif |
OLD | NEW |