Reduce use of SkImage_Base::peekTexture
Change-Id: I079093c9706df4911d47fba04b786e59240e8cb4
Reviewed-on: https://skia-review.googlesource.com/7792
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/core/SkSpecialImage.cpp b/src/core/SkSpecialImage.cpp
index 8b2801e..1d1a557 100644
--- a/src/core/SkSpecialImage.cpp
+++ b/src/core/SkSpecialImage.cpp
@@ -23,6 +23,7 @@
#include "GrTextureProxy.h"
#include "SkGr.h"
#include "SkGrPriv.h"
+#include "SkImage_Gpu.h"
#endif
// Currently the raster imagefilters can only handle certain imageinfos. Call this to know if
@@ -186,9 +187,11 @@
SkASSERT(rect_fits(subset, image->width(), image->height()));
#if SK_SUPPORT_GPU
- if (GrTexture* texture = as_IB(image)->peekTexture()) {
- return MakeFromGpu(subset, image->uniqueID(), sk_ref_sp(texture),
- sk_ref_sp(as_IB(image)->onImageInfo().colorSpace()), props);
+ if (sk_sp<GrTextureProxy> proxy = as_IB(image)->asTextureProxyRef()) {
+ GrContext* context = ((SkImage_Gpu*) as_IB(image))->context();
+
+ return MakeDeferredFromGpu(context, subset, image->uniqueID(), std::move(proxy),
+ sk_ref_sp(as_IB(image)->onImageInfo().colorSpace()), props);
} else
#endif
{
@@ -345,7 +348,6 @@
#if SK_SUPPORT_GPU
///////////////////////////////////////////////////////////////////////////////
#include "GrTexture.h"
-#include "SkImage_Gpu.h"
static sk_sp<SkImage> wrap_proxy_in_image(GrContext* context, GrSurfaceProxy* proxy,
SkAlphaType alphaType, sk_sp<SkColorSpace> colorSpace) {