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

Unified Diff: src/core/SkPixelSerializer.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 | « include/core/SkPixelSerializer.h ('k') | src/core/SkWriteBuffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPixelSerializer.cpp
diff --git a/src/core/SkPixelSerializer.cpp b/src/core/SkPixelSerializer.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a694bbe8464db42bfda3f5987fb9b59c54a37b56
--- /dev/null
+++ b/src/core/SkPixelSerializer.cpp
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkPixelSerializer.h"
+
+SkData* SkPixelSerializer::reencodeData(SkData* encoded) {
+ return encoded ? this->onReencodeData(encoded) : nullptr;
+}
+
+SkData* SkPixelSerializer::encodePixels(const SkImageInfo& info, const void* pixels,
+ size_t rowBytes) {
+ if (kUnknown_SkColorType == info.colorType() || !pixels) {
+ return nullptr;
+ }
+ return this->onEncodePixels(info, pixels, rowBytes);
+}
+
+SkData* SkPixelSerializer::encodePixels(const SkPixmap& pixmap) {
+ return this->encodePixels(pixmap.info(), pixmap.addr(), pixmap.rowBytes());
+}
« no previous file with comments | « include/core/SkPixelSerializer.h ('k') | src/core/SkWriteBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698