| 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 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 class SkImage_Base : public SkImage { | 23 class SkImage_Base : public SkImage { |
| 24 public: | 24 public: |
| 25 SkImage_Base(int width, int height, uint32_t uniqueID); | 25 SkImage_Base(int width, int height, uint32_t uniqueID); |
| 26 virtual ~SkImage_Base(); | 26 virtual ~SkImage_Base(); |
| 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, CachingHint) 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*, CachingHint = kAllow_CachingHint) const
= 0; |
| 39 | 39 |
| 40 virtual SkImage* onApplyFilter(SkImageFilter*, SkIPoint* offset, | 40 virtual SkImage* onApplyFilter(SkImageFilter*, SkIPoint* offset, |
| 41 bool forceResultToOriginalSize) const; | 41 bool forceResultToOriginalSize) const; |
| 42 | 42 |
| 43 virtual SkSurface* onNewSurface(const SkImageInfo& info) const { | 43 virtual SkSurface* onNewSurface(const SkImageInfo& info) const { |
| 44 return SkSurface::NewRaster(info); | 44 return SkSurface::NewRaster(info); |
| 45 } | 45 } |
| 46 | 46 |
| 47 // Caller must call unref when they are done. | 47 // Caller must call unref when they are done. |
| 48 virtual GrTexture* asTextureRef(GrContext*, const GrTextureParams&) const =
0; | 48 virtual GrTexture* asTextureRef(GrContext*, const GrTextureParams&) const =
0; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 70 | 70 |
| 71 static inline SkImage_Base* as_IB(SkImage* image) { | 71 static inline SkImage_Base* as_IB(SkImage* image) { |
| 72 return static_cast<SkImage_Base*>(image); | 72 return static_cast<SkImage_Base*>(image); |
| 73 } | 73 } |
| 74 | 74 |
| 75 static inline const SkImage_Base* as_IB(const SkImage* image) { | 75 static inline const SkImage_Base* as_IB(const SkImage* image) { |
| 76 return static_cast<const SkImage_Base*>(image); | 76 return static_cast<const SkImage_Base*>(image); |
| 77 } | 77 } |
| 78 | 78 |
| 79 #endif | 79 #endif |
| OLD | NEW |