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