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

Unified Diff: include/core/SkImageDeserializer.h

Issue 2187613002: Deserialize pictures with custom image-deserializer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix build Created 4 years, 4 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 | « no previous file | include/core/SkPicture.h » ('j') | include/core/SkPicture.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImageDeserializer.h
diff --git a/include/core/SkImageDeserializer.h b/include/core/SkImageDeserializer.h
new file mode 100644
index 0000000000000000000000000000000000000000..444c35ded2d4a2c839d3cb79156e2afec3e0b66c
--- /dev/null
+++ b/include/core/SkImageDeserializer.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkImageDeserializer_DEFINED
+#define SkImageDeserializer_DEFINED
+
+#include "SkRefCnt.h"
+
+struct SkIRect;
+class SkData;
+class SkImage;
+
+class SK_API SkImageDeserializer {
+public:
+ virtual ~SkImageDeserializer() {}
+
+ /**
+ * Given a data containing serialized content, return an SkImage from it.
+ *
+ * The default implementation is to call SkImage::MakeFromEncoded(...)
+ */
+ virtual sk_sp<SkImage> deserialize(sk_sp<SkData>, const SkIRect* subset);
mtklein 2016/08/10 21:48:31 const sk_sp<SkData>& ? Passing by value (i.e. alw
reed1 2016/08/10 23:43:19 Happy to go either way. Will switch to pointer.
+};
+
+#endif
« no previous file with comments | « no previous file | include/core/SkPicture.h » ('j') | include/core/SkPicture.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698