| 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 virtual const void* onPeekPixels(SkImageInfo*, size_t* /*rowBytes*/) const {
return nullptr; } | 28 virtual const void* onPeekPixels(SkImageInfo*, size_t* /*rowBytes*/) const {
return nullptr; } |
| 29 | 29 |
| 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). scaleHint (0 < defines lowest |
| 38 virtual bool getROPixels(SkBitmap*) const = 0; | 38 // acceptable (meaning smaller won't be provided) scale for requested bitmap
. |
| 39 virtual bool getROPixels(SkBitmap*, SkScalar scaleHint = SK_Scalar1) const =
0; |
| 39 | 40 |
| 40 virtual SkImage* onApplyFilter(SkImageFilter*, SkIPoint* offset, | 41 virtual SkImage* onApplyFilter(SkImageFilter*, SkIPoint* offset, |
| 41 bool forceResultToOriginalSize) const; | 42 bool forceResultToOriginalSize) const; |
| 42 | 43 |
| 43 virtual SkSurface* onNewSurface(const SkImageInfo& info) const { | 44 virtual SkSurface* onNewSurface(const SkImageInfo& info) const { |
| 44 return SkSurface::NewRaster(info); | 45 return SkSurface::NewRaster(info); |
| 45 } | 46 } |
| 46 | 47 |
| 47 // Caller must call unref when they are done. | 48 // Caller must call unref when they are done. |
| 48 virtual GrTexture* asTextureRef(GrContext*, const GrTextureParams&) const =
0; | 49 virtual GrTexture* asTextureRef(GrContext*, const GrTextureParams&) const =
0; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 70 | 71 |
| 71 static inline SkImage_Base* as_IB(SkImage* image) { | 72 static inline SkImage_Base* as_IB(SkImage* image) { |
| 72 return static_cast<SkImage_Base*>(image); | 73 return static_cast<SkImage_Base*>(image); |
| 73 } | 74 } |
| 74 | 75 |
| 75 static inline const SkImage_Base* as_IB(const SkImage* image) { | 76 static inline const SkImage_Base* as_IB(const SkImage* image) { |
| 76 return static_cast<const SkImage_Base*>(image); | 77 return static_cast<const SkImage_Base*>(image); |
| 77 } | 78 } |
| 78 | 79 |
| 79 #endif | 80 #endif |
| OLD | NEW |