take gr-context parameter to refEncoded, indicating a desire for only gpu-specific formats
Prime motivator:
- we always call refEncoded on the generator when trying to upload
- we call it *before* we ask for raster or YUV
- for blink, this call can be very slow, as they have to cons-up their SkData the first time (and grab a mutex to do it)
- this parameter will indicate to them that we're only interested in gpu formats, which they will know if they have.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1556333004
Review URL: https://codereview.chromium.org/1556333004
diff --git a/src/image/SkImage_Base.h b/src/image/SkImage_Base.h
index 321dcaa..4689abb 100644
--- a/src/image/SkImage_Base.h
+++ b/src/image/SkImage_Base.h
@@ -51,7 +51,8 @@
virtual SkImage* onNewSubset(const SkIRect&) const = 0;
- virtual SkData* onRefEncoded() const { return nullptr; }
+ // If a ctx is specified, then only gpu-specific formats are requested.
+ virtual SkData* onRefEncoded(GrContext*) const { return nullptr; }
virtual bool onAsLegacyBitmap(SkBitmap*, LegacyBitmapMode) const;