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

Unified Diff: include/core/SkPixelSerializer.h

Issue 784643002: Replace EncodeBitmap with an interface. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Undefine macro, fix callsites, define in chrome, leave EncodeBitmap for PDF. Created 6 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
Index: include/core/SkPixelSerializer.h
diff --git a/include/core/SkPixelSerializer.h b/include/core/SkPixelSerializer.h
new file mode 100644
index 0000000000000000000000000000000000000000..7c20ee4a35d352a891ae652284bd821031ff783f
--- /dev/null
+++ b/include/core/SkPixelSerializer.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkPixelSerializer_DEFINED
+#define SkPixelSerializer_DEFINED
+
+#include "SkRefCnt.h"
+
+class SkData;
+struct SkImageInfo;
+
+class SkPixelSerializer : public SkRefCnt {
+public:
+ // return true if you want to serialize the encoded data, false if you want another
+ // another version serialized
+ virtual bool useEncodedData(SkData*) = 0;
+ // If you want to encode these pixels, return the encoded data as an SkData
+ // return null if you want to serialize the raw pixels
+ virtual SkData* encodePixels(const SkImageInfo&, void* pixels, size_t rowBytes) = 0;
+};
+#endif // SkPixelSerializer_DEFINED
« gm/gmmain.cpp ('K') | « include/core/SkPicture.h ('k') | include/core/SkWriteBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698