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 19 matching lines...) Expand all Loading... |
30 // Default impl calls onDraw | 30 // Default impl calls onDraw |
31 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_
t dstRowBytes, | 31 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_
t dstRowBytes, |
32 int srcX, int srcY) const; | 32 int srcX, int srcY) const; |
33 | 33 |
34 virtual GrTexture* peekTexture() const { return nullptr; } | 34 virtual GrTexture* peekTexture() const { return nullptr; } |
35 | 35 |
36 // return a read-only copy of the pixels. We promise to not modify them, | 36 // return a read-only copy of the pixels. We promise to not modify them, |
37 // but only inspect them (or encode them). | 37 // but only inspect them (or encode them). |
38 virtual bool getROPixels(SkBitmap*) const = 0; | 38 virtual bool getROPixels(SkBitmap*) const = 0; |
39 | 39 |
| 40 virtual SkImage* onApplyFilter(SkImageFilter*, SkIPoint* offset, |
| 41 bool forceResultToOriginalSize) const; |
| 42 |
| 43 virtual SkSurface* onNewSurface(const SkImageInfo& info) const { |
| 44 return SkSurface::NewRaster(info); |
| 45 } |
| 46 |
40 // Caller must call unref when they are done. | 47 // Caller must call unref when they are done. |
41 virtual GrTexture* asTextureRef(GrContext*, const GrTextureParams&) const =
0; | 48 virtual GrTexture* asTextureRef(GrContext*, const GrTextureParams&) const =
0; |
42 | 49 |
43 virtual SkImage* onNewSubset(const SkIRect&) const = 0; | 50 virtual SkImage* onNewSubset(const SkIRect&) const = 0; |
44 | 51 |
45 virtual SkData* onRefEncoded() const { return nullptr; } | 52 virtual SkData* onRefEncoded() const { return nullptr; } |
46 | 53 |
47 virtual bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; | 54 virtual bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; |
48 | 55 |
49 virtual bool onIsLazyGenerated() const { return false; } | 56 virtual bool onIsLazyGenerated() const { return false; } |
(...skipping 13 matching lines...) Expand all Loading... |
63 | 70 |
64 static inline SkImage_Base* as_IB(SkImage* image) { | 71 static inline SkImage_Base* as_IB(SkImage* image) { |
65 return static_cast<SkImage_Base*>(image); | 72 return static_cast<SkImage_Base*>(image); |
66 } | 73 } |
67 | 74 |
68 static inline const SkImage_Base* as_IB(const SkImage* image) { | 75 static inline const SkImage_Base* as_IB(const SkImage* image) { |
69 return static_cast<const SkImage_Base*>(image); | 76 return static_cast<const SkImage_Base*>(image); |
70 } | 77 } |
71 | 78 |
72 #endif | 79 #endif |
OLD | NEW |