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_Generator.cpp b/src/image/SkImage_Generator.cpp
index 6671dcd..688b4ff 100644
--- a/src/image/SkImage_Generator.cpp
+++ b/src/image/SkImage_Generator.cpp
@@ -24,7 +24,7 @@
bool onReadPixels(const SkImageInfo&, void*, size_t, int srcX, int srcY, CachingHint) const override;
const void* onPeekPixels(SkImageInfo*, size_t* /*rowBytes*/) const override;
SkImageCacherator* peekCacherator() const override { return fCache; }
- SkData* onRefEncoded() const override;
+ SkData* onRefEncoded(GrContext*) const override;
bool isOpaque() const override { return fCache->info().isOpaque(); }
SkImage* onNewSubset(const SkIRect&) const override;
bool getROPixels(SkBitmap*, CachingHint) const override;
@@ -66,8 +66,8 @@
return NULL;
}
-SkData* SkImage_Generator::onRefEncoded() const {
- return fCache->refEncoded();
+SkData* SkImage_Generator::onRefEncoded(GrContext* ctx) const {
+ return fCache->refEncoded(ctx);
}
bool SkImage_Generator::getROPixels(SkBitmap* bitmap, CachingHint chint) const {