Remove asTextureRef from SkSpecialImage & update effects accordingly (take 2)
This CL also renames SkSpecialImage::asTextureProxy to asTextureProxyRef
This is a reland of: https://skia-review.googlesource.com/c/7995/ (Remove asTextureRef from SkSpecialImage & update effects accordingly)
It should be good to land since https://skia-review.googlesource.com/c/8701/ (Replace SkSpecialImage::makeTightSubset with asImage (take 2)) fixes the Chrome-side issue
Change-Id: I3d88b2b3d23fd69f3fb914a69dacca96cbc038a4
Reviewed-on: https://skia-review.googlesource.com/8450
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/core/SkSpecialImage.cpp b/src/core/SkSpecialImage.cpp
index 60259bb..7d6dc66 100644
--- a/src/core/SkSpecialImage.cpp
+++ b/src/core/SkSpecialImage.cpp
@@ -51,8 +51,7 @@
virtual SkColorSpace* onGetColorSpace() const = 0;
#if SK_SUPPORT_GPU
- virtual sk_sp<GrTexture> onAsTextureRef(GrContext* context) const = 0;
- virtual sk_sp<GrTextureProxy> onAsTextureProxy(GrContext* context) const = 0;
+ virtual sk_sp<GrTextureProxy> onAsTextureProxyRef(GrContext* context) const = 0;
#endif
virtual sk_sp<SkSpecialImage> onMakeSubset(const SkIRect& subset) const = 0;
@@ -148,12 +147,8 @@
}
#if SK_SUPPORT_GPU
-sk_sp<GrTexture> SkSpecialImage::asTextureRef(GrContext* context) const {
- return as_SIB(this)->onAsTextureRef(context);
-}
-
-sk_sp<GrTextureProxy> SkSpecialImage::asTextureProxy(GrContext* context) const {
- return as_SIB(this)->onAsTextureProxy(context);
+sk_sp<GrTextureProxy> SkSpecialImage::asTextureProxyRef(GrContext* context) const {
+ return as_SIB(this)->onAsTextureProxyRef(context);
}
#endif
@@ -252,16 +247,7 @@
}
#if SK_SUPPORT_GPU
- sk_sp<GrTexture> onAsTextureRef(GrContext* context) const override {
- if (context) {
- return sk_ref_sp(GrRefCachedBitmapTexture(context, fBitmap,
- GrSamplerParams::ClampNoFilter(), nullptr));
- }
-
- return nullptr;
- }
-
- sk_sp<GrTextureProxy> onAsTextureProxy(GrContext* context) const override {
+ sk_sp<GrTextureProxy> onAsTextureProxyRef(GrContext* context) const override {
if (context) {
return GrMakeCachedBitmapProxy(context, fBitmap);
}
@@ -437,12 +423,7 @@
GrContext* onGetContext() const override { return fContext; }
- // This entry point should go away in favor of asTextureProxy
- sk_sp<GrTexture> onAsTextureRef(GrContext* context) const override {
- return sk_ref_sp(fTextureProxy->instantiate(context->textureProvider()));
- }
-
- sk_sp<GrTextureProxy> onAsTextureProxy(GrContext*) const override {
+ sk_sp<GrTextureProxy> onAsTextureProxyRef(GrContext*) const override {
return fTextureProxy;
}