| 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 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 class SkImage_Base : public SkImage { | 25 class SkImage_Base : public SkImage { |
| 26 public: | 26 public: |
| 27 SkImage_Base(int width, int height, uint32_t uniqueID); | 27 SkImage_Base(int width, int height, uint32_t uniqueID); |
| 28 virtual ~SkImage_Base(); | 28 virtual ~SkImage_Base(); |
| 29 | 29 |
| 30 // User: returns image info for this SkImage. | 30 // User: returns image info for this SkImage. |
| 31 // Implementors: if you can not return the value, return an invalid ImageInf
o with w=0 & h=0 | 31 // Implementors: if you can not return the value, return an invalid ImageInf
o with w=0 & h=0 |
| 32 // & unknown color space. | 32 // & unknown color space. |
| 33 virtual SkImageInfo onImageInfo() const = 0; | 33 virtual SkImageInfo onImageInfo() const = 0; |
| 34 virtual SkAlphaType onAlphaType() const = 0; |
| 34 | 35 |
| 35 virtual bool onPeekPixels(SkPixmap*) const { return false; } | 36 virtual bool onPeekPixels(SkPixmap*) const { return false; } |
| 36 | 37 |
| 37 virtual const SkBitmap* onPeekBitmap() const { return nullptr; } | 38 virtual const SkBitmap* onPeekBitmap() const { return nullptr; } |
| 38 | 39 |
| 39 // Default impl calls onDraw | 40 // Default impl calls onDraw |
| 40 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_
t dstRowBytes, | 41 virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_
t dstRowBytes, |
| 41 int srcX, int srcY, CachingHint) const; | 42 int srcX, int srcY, CachingHint) const; |
| 42 | 43 |
| 43 virtual GrTexture* peekTexture() const { return nullptr; } | 44 virtual GrTexture* peekTexture() const { return nullptr; } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 88 |
| 88 static inline SkImage_Base* as_IB(const sk_sp<SkImage>& image) { | 89 static inline SkImage_Base* as_IB(const sk_sp<SkImage>& image) { |
| 89 return static_cast<SkImage_Base*>(image.get()); | 90 return static_cast<SkImage_Base*>(image.get()); |
| 90 } | 91 } |
| 91 | 92 |
| 92 static inline const SkImage_Base* as_IB(const SkImage* image) { | 93 static inline const SkImage_Base* as_IB(const SkImage* image) { |
| 93 return static_cast<const SkImage_Base*>(image); | 94 return static_cast<const SkImage_Base*>(image); |
| 94 } | 95 } |
| 95 | 96 |
| 96 #endif | 97 #endif |
| OLD | NEW |