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

Unified Diff: include/core/SkGraphics.h

Issue 1229933003: add runtime option to provide data->imagegenerator factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 5 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
Index: include/core/SkGraphics.h
diff --git a/include/core/SkGraphics.h b/include/core/SkGraphics.h
index ea74c586d2d8f92bef3a4b0d8544e878db1ae9ad..e552633d5f3df3aa32c8532f1aaf1bef8ef4d259 100644
--- a/include/core/SkGraphics.h
+++ b/include/core/SkGraphics.h
@@ -10,6 +10,9 @@
#include "SkTypes.h"
+class SkData;
+class SkImageGenerator;
+
class SK_API SkGraphics {
public:
/**
@@ -140,6 +143,16 @@ public:
* global font cache.
*/
static void SetTLSFontCacheLimit(size_t bytes);
+
+ typedef SkImageGenerator* (*ImageGeneratorFromEncodedFactory)(SkData*);
+
+ /**
+ * To instantiate images from encoded data, first looks at this runtime function-ptr. If it
+ * exists, it is called to create an SkImageGenerator from SkData. If there is no function-ptr
+ * or there is, but it returns NULL, then skia will call its internal default implementation.
+ */
+ static ImageGeneratorFromEncodedFactory GetImageGeneratorFromEncodedFactory();
scroggo 2015/07/09 19:01:15 I do not understand the need for this accessor. Wh
mtklein 2015/07/09 19:04:57 I guess we could merge the two as static ImagGene
reed1 2015/07/09 19:05:45 Not sure what to do here. Having a global is just
+ static void SetImageGeneratorFromEncodedFactory(ImageGeneratorFromEncodedFactory);
};
class SkAutoGraphics {
« no previous file with comments | « gm/mipmap.cpp ('k') | include/core/SkImageGenerator.h » ('j') | include/core/SkImageGenerator.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698