diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h index 9aa1b71144..2677e5f22d 100644 --- a/include/core/SkPixelRef.h +++ b/include/core/SkPixelRef.h @@ -206,10 +206,6 @@ public: bool requestLock(const LockRequest&, LockResult*); - /** Are we really wrapping a texture instead of a bitmap? - */ - virtual GrTexture* getTexture() { return NULL; } - /** * If this can efficiently return YUV data, this should return true. * Otherwise this returns false and does not modify any of the parameters. diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp index 75eaa963b5..3f3e5fd84e 100644 --- a/src/core/SkBitmapDevice.cpp +++ b/src/core/SkBitmapDevice.cpp @@ -281,14 +281,8 @@ void SkBitmapDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, // since we may need to clamp to the borders of the src rect within // the bitmap, we extract a subset. const SkIRect srcIR = tmpSrc.roundOut(); - if(bitmap.pixelRef()->getTexture()) { - // Accelerated source canvas, don't use extractSubset but readPixels to get the subset. - // This way, the pixels are copied in CPU memory instead of GPU memory. - bitmap.pixelRef()->readPixels(&tmpBitmap, kN32_SkColorType, &srcIR); - } else { - if (!bitmap.extractSubset(&tmpBitmap, srcIR)) { - return; - } + if (!bitmap.extractSubset(&tmpBitmap, srcIR)) { + return; } bitmapPtr = &tmpBitmap; diff --git a/src/core/SkImagePriv.h b/src/core/SkImagePriv.h index 0377762def..8e2f5cecde 100644 --- a/src/core/SkImagePriv.h +++ b/src/core/SkImagePriv.h @@ -75,8 +75,6 @@ extern void SkTextureImageApplyBudgetedDecision(SkImage* textureImage); // surface needs to perform a copy-on-write extern void SkTextureImageSetTexture(SkImage* image, GrTexture* texture); -GrTexture* GrDeepCopyTexture(GrTexture* src, SkBudgeted); - /** * Will attempt to upload and lock the contents of the image as a texture, so that subsequent * draws to a gpu-target will come from that texture (and not by looking at the original image diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp index fa3580c175..6a301c3f24 100644 --- a/src/image/SkImage.cpp +++ b/src/image/SkImage.cpp @@ -296,23 +296,6 @@ sk_sp SkImage::MakeFromBitmap(const SkBitmap& bm) { return nullptr; } -#if SK_SUPPORT_GPU - if (GrTexture* tex = pr->getTexture()) { - SkAutoTUnref unrefCopy; - if (!bm.isImmutable()) { - tex = GrDeepCopyTexture(tex, SkBudgeted::kNo); - if (nullptr == tex) { - return nullptr; - } - unrefCopy.reset(tex); - } - const SkImageInfo info = bm.info(); - return sk_make_sp(info.width(), info.height(), bm.getGenerationID(), - info.alphaType(), tex, sk_ref_sp(info.colorSpace()), - SkBudgeted::kNo); - } -#endif - return SkMakeImageFromRasterBitmap(bm, kIfMutable_SkCopyPixelsMode); } diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp index 6b7416b26b..53765b15a2 100644 --- a/src/image/SkImage_Gpu.cpp +++ b/src/image/SkImage_Gpu.cpp @@ -540,22 +540,6 @@ sk_sp SkImage::MakeFromDeferredTextureImageData(GrContext* context, con /////////////////////////////////////////////////////////////////////////////////////////////////// -GrTexture* GrDeepCopyTexture(GrTexture* src, SkBudgeted budgeted) { - GrContext* ctx = src->getContext(); - - GrSurfaceDesc desc = src->desc(); - GrTexture* dst = ctx->textureProvider()->createTexture(desc, budgeted, nullptr, 0); - if (!dst) { - return nullptr; - } - - const SkIRect srcR = SkIRect::MakeWH(desc.fWidth, desc.fHeight); - const SkIPoint dstP = SkIPoint::Make(0, 0); - ctx->copySurface(dst, src, srcR, dstP); - ctx->flushSurfaceWrites(dst); - return dst; -} - sk_sp SkImage::MakeTextureFromMipMap(GrContext* ctx, const SkImageInfo& info, const GrMipLevel* texels, int mipLevelCount, SkBudgeted budgeted) {