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

Unified Diff: include/core/SkImageGenerator.h

Issue 1556333004: take gr-context parameter to refEncoded, indicating a desire for only gpu-specific formats (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 | src/core/SkImageCacherator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImageGenerator.h
diff --git a/include/core/SkImageGenerator.h b/include/core/SkImageGenerator.h
index 66db5e4884275257947d18a5e2f27b3c17dbd483..be9f932faf5d74ac1ef4a2d397bb571014952a30 100644
--- a/include/core/SkImageGenerator.h
+++ b/include/core/SkImageGenerator.h
@@ -22,6 +22,12 @@ class SkMatrix;
class SkPaint;
class SkPicture;
+#ifdef SK_SUPPORT_LEGACY_REFENCODEDDATA_NOCTX
+ #define SK_REFENCODEDDATA_CTXPARAM
+#else
+ #define SK_REFENCODEDDATA_CTXPARAM GrContext* ctx
+#endif
+
/**
* Takes ownership of SkImageGenerator. If this method fails for
* whatever reason, it will return false and immediatetely delete
@@ -69,7 +75,13 @@ public:
* If non-NULL is returned, the caller is responsible for calling
* unref() on the data when it is finished.
*/
- SkData* refEncodedData() { return this->onRefEncodedData(); }
+ SkData* refEncodedData(GrContext* ctx = nullptr) {
+#ifdef SK_SUPPORT_LEGACY_REFENCODEDDATA_NOCTX
+ return this->onRefEncodedData();
+#else
+ return this->onRefEncodedData(ctx);
+#endif
+ }
/**
* Return the ImageInfo associated with this generator.
@@ -230,7 +242,7 @@ public:
protected:
SkImageGenerator(const SkImageInfo& info);
- virtual SkData* onRefEncodedData();
+ virtual SkData* onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM);
virtual bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
SkPMColor ctable[], int* ctableCount);
« no previous file with comments | « no previous file | src/core/SkImageCacherator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698