diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkImage.h | 9 | ||||
-rw-r--r-- | include/core/SkImageGenerator.h | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/core/SkImage.h b/include/core/SkImage.h index 5ce32eafb7..9cc26ed4be 100644 --- a/include/core/SkImage.h +++ b/include/core/SkImage.h @@ -63,6 +63,15 @@ public: */ static SkImage* NewFromGenerator(SkImageGenerator*); + /** + * Construct a new SkImage based on the specified encoded data. Returns NULL on failure, + * which can mean that the format of the encoded data was not recognized/supported. + * + * Regardless of success or failure, the caller is responsible for managing their ownership + * of the data. + */ + static SkImage* NewFromData(SkData* data); + int width() const { return fWidth; } int height() const { return fHeight; } uint32_t uniqueID() const { return fUniqueID; } diff --git a/include/core/SkImageGenerator.h b/include/core/SkImageGenerator.h index 635a8d4b44..cbceaa2308 100644 --- a/include/core/SkImageGenerator.h +++ b/include/core/SkImageGenerator.h @@ -35,6 +35,11 @@ class SkImageGenerator; */ SK_API bool SkInstallDiscardablePixelRef(SkImageGenerator*, SkBitmap* destination); +/** + * On success, installs a discradable pixelref into destination, based on encoded data. + * Regardless of success or failure, the caller must still balance their ownership of encoded. + */ +SK_API bool SkInstallDiscardablePixelRef(SkData* encoded, SkBitmap* destination); /** * An interface that allows a purgeable PixelRef (such as a |