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

Unified Diff: src/images/SkImageEncoder.cpp

Issue 1373683003: change pixel-serializer to support reencoding existing data Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: I hate this warning 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 | « src/images/SkImageDecoder_ktx.cpp ('k') | tests/ImageTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkImageEncoder.cpp
diff --git a/src/images/SkImageEncoder.cpp b/src/images/SkImageEncoder.cpp
index cc1b73baa52150de72f20c1543634503d83770f9..4ad12c84cd60d7b9701e4b0ea92808150422eb3a 100644
--- a/src/images/SkImageEncoder.cpp
+++ b/src/images/SkImageEncoder.cpp
@@ -60,3 +60,13 @@ SkData* SkImageEncoder::EncodeData(const SkImageInfo& info, const void* pixels,
SkAutoTDelete<SkImageEncoder> enc(SkImageEncoder::Create(t));
return enc.get() ? enc.get()->encodeData(bm, quality) : nullptr;
}
+
+SkData* SkImageEncoder::EncodeData(const SkPixmap& pmap, Type t, int quality) {
+ return EncodeData(pmap.info(), pmap.addr(), pmap.rowBytes(), t, quality);
+}
+
+SkData* SkImageEncoder::ReencodeData(SkData* encoded, Type t) {
+ SkAutoTDelete<SkImageEncoder> enc(SkImageEncoder::Create(t));
+ return enc.get() ? enc.get()->onReencodeData(encoded) : nullptr;
+}
+
« no previous file with comments | « src/images/SkImageDecoder_ktx.cpp ('k') | tests/ImageTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698