Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: include/core/SkImageGenerator.h

Issue 1334033004: formalize generate->bitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkImageCacherator.cpp » ('j') | tools/Resources.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | src/core/SkImageCacherator.cpp » ('j') | tools/Resources.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698