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 static SkImageFilter* Create(const SkRect& src, SkScalar inset, SkImageFilte
r* input = NULL); | 17 static SkImageFilter* Create(const SkRect& src, SkScalar inset, SkImageFilte
r* input = NULL); |
18 | 18 |
19 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter) | 19 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter) |
20 | 20 |
21 protected: | 21 protected: |
22 SkMagnifierImageFilter(const SkRect& srcRect, SkScalar inset, SkImageFilter*
input); | 22 SkMagnifierImageFilter(const SkRect& srcRect, SkScalar inset, SkImageFilter*
input); |
23 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING | |
24 explicit SkMagnifierImageFilter(SkReadBuffer& buffer); | |
25 #endif | |
26 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 23 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
27 | 24 |
28 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, | 25 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, |
29 SkBitmap* result, SkIPoint* offset) const SK_OVER
RIDE; | 26 SkBitmap* result, SkIPoint* offset) const SK_OVER
RIDE; |
30 #if SK_SUPPORT_GPU | 27 #if SK_SUPPORT_GPU |
31 virtual bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const Sk
Matrix&, | 28 virtual bool asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const Sk
Matrix&, |
32 const SkIRect& bounds) const SK_OVERRIDE; | 29 const SkIRect& bounds) const SK_OVERRIDE; |
33 #endif | 30 #endif |
34 | 31 |
35 private: | 32 private: |
36 SkRect fSrcRect; | 33 SkRect fSrcRect; |
37 SkScalar fInset; | 34 SkScalar fInset; |
38 typedef SkImageFilter INHERITED; | 35 typedef SkImageFilter INHERITED; |
39 }; | 36 }; |
40 | 37 |
41 #endif | 38 #endif |
OLD | NEW |