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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 virtual SkSurface* onNewSurface(const SkImageInfo&, const SkSurfaceProps&) c
onst = 0; | 45 virtual SkSurface* onNewSurface(const SkImageInfo&, const SkSurfaceProps&) c
onst = 0; |
46 | 46 |
47 virtual const void* onPeekPixels(SkImageInfo*, size_t* /*rowBytes*/) const { | 47 virtual const void* onPeekPixels(SkImageInfo*, size_t* /*rowBytes*/) const { |
48 return nullptr; | 48 return nullptr; |
49 } | 49 } |
50 | 50 |
51 // Default impl calls onDraw | 51 // Default impl calls onDraw |
52 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_
t dstRowBytes, | 52 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_
t dstRowBytes, |
53 int srcX, int srcY) const; | 53 int srcX, int srcY) const; |
54 | 54 |
| 55 virtual void onPreroll(GrContext*) const {} |
| 56 |
55 virtual GrTexture* getTexture() const { return nullptr; } | 57 virtual GrTexture* getTexture() const { return nullptr; } |
56 | 58 |
57 // return a read-only copy of the pixels. We promise to not modify them, | 59 // return a read-only copy of the pixels. We promise to not modify them, |
58 // but only inspect them (or encode them). | 60 // but only inspect them (or encode them). |
59 virtual bool getROPixels(SkBitmap*) const { return false; } | 61 virtual bool getROPixels(SkBitmap*) const { return false; } |
60 | 62 |
61 virtual SkShader* onNewShader(SkShader::TileMode, | 63 virtual SkShader* onNewShader(SkShader::TileMode, |
62 SkShader::TileMode, | 64 SkShader::TileMode, |
63 const SkMatrix* localMatrix) const { return nu
llptr; } | 65 const SkMatrix* localMatrix) const { return nu
llptr; } |
64 | 66 |
(...skipping 14 matching lines...) Expand all Loading... |
79 | 81 |
80 static inline SkImage_Base* as_IB(SkImage* image) { | 82 static inline SkImage_Base* as_IB(SkImage* image) { |
81 return static_cast<SkImage_Base*>(image); | 83 return static_cast<SkImage_Base*>(image); |
82 } | 84 } |
83 | 85 |
84 static inline const SkImage_Base* as_IB(const SkImage* image) { | 86 static inline const SkImage_Base* as_IB(const SkImage* image) { |
85 return static_cast<const SkImage_Base*>(image); | 87 return static_cast<const SkImage_Base*>(image); |
86 } | 88 } |
87 | 89 |
88 #endif | 90 #endif |
OLD | NEW |