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

Unified Diff: src/lazy/SkDiscardablePixelRef.cpp

Issue 834633006: add ImageGenerator::NewFromData to porting layer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add helper for SkInstallDiscardablePixelRef(SkData*, ...) Created 5 years, 11 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
Index: src/lazy/SkDiscardablePixelRef.cpp
diff --git a/src/lazy/SkDiscardablePixelRef.cpp b/src/lazy/SkDiscardablePixelRef.cpp
index 84152ed188a4d32ec2c58f74289da55396b46bda..4b7d47b94d2bb4068f0dfcfbe66b3f752a294b88 100644
--- a/src/lazy/SkDiscardablePixelRef.cpp
+++ b/src/lazy/SkDiscardablePixelRef.cpp
@@ -116,7 +116,13 @@ bool SkInstallDiscardablePixelRef(SkImageGenerator* generator, SkBitmap* dst,
return true;
}
-// This is the public API
+// These are the public API
+
bool SkInstallDiscardablePixelRef(SkImageGenerator* generator, SkBitmap* dst) {
return SkInstallDiscardablePixelRef(generator, dst, NULL);
}
+
+bool SkInstallDiscardablePixelRef(SkData* encoded, SkBitmap* dst) {
+ SkImageGenerator* generator = SkImageGenerator::NewFromData(encoded);
+ return generator ? SkInstallDiscardablePixelRef(generator, dst, NULL) : false;
+}

Powered by Google App Engine
This is Rietveld 408576698