diff options
author | 2017-01-31 11:31:39 -0500 | |
---|---|---|
committer | 2017-01-31 17:22:38 +0000 | |
commit | 6de99041f13e87ed440f7db13a07693c6c4c461a (patch) | |
tree | 560cfdcc0efb88cd82f04b2c9b0219f2f3d07c71 /src/core | |
parent | 6d3b7aaf79b2cbacdf00bafc15ded2dfd2fa000a (diff) |
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>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkSpecialImage.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/SkSpecialImage.cpp b/src/core/SkSpecialImage.cpp index 8b2801ebb7..1d1a557383 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 @@ sk_sp<SkSpecialImage> SkSpecialImage::MakeFromImage(const SkIRect& subset, 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 @@ sk_sp<SkSpecialImage> SkSpecialImage::MakeFromRaster(const SkIRect& subset, #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) { |