OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
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 SkImageSource_DEFINED | 8 #ifndef SkImageSource_DEFINED |
9 #define SkImageSource_DEFINED | 9 #define SkImageSource_DEFINED |
10 | 10 |
11 #include "SkImageFilter.h" | 11 #include "SkImageFilter.h" |
12 | 12 |
13 class SkImage; | 13 class SkImage; |
14 | 14 |
15 class SK_API SkImageSource : public SkImageFilter { | 15 class SK_API SkImageSource : public SkImageFilter { |
16 public: | 16 public: |
17 static SkImageFilter* Create(const SkImage*); | 17 static SkImageFilter* Create(SkImage*); |
18 static SkImageFilter* Create(const SkImage*, | 18 static SkImageFilter* Create(SkImage*, |
19 const SkRect& srcRect, | 19 const SkRect& srcRect, |
20 const SkRect& dstRect, | 20 const SkRect& dstRect, |
21 SkFilterQuality); | 21 SkFilterQuality); |
22 | 22 |
23 void computeFastBounds(const SkRect& src, SkRect* dst) const override; | 23 void computeFastBounds(const SkRect& src, SkRect* dst) const override; |
24 | 24 |
25 SK_TO_STRING_OVERRIDE() | 25 SK_TO_STRING_OVERRIDE() |
26 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkImageSource) | 26 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkImageSource) |
27 | 27 |
28 protected: | 28 protected: |
29 void flatten(SkWriteBuffer&) const override; | 29 void flatten(SkWriteBuffer&) const override; |
30 | 30 |
31 SkSpecialImage* onFilterImage(SkSpecialImage* source, const Context&, | 31 SkSpecialImage* onFilterImage(SkSpecialImage* source, const Context&, |
32 SkIPoint* offset) const override; | 32 SkIPoint* offset) const override; |
33 | 33 |
34 private: | 34 private: |
35 explicit SkImageSource(const SkImage*); | 35 explicit SkImageSource(SkImage*); |
36 SkImageSource(const SkImage*, | 36 SkImageSource(SkImage*, |
37 const SkRect& srcRect, | 37 const SkRect& srcRect, |
38 const SkRect& dstRect, | 38 const SkRect& dstRect, |
39 SkFilterQuality); | 39 SkFilterQuality); |
40 | 40 |
41 SkAutoTUnref<const SkImage> fImage; | 41 sk_sp<SkImage> fImage; |
42 SkRect fSrcRect, fDstRect; | 42 SkRect fSrcRect, fDstRect; |
43 SkFilterQuality fFilterQuality; | 43 SkFilterQuality fFilterQuality; |
44 | 44 |
45 typedef SkImageFilter INHERITED; | 45 typedef SkImageFilter INHERITED; |
46 }; | 46 }; |
47 | 47 |
48 #endif | 48 #endif |
OLD | NEW |