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

Unified Diff: src/ports/SkImageDecoder_empty.cpp

Issue 1507123002: default SkPixelSerializer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-12-10 (Thursday) 13:15:57 EST Created 5 years 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/SkImageEncoder.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkImageDecoder_empty.cpp
diff --git a/src/ports/SkImageDecoder_empty.cpp b/src/ports/SkImageDecoder_empty.cpp
index 11c3db1afc519bb0639abd62c08cb7dae93552f1..f52dada73bc6e1fc09ae3d8bdaa7aaeda6d9c17c 100644
--- a/src/ports/SkImageDecoder_empty.cpp
+++ b/src/ports/SkImageDecoder_empty.cpp
@@ -11,6 +11,7 @@
#include "SkImageDecoder.h"
#include "SkImageEncoder.h"
#include "SkMovie.h"
+#include "SkPixelSerializer.h"
#include "SkStream.h"
class SkColorTable;
@@ -108,6 +109,10 @@ SkData* SkImageEncoder::EncodeData(const SkImageInfo&, const void* pixels, size_
return nullptr;
}
+SkData* SkImageEncoder::EncodeData(const SkPixmap&, Type, int) {
+ return nullptr;
+}
+
bool SkImageEncoder::encodeStream(SkWStream*, const SkBitmap&, int) {
return false;
}
@@ -119,4 +124,17 @@ SkData* SkImageEncoder::encodeData(const SkBitmap&, int) {
bool SkImageEncoder::encodeFile(const char file[], const SkBitmap& bm, int quality) {
return false;
}
+
+namespace {
+class ImageEncoderPixelSerializer final : public SkPixelSerializer {
+protected:
+ bool onUseEncodedData(const void*, size_t) override { return true; }
+ SkData* onEncode(const SkPixmap&) override { return nullptr; }
+};
+} // namespace
+
+SkPixelSerializer* SkImageEncoder::CreatePixelSerializer() {
+ return new ImageEncoderPixelSerializer;
+}
+
/////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/images/SkImageEncoder.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698