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 13 matching lines...) Expand all Loading... |
24 * Refs the passed-in picture. cropRect can be used to crop or expand the d
estination rect when | 24 * Refs the passed-in picture. cropRect can be used to crop or expand the d
estination rect when |
25 * the picture is drawn. (No scaling is implied by the dest rect; only the
CTM is applied.) | 25 * the picture is drawn. (No scaling is implied by the dest rect; only the
CTM is applied.) |
26 */ | 26 */ |
27 static SkPictureImageFilter* Create(SkPicture* picture, const SkRect& cropRe
ct) { | 27 static SkPictureImageFilter* Create(SkPicture* picture, const SkRect& cropRe
ct) { |
28 return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect)); | 28 return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect)); |
29 } | 29 } |
30 | 30 |
31 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPictureImageFilter) | 31 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPictureImageFilter) |
32 | 32 |
33 protected: | 33 protected: |
| 34 explicit SkPictureImageFilter(SkPicture* picture); |
| 35 SkPictureImageFilter(SkPicture* picture, const SkRect& cropRect); |
34 virtual ~SkPictureImageFilter(); | 36 virtual ~SkPictureImageFilter(); |
35 /* Constructs an SkPictureImageFilter object from an SkReadBuffer. | 37 /* Constructs an SkPictureImageFilter object from an SkReadBuffer. |
36 * Note: If the SkPictureImageFilter object construction requires bitmap | 38 * Note: If the SkPictureImageFilter object construction requires bitmap |
37 * decoding, the decoder must be set on the SkReadBuffer parameter by calli
ng | 39 * decoding, the decoder must be set on the SkReadBuffer parameter by calli
ng |
38 * SkReadBuffer::setBitmapDecoder() before calling this constructor. | 40 * SkReadBuffer::setBitmapDecoder() before calling this constructor. |
39 * @param SkReadBuffer Serialized picture data. | 41 * @param SkReadBuffer Serialized picture data. |
40 */ | 42 */ |
41 explicit SkPictureImageFilter(SkReadBuffer&); | 43 explicit SkPictureImageFilter(SkReadBuffer&); |
42 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 44 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
43 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, | 45 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, |
44 SkBitmap* result, SkIPoint* offset) const SK_OVER
RIDE; | 46 SkBitmap* result, SkIPoint* offset) const SK_OVER
RIDE; |
45 | 47 |
46 #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS | |
47 public: | |
48 #endif | |
49 explicit SkPictureImageFilter(SkPicture* picture); | |
50 SkPictureImageFilter(SkPicture* picture, const SkRect& cropRect); | |
51 | |
52 private: | 48 private: |
53 SkPicture* fPicture; | 49 SkPicture* fPicture; |
54 SkRect fCropRect; | 50 SkRect fCropRect; |
55 typedef SkImageFilter INHERITED; | 51 typedef SkImageFilter INHERITED; |
56 }; | 52 }; |
57 | 53 |
58 #endif | 54 #endif |
OLD | NEW |