OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 SkImage_Base_DEFINED | 8 #ifndef SkImage_Base_DEFINED |
9 #define SkImage_Base_DEFINED | 9 #define SkImage_Base_DEFINED |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 // return a read-only copy of the pixels. We promise to not modify them, | 43 // return a read-only copy of the pixels. We promise to not modify them, |
44 // but only inspect them (or encode them). | 44 // but only inspect them (or encode them). |
45 virtual bool getROPixels(SkBitmap*, CachingHint = kAllow_CachingHint) const
= 0; | 45 virtual bool getROPixels(SkBitmap*, CachingHint = kAllow_CachingHint) const
= 0; |
46 | 46 |
47 virtual sk_sp<SkSurface> onNewSurface(const SkImageInfo& info) const { | 47 virtual sk_sp<SkSurface> onNewSurface(const SkImageInfo& info) const { |
48 return SkSurface::MakeRaster(info); | 48 return SkSurface::MakeRaster(info); |
49 } | 49 } |
50 | 50 |
51 // Caller must call unref when they are done. | 51 // Caller must call unref when they are done. |
52 virtual GrTexture* asTextureRef(GrContext*, const GrTextureParams&) const =
0; | 52 virtual GrTexture* asTextureRef(GrContext*, const GrTextureParams&, |
| 53 bool gammaCorrect) const = 0; |
53 | 54 |
54 virtual sk_sp<SkImage> onMakeSubset(const SkIRect&) const = 0; | 55 virtual sk_sp<SkImage> onMakeSubset(const SkIRect&) const = 0; |
55 | 56 |
56 // If a ctx is specified, then only gpu-specific formats are requested. | 57 // If a ctx is specified, then only gpu-specific formats are requested. |
57 virtual SkData* onRefEncoded(GrContext*) const { return nullptr; } | 58 virtual SkData* onRefEncoded(GrContext*) const { return nullptr; } |
58 | 59 |
59 virtual bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; | 60 virtual bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; |
60 | 61 |
61 virtual bool onIsLazyGenerated() const { return false; } | 62 virtual bool onIsLazyGenerated() const { return false; } |
62 | 63 |
(...skipping 22 matching lines...) Expand all Loading... |
85 | 86 |
86 static inline SkImage_Base* as_IB(const sk_sp<SkImage>& image) { | 87 static inline SkImage_Base* as_IB(const sk_sp<SkImage>& image) { |
87 return static_cast<SkImage_Base*>(image.get()); | 88 return static_cast<SkImage_Base*>(image.get()); |
88 } | 89 } |
89 | 90 |
90 static inline const SkImage_Base* as_IB(const SkImage* image) { | 91 static inline const SkImage_Base* as_IB(const SkImage* image) { |
91 return static_cast<const SkImage_Base*>(image); | 92 return static_cast<const SkImage_Base*>(image); |
92 } | 93 } |
93 | 94 |
94 #endif | 95 #endif |
OLD | NEW |