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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 virtual GrTexture* peekTexture() const { return nullptr; } | 50 virtual GrTexture* peekTexture() const { return nullptr; } |
51 | 51 |
52 // return a read-only copy of the pixels. We promise to not modify them, | 52 // return a read-only copy of the pixels. We promise to not modify them, |
53 // but only inspect them (or encode them). | 53 // but only inspect them (or encode them). |
54 virtual bool getROPixels(SkBitmap*) const = 0; | 54 virtual bool getROPixels(SkBitmap*) const = 0; |
55 | 55 |
56 // Caller must call unref when they are done. | 56 // Caller must call unref when they are done. |
57 virtual GrTexture* asTextureRef(GrContext*, SkImageUsageType) const = 0; | 57 virtual GrTexture* asTextureRef(GrContext*, SkImageUsageType) const = 0; |
58 | 58 |
59 virtual SkShader* onNewShader(SkShader::TileMode, | |
60 SkShader::TileMode, | |
61 const SkMatrix* localMatrix) const { return nu
llptr; } | |
62 | |
63 // newWidth > 0, newHeight > 0, subset either nullptr or a proper subset of
this bounds | 59 // newWidth > 0, newHeight > 0, subset either nullptr or a proper subset of
this bounds |
64 virtual SkImage* onNewImage(int newWidth, int newHeight, const SkIRect* subs
et, | 60 virtual SkImage* onNewImage(int newWidth, int newHeight, const SkIRect* subs
et, |
65 SkFilterQuality) const; | 61 SkFilterQuality) const; |
66 virtual SkData* onRefEncoded() const { return nullptr; } | 62 virtual SkData* onRefEncoded() const { return nullptr; } |
67 | 63 |
68 virtual bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; | 64 virtual bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; |
69 | 65 |
70 virtual bool onIsLazyGenerated() const { return false; } | 66 virtual bool onIsLazyGenerated() const { return false; } |
71 | 67 |
72 // 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 |
(...skipping 13 matching lines...) Expand all Loading... |
86 | 82 |
87 static inline SkImage_Base* as_IB(SkImage* image) { | 83 static inline SkImage_Base* as_IB(SkImage* image) { |
88 return static_cast<SkImage_Base*>(image); | 84 return static_cast<SkImage_Base*>(image); |
89 } | 85 } |
90 | 86 |
91 static inline const SkImage_Base* as_IB(const SkImage* image) { | 87 static inline const SkImage_Base* as_IB(const SkImage* image) { |
92 return static_cast<const SkImage_Base*>(image); | 88 return static_cast<const SkImage_Base*>(image); |
93 } | 89 } |
94 | 90 |
95 #endif | 91 #endif |
OLD | NEW |