Index: include/core/SkImageGenerator.h |
diff --git a/include/core/SkImageGenerator.h b/include/core/SkImageGenerator.h |
index f55c72bc1e49ec0ec7c0ce5ffdf07737ffb7c9cc..a398697e6ba4eaa1f521bbf6f2107f1af4876f82 100644 |
--- a/include/core/SkImageGenerator.h |
+++ b/include/core/SkImageGenerator.h |
@@ -15,6 +15,8 @@ class SkBitmap; |
class SkData; |
class SkImageGenerator; |
+//#define SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS |
+ |
/** |
* Takes ownership of SkImageGenerator. If this method fails for |
* whatever reason, it will return false and immediatetely delete |
@@ -67,6 +69,7 @@ public: |
*/ |
const SkImageInfo& getInfo() const { return fInfo; } |
+#ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS |
/** |
* Used to describe the result of a call to getPixels(). |
* |
@@ -137,6 +140,7 @@ public: |
ZeroInitialized fZeroInitialized; |
}; |
+#endif |
/** |
* Decode into the given pixels, a block of memory of size at |
@@ -165,16 +169,16 @@ public: |
* If info is not kIndex8_SkColorType, then the last two parameters may be NULL. If ctableCount |
* is not null, it will be set to 0. |
* |
- * @return Result kSuccess, or another value explaining the type of failure. |
+ * @return true on success. |
*/ |
- Result getPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, const Options*, |
- SkPMColor ctable[], int* ctableCount); |
+ bool getPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, |
+ SkPMColor ctable[], int* ctableCount); |
/** |
* Simplified version of getPixels() that asserts that info is NOT kIndex8_SkColorType and |
* uses the default Options. |
*/ |
- Result getPixels(const SkImageInfo& info, void* pixels, size_t rowBytes); |
+ bool getPixels(const SkImageInfo& info, void* pixels, size_t rowBytes); |
/** |
* If planes or rowBytes is NULL or if any entry in planes is NULL or if any entry in rowBytes |
@@ -202,9 +206,14 @@ protected: |
virtual SkData* onRefEncodedData(); |
+#ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS |
virtual Result onGetPixels(const SkImageInfo& info, |
void* pixels, size_t rowBytes, const Options&, |
SkPMColor ctable[], int* ctableCount); |
+#else |
+ virtual bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, |
+ SkPMColor ctable[], int* ctableCount); |
+#endif |
virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3]); |
virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3], |
SkYUVColorSpace* colorSpace); |