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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 int srcX, int srcY) const; | 53 int srcX, int srcY) const; |
54 | 54 |
55 virtual GrTexture* getTexture() const { return NULL; } | 55 virtual GrTexture* getTexture() const { return NULL; } |
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 { return false; } | 59 virtual bool getROPixels(SkBitmap*) const { return false; } |
60 | 60 |
61 virtual SkShader* onNewShader(SkShader::TileMode, | 61 virtual SkShader* onNewShader(SkShader::TileMode, |
62 SkShader::TileMode, | 62 SkShader::TileMode, |
63 const SkMatrix* localMatrix) const { return NU
LL; }; | 63 const SkMatrix* localMatrix) const { return NU
LL; } |
64 | 64 |
65 // newWidth > 0, newHeight > 0, subset either NULL or a proper subset of thi
s bounds | 65 // newWidth > 0, newHeight > 0, subset either NULL or a proper subset of thi
s bounds |
66 virtual SkImage* onNewImage(int newWidth, int newHeight, const SkIRect* subs
et, | 66 virtual SkImage* onNewImage(int newWidth, int newHeight, const SkIRect* subs
et, |
67 SkFilterQuality) const; | 67 SkFilterQuality) const; |
68 virtual SkData* onRefEncoded() const { return NULL; } | 68 virtual SkData* onRefEncoded() const { return NULL; } |
69 | 69 |
70 virtual bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; | 70 virtual bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; |
71 | 71 |
| 72 virtual bool onIsLazyGenerated() const { return false; } |
| 73 |
72 private: | 74 private: |
73 const SkSurfaceProps fProps; | 75 const SkSurfaceProps fProps; |
74 | 76 |
75 typedef SkImage INHERITED; | 77 typedef SkImage INHERITED; |
76 }; | 78 }; |
77 | 79 |
78 static inline SkImage_Base* as_IB(SkImage* image) { | 80 static inline SkImage_Base* as_IB(SkImage* image) { |
79 return static_cast<SkImage_Base*>(image); | 81 return static_cast<SkImage_Base*>(image); |
80 } | 82 } |
81 | 83 |
82 static inline const SkImage_Base* as_IB(const SkImage* image) { | 84 static inline const SkImage_Base* as_IB(const SkImage* image) { |
83 return static_cast<const SkImage_Base*>(image); | 85 return static_cast<const SkImage_Base*>(image); |
84 } | 86 } |
85 | 87 |
86 #endif | 88 #endif |
OLD | NEW |