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

Unified Diff: include/core/SkPicture.h

Issue 784643002: Replace EncodeBitmap with an interface. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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
« no previous file with comments | « gyp/skia_for_chromium_defines.gypi ('k') | include/core/SkPixelSerializer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPicture.h
diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h
index eb136e14e49bbb24a6613aa4716da9b3e7787e82..35458095da0514eb31cb460838b09574b5644cb9 100644
--- a/include/core/SkPicture.h
+++ b/include/core/SkPicture.h
@@ -24,6 +24,7 @@ class SkBBoxHierarchy;
class SkCanvas;
class SkData;
class SkPictureData;
+class SkPixelSerializer;
class SkStream;
class SkWStream;
@@ -35,6 +36,8 @@ namespace SkRecords {
class CollectLayers;
};
+//#define SK_LEGACY_ENCODE_BITMAP
+
/** \class SkPicture
The SkPicture class records the drawing commands made to a canvas, to
@@ -141,15 +144,30 @@ public:
* @param pixelRefOffset DEPRECATED -- caller assumes it will return 0.
* @return SkData If non-NULL, holds encoded data representing the passed
* in bitmap. The caller is responsible for calling unref().
+ *
+ * TODO: No longer used by SkPicture (except when SK_LEGACY_ENCODE_BITMAP
+ * is defined. Still used by PDF though. Move into PDF.
*/
typedef SkData* (*EncodeBitmap)(size_t* pixelRefOffset, const SkBitmap& bm);
+#ifdef SK_LEGACY_ENCODE_BITMAP
/**
* Serialize to a stream. If non NULL, encoder will be used to encode
* any bitmaps in the picture.
* encoder will never be called with a NULL pixelRefOffset.
+ * DEPRECATED - use serialize(SkWStream*, SkPixelSerializer* serializer)
+ * instead.
+ */
+ void serialize(SkWStream* wStream, EncodeBitmap encoder) const;
+#endif
+
+ /**
+ * Serialize to a stream. If non NULL, serializer will be used to serialize
+ * any bitmaps in the picture.
+ *
+ * TODO: Use serializer to serialize SkImages as well.
*/
- void serialize(SkWStream*, EncodeBitmap encoder = NULL) const;
+ void serialize(SkWStream*, SkPixelSerializer* serializer = NULL) const;
/**
* Serialize to a buffer.
« no previous file with comments | « gyp/skia_for_chromium_defines.gypi ('k') | include/core/SkPixelSerializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698