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