Index: include/core/SkImageGenerator.h |
diff --git a/include/core/SkImageGenerator.h b/include/core/SkImageGenerator.h |
index c84463def281302b995c9bd295f799cef8acc71a..5b96671c9894bdb96ee8ee4348711cac7261ec26 100644 |
--- a/include/core/SkImageGenerator.h |
+++ b/include/core/SkImageGenerator.h |
@@ -165,6 +165,23 @@ public: |
static SkImageGenerator* NewFromPicture(const SkISize&, const SkPicture*, const SkMatrix*, |
const SkPaint*); |
+ bool tryGenerateBitmap(SkBitmap* bm) { |
+ return this->tryGenerateBitmap(bm, nullptr); |
+ } |
+ bool tryGenerateBitmap(SkBitmap* bm, const SkImageInfo& info) { |
+ return this->tryGenerateBitmap(bm, &info); |
+ } |
+ void generateBitmap(SkBitmap* bm) { |
+ if (!this->tryGenerateBitmap(bm, nullptr)) { |
+ sk_throw(); |
+ } |
+ } |
+ void generateBitmap(SkBitmap* bm, const SkImageInfo& info) { |
+ if (!this->tryGenerateBitmap(bm, &info)) { |
+ sk_throw(); |
+ } |
+ } |
+ |
protected: |
SkImageGenerator(const SkImageInfo& info); |
@@ -180,6 +197,8 @@ protected: |
return nullptr; |
} |
+ bool tryGenerateBitmap(SkBitmap* bm, const SkImageInfo* optionalInfo); |
+ |
private: |
const SkImageInfo fInfo; |
const uint32_t fUniqueID; |