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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 virtual GrTexture* peekTexture() const { return nullptr; } | 48 virtual GrTexture* peekTexture() const { return nullptr; } |
49 | 49 |
50 // return a read-only copy of the pixels. We promise to not modify them, | 50 // return a read-only copy of the pixels. We promise to not modify them, |
51 // but only inspect them (or encode them). | 51 // but only inspect them (or encode them). |
52 virtual bool getROPixels(SkBitmap*) const = 0; | 52 virtual bool getROPixels(SkBitmap*) const = 0; |
53 | 53 |
54 // Caller must call unref when they are done. | 54 // Caller must call unref when they are done. |
55 virtual GrTexture* asTextureRef(GrContext*, SkImageUsageType) const = 0; | 55 virtual GrTexture* asTextureRef(GrContext*, SkImageUsageType) const = 0; |
56 | 56 |
| 57 virtual SkShader* onNewShader(SkShader::TileMode, |
| 58 SkShader::TileMode, |
| 59 const SkMatrix* localMatrix) const { return nu
llptr; } |
| 60 |
57 virtual SkImage* onNewSubset(const SkIRect&) const = 0; | 61 virtual SkImage* onNewSubset(const SkIRect&) const = 0; |
58 | |
59 virtual SkData* onRefEncoded() const { return nullptr; } | 62 virtual SkData* onRefEncoded() const { return nullptr; } |
60 | 63 |
61 virtual bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; | 64 virtual bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; |
62 | 65 |
63 virtual bool onIsLazyGenerated() const { return false; } | 66 virtual bool onIsLazyGenerated() const { return false; } |
64 | 67 |
65 // Call when this image is part of the key to a resourcecache entry. This al
lows the cache | 68 // Call when this image is part of the key to a resourcecache entry. This al
lows the cache |
66 // to know automatically those entries can be purged when this SkImage delet
ed. | 69 // to know automatically those entries can be purged when this SkImage delet
ed. |
67 void notifyAddedToCache() const { | 70 void notifyAddedToCache() const { |
68 fAddedToCache.store(true); | 71 fAddedToCache.store(true); |
(...skipping 10 matching lines...) Expand all Loading... |
79 | 82 |
80 static inline SkImage_Base* as_IB(SkImage* image) { | 83 static inline SkImage_Base* as_IB(SkImage* image) { |
81 return static_cast<SkImage_Base*>(image); | 84 return static_cast<SkImage_Base*>(image); |
82 } | 85 } |
83 | 86 |
84 static inline const SkImage_Base* as_IB(const SkImage* image) { | 87 static inline const SkImage_Base* as_IB(const SkImage* image) { |
85 return static_cast<const SkImage_Base*>(image); | 88 return static_cast<const SkImage_Base*>(image); |
86 } | 89 } |
87 | 90 |
88 #endif | 91 #endif |
OLD | NEW |