OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The Android Open Source Project | 2 * Copyright 2014 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 #ifndef SkMatrixImageFilter_DEFINED | 8 #ifndef SkMatrixImageFilter_DEFINED |
9 #define SkMatrixImageFilter_DEFINED | 9 #define SkMatrixImageFilter_DEFINED |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 /** Construct a 2D transformation image filter. | 24 /** Construct a 2D transformation image filter. |
25 * @param transform The matrix to apply when drawing the src bitmap | 25 * @param transform The matrix to apply when drawing the src bitmap |
26 * @param filterLevel The quality of filtering to apply when scaling. | 26 * @param filterLevel The quality of filtering to apply when scaling. |
27 * @param input The input image filter. If NULL, the src bitmap | 27 * @param input The input image filter. If NULL, the src bitmap |
28 * passed to filterImage() is used instead. | 28 * passed to filterImage() is used instead. |
29 */ | 29 */ |
30 | 30 |
31 static SkMatrixImageFilter* Create(const SkMatrix& transform, | 31 static SkMatrixImageFilter* Create(const SkMatrix& transform, |
32 SkFilterQuality, | 32 SkFilterQuality, |
33 SkImageFilter* input = NULL); | 33 SkImageFilter* input = NULL); |
34 #ifdef SK_SUPPORT_LEGACY_FILTERLEVEL_ENUM | |
35 static SkMatrixImageFilter* Create(const SkMatrix& transform, | |
36 SkPaint::FilterLevel level, | |
37 SkImageFilter* input = NULL) { | |
38 return Create(transform, SkFilterQuality(level), input); | |
39 } | |
40 #endif | |
41 virtual ~SkMatrixImageFilter(); | 34 virtual ~SkMatrixImageFilter(); |
42 | 35 |
43 void computeFastBounds(const SkRect&, SkRect*) const override; | 36 void computeFastBounds(const SkRect&, SkRect*) const override; |
44 | 37 |
45 SK_TO_STRING_OVERRIDE() | 38 SK_TO_STRING_OVERRIDE() |
46 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMatrixImageFilter) | 39 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMatrixImageFilter) |
47 | 40 |
48 protected: | 41 protected: |
49 SkMatrixImageFilter(const SkMatrix& transform, | 42 SkMatrixImageFilter(const SkMatrix& transform, |
50 SkFilterQuality, | 43 SkFilterQuality, |
51 SkImageFilter* input); | 44 SkImageFilter* input); |
52 void flatten(SkWriteBuffer&) const override; | 45 void flatten(SkWriteBuffer&) const override; |
53 | 46 |
54 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, | 47 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, |
55 SkBitmap* result, SkIPoint* loc) const override; | 48 SkBitmap* result, SkIPoint* loc) const override; |
56 virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&, | 49 virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&, |
57 SkIRect* dst) const override; | 50 SkIRect* dst) const override; |
58 | 51 |
59 private: | 52 private: |
60 SkMatrix fTransform; | 53 SkMatrix fTransform; |
61 SkFilterQuality fFilterQuality; | 54 SkFilterQuality fFilterQuality; |
62 typedef SkImageFilter INHERITED; | 55 typedef SkImageFilter INHERITED; |
63 }; | 56 }; |
64 | 57 |
65 #endif | 58 #endif |
OLD | NEW |