diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkImageFilter.cpp | 13 | ||||
-rw-r--r-- | src/core/SkSpecialImage.cpp | 40 | ||||
-rw-r--r-- | src/core/SkSpecialImage.h | 11 |
3 files changed, 2 insertions, 62 deletions
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp index 524a475b71..1a4c876d61 100644 --- a/src/core/SkImageFilter.cpp +++ b/src/core/SkImageFilter.cpp @@ -596,18 +596,7 @@ SkSpecialImage* SkImageFilter::filterInput(int index, return SkRef(src); } - SkAutoTUnref<SkSpecialImage> result(input->filterImage(src, this->mapContext(ctx), offset)); - -#if SK_SUPPORT_GPU - if (src->peekTexture() && !result->peekTexture()) { - // Keep the result on the GPU - this is still required for some - // image filters that don't support GPU in all cases - GrContext* context = src->peekTexture()->getContext(); - return result->makeTextureImage(src->internal_getProxy(), context).release(); - } -#endif - - return result.release(); + return input->filterImage(src, this->mapContext(ctx), offset); } #if SK_SUPPORT_GPU diff --git a/src/core/SkSpecialImage.cpp b/src/core/SkSpecialImage.cpp index 991e163515..e90c655a58 100644 --- a/src/core/SkSpecialImage.cpp +++ b/src/core/SkSpecialImage.cpp @@ -4,16 +4,10 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file */ -#include "SkSpecialImage.h" - -#if SK_SUPPORT_GPU -#include "GrTexture.h" -#include "GrTextureParams.h" -#include "SkGr.h" -#endif #include "SkCanvas.h" #include "SkImage_Base.h" +#include "SkSpecialImage.h" #include "SkSpecialSurface.h" /////////////////////////////////////////////////////////////////////////////// @@ -48,38 +42,6 @@ static inline const SkSpecialImage_Base* as_SIB(const SkSpecialImage* image) { return static_cast<const SkSpecialImage_Base*>(image); } -sk_sp<SkSpecialImage> SkSpecialImage::makeTextureImage(SkImageFilter::Proxy* proxy, - GrContext* context) { -#if SK_SUPPORT_GPU - if (!context) { - return nullptr; - } - if (GrTexture* peek = as_SIB(this)->peekTexture()) { - return peek->getContext() == context ? sk_sp<SkSpecialImage>(SkRef(this)) : nullptr; - } - - SkBitmap bmp; - if (!this->internal_getBM(&bmp)) { - return nullptr; - } - - SkAutoTUnref<GrTexture> resultTex( - GrRefCachedBitmapTexture(context, bmp, GrTextureParams::ClampNoFilter())); - if (!resultTex) { - return nullptr; - } - - SkAlphaType at = this->isOpaque() ? kOpaque_SkAlphaType : kPremul_SkAlphaType; - - return SkSpecialImage::MakeFromGpu(proxy, - SkIRect::MakeWH(resultTex->width(), resultTex->height()), - this->uniqueID(), - resultTex, at); -#else - return nullptr; -#endif -} - void SkSpecialImage::draw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* paint) const { return as_SIB(this)->onDraw(canvas, x, y, paint); } diff --git a/src/core/SkSpecialImage.h b/src/core/SkSpecialImage.h index 47ad6ccab7..1a01a5abc7 100644 --- a/src/core/SkSpecialImage.h +++ b/src/core/SkSpecialImage.h @@ -14,16 +14,12 @@ // remove this when internal_getProxy goes away (see skbug.com/4965) #include "SkImageFilter.h" -#include "SkImageInfo.h" // for SkAlphaType - -class GrContext; class GrTexture; class SkBitmap; class SkCanvas; class SkImage; struct SkImageInfo; class SkPaint; -class SkPixmap; class SkSpecialSurface; enum { @@ -55,13 +51,6 @@ public: virtual size_t getSize() const = 0; /** - * Ensures that a special image is backed by a texture (when GrContext is non-null). If no - * transformation is required, the returned image may be the same as this special image. - * If this special image is from a different GrContext, this will fail. - */ - sk_sp<SkSpecialImage> makeTextureImage(SkImageFilter::Proxy*, GrContext*); - - /** * Draw this SpecialImage into the canvas. */ void draw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) const; |