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

Unified Diff: src/core/SkWriteBuffer.cpp

Issue 2039813007: Add raw pixel serialization fallback for SkImages that cannot be encoded. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixed only on Mac Created 4 years, 6 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/core/SkReadBuffer.cpp ('k') | tools/dm_flags.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkWriteBuffer.cpp
diff --git a/src/core/SkWriteBuffer.cpp b/src/core/SkWriteBuffer.cpp
index 060bd43c6f2697e8f9583e8f4f2e016dc92236cc..ccf1f37dd8fb890593665f177f248949218a38f7 100644
--- a/src/core/SkWriteBuffer.cpp
+++ b/src/core/SkWriteBuffer.cpp
@@ -182,6 +182,13 @@ void SkBinaryWriteBuffer::writeImage(const SkImage* image) {
return;
}
+ SkBitmap bm;
+ if (image->asLegacyBitmap(&bm, SkImage::kRO_LegacyBitmapMode)) {
+ this->writeUInt(1); // signal raw pixels.
+ SkBitmap::WriteRawPixels(this, bm);
+ return;
+ }
+
this->writeUInt(0); // signal no pixels (in place of the size of the encoded data)
}
« no previous file with comments | « src/core/SkReadBuffer.cpp ('k') | tools/dm_flags.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698