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