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 28 matching lines...) Expand all Loading... |
39 virtual SkSurface* onNewSurface(const SkImageInfo&, const SkSurfaceProps&) c
onst = 0; | 39 virtual SkSurface* onNewSurface(const SkImageInfo&, const SkSurfaceProps&) c
onst = 0; |
40 | 40 |
41 virtual const void* onPeekPixels(SkImageInfo*, size_t* /*rowBytes*/) const { | 41 virtual const void* onPeekPixels(SkImageInfo*, size_t* /*rowBytes*/) const { |
42 return NULL; | 42 return NULL; |
43 } | 43 } |
44 | 44 |
45 // Default impl calls onDraw | 45 // Default impl calls onDraw |
46 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_
t dstRowBytes, | 46 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_
t dstRowBytes, |
47 int srcX, int srcY) const; | 47 int srcX, int srcY) const; |
48 | 48 |
49 virtual GrTexture* onGetTexture() const { return NULL; } | 49 virtual GrTexture* getTexture() const { return NULL; } |
50 | 50 |
51 // return a read-only copy of the pixels. We promise to not modify them, | 51 // return a read-only copy of the pixels. We promise to not modify them, |
52 // but only inspect them (or encode them). | 52 // but only inspect them (or encode them). |
53 virtual bool getROPixels(SkBitmap*) const { return false; } | 53 virtual bool getROPixels(SkBitmap*) const { return false; } |
54 | 54 |
55 virtual SkShader* onNewShader(SkShader::TileMode, | 55 virtual SkShader* onNewShader(SkShader::TileMode, |
56 SkShader::TileMode, | 56 SkShader::TileMode, |
57 const SkMatrix* localMatrix) const { return NU
LL; }; | 57 const SkMatrix* localMatrix) const { return NU
LL; }; |
58 | 58 |
59 // newWidth > 0, newHeight > 0, subset either NULL or a proper subset of thi
s bounds | 59 // newWidth > 0, newHeight > 0, subset either NULL or a proper subset of thi
s bounds |
60 virtual SkImage* onNewImage(int newWidth, int newHeight, const SkIRect* subs
et, | 60 virtual SkImage* onNewImage(int newWidth, int newHeight, const SkIRect* subs
et, |
61 SkFilterQuality) const; | 61 SkFilterQuality) const; |
62 | 62 |
63 private: | 63 private: |
64 const SkSurfaceProps fProps; | 64 const SkSurfaceProps fProps; |
65 | 65 |
66 typedef SkImage INHERITED; | 66 typedef SkImage INHERITED; |
67 }; | 67 }; |
68 | 68 |
69 static inline SkImage_Base* as_IB(SkImage* image) { | 69 static inline SkImage_Base* as_IB(SkImage* image) { |
70 return static_cast<SkImage_Base*>(image); | 70 return static_cast<SkImage_Base*>(image); |
71 } | 71 } |
72 | 72 |
73 static inline const SkImage_Base* as_IB(const SkImage* image) { | 73 static inline const SkImage_Base* as_IB(const SkImage* image) { |
74 return static_cast<const SkImage_Base*>(image); | 74 return static_cast<const SkImage_Base*>(image); |
75 } | 75 } |
76 | 76 |
77 #endif | 77 #endif |
OLD | NEW |