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 12 matching lines...) Expand all Loading... |
23 public: | 23 public: |
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 SkPaint::FilterLevel, | 32 SkPaint::FilterLevel, |
33 SkImageFilter* input = NULL); | 33 SkImageFilter* input = NULL, |
| 34 uint32_t uniqueID = 0); |
34 virtual ~SkMatrixImageFilter(); | 35 virtual ~SkMatrixImageFilter(); |
35 | 36 |
36 virtual void computeFastBounds(const SkRect&, SkRect*) const SK_OVERRIDE; | 37 virtual void computeFastBounds(const SkRect&, SkRect*) const SK_OVERRIDE; |
37 | 38 |
38 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMatrixImageFilter) | 39 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMatrixImageFilter) |
39 | 40 |
40 protected: | 41 protected: |
41 SkMatrixImageFilter(const SkMatrix& transform, | 42 SkMatrixImageFilter(const SkMatrix& transform, |
42 SkPaint::FilterLevel, | 43 SkPaint::FilterLevel, |
43 SkImageFilter* input); | 44 SkImageFilter* input, |
| 45 uint32_t uniqueID); |
44 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING | 46 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
45 SkMatrixImageFilter(SkReadBuffer& buffer); | 47 SkMatrixImageFilter(SkReadBuffer& buffer); |
46 #endif | 48 #endif |
47 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 49 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
48 | 50 |
49 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, | 51 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, |
50 SkBitmap* result, SkIPoint* loc) const SK_OVERRID
E; | 52 SkBitmap* result, SkIPoint* loc) const SK_OVERRID
E; |
51 virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&, | 53 virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&, |
52 SkIRect* dst) const SK_OVERRIDE; | 54 SkIRect* dst) const SK_OVERRIDE; |
53 | 55 |
54 private: | 56 private: |
55 SkMatrix fTransform; | 57 SkMatrix fTransform; |
56 SkPaint::FilterLevel fFilterLevel; | 58 SkPaint::FilterLevel fFilterLevel; |
57 typedef SkImageFilter INHERITED; | 59 typedef SkImageFilter INHERITED; |
58 }; | 60 }; |
59 | 61 |
60 #endif | 62 #endif |
OLD | NEW |