OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 The Android Open Source Project | 2 * Copyright 2013 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 SkPictureImageFilter_DEFINED | 8 #ifndef SkPictureImageFilter_DEFINED |
9 #define SkPictureImageFilter_DEFINED | 9 #define SkPictureImageFilter_DEFINED |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 * destination canvas, bilinear filtering will be used. cropRect can be use
d to crop or | 36 * destination canvas, bilinear filtering will be used. cropRect can be use
d to crop or |
37 * expand the destination rect when the picture is drawn. (No scaling is im
plied by the | 37 * expand the destination rect when the picture is drawn. (No scaling is im
plied by the |
38 * dest rect; only the CTM is applied.) | 38 * dest rect; only the CTM is applied.) |
39 */ | 39 */ |
40 static SkPictureImageFilter* CreateForLocalSpace(const SkPicture* picture, | 40 static SkPictureImageFilter* CreateForLocalSpace(const SkPicture* picture, |
41 const SkRect& cropRect, | 41 const SkRect& cropRect, |
42 SkFilterQuality filterQuali
ty) { | 42 SkFilterQuality filterQuali
ty) { |
43 return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect, | 43 return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect, |
44 kLocalSpace_PictureResolution,
filterQuality)); | 44 kLocalSpace_PictureResolution,
filterQuality)); |
45 } | 45 } |
46 #ifdef SK_SUPPORT_LEGACY_FILTERLEVEL_ENUM | |
47 static SkPictureImageFilter* CreateForLocalSpace(const SkPicture* picture, | |
48 const SkRect& cropRect, | |
49 SkPaint::FilterLevel filter
Level) { | |
50 return CreateForLocalSpace(picture, cropRect, (SkFilterQuality)filterLev
el); | |
51 } | |
52 #endif | |
53 SK_TO_STRING_OVERRIDE() | 46 SK_TO_STRING_OVERRIDE() |
54 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPictureImageFilter) | 47 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPictureImageFilter) |
55 | 48 |
56 protected: | 49 protected: |
57 enum PictureResolution { | 50 enum PictureResolution { |
58 kDeviceSpace_PictureResolution, | 51 kDeviceSpace_PictureResolution, |
59 kLocalSpace_PictureResolution | 52 kLocalSpace_PictureResolution |
60 }; | 53 }; |
61 | 54 |
62 explicit SkPictureImageFilter(const SkPicture* picture); | 55 explicit SkPictureImageFilter(const SkPicture* picture); |
(...skipping 19 matching lines...) Expand all Loading... |
82 const Context&) const; | 75 const Context&) const; |
83 | 76 |
84 const SkPicture* fPicture; | 77 const SkPicture* fPicture; |
85 SkRect fCropRect; | 78 SkRect fCropRect; |
86 PictureResolution fPictureResolution; | 79 PictureResolution fPictureResolution; |
87 SkFilterQuality fFilterQuality; | 80 SkFilterQuality fFilterQuality; |
88 typedef SkImageFilter INHERITED; | 81 typedef SkImageFilter INHERITED; |
89 }; | 82 }; |
90 | 83 |
91 #endif | 84 #endif |
OLD | NEW |