aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-08-23 14:02:54 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-23 14:02:54 -0700
commit19fe41e85e6ce3e78b3a69fce1cf28edf937027d (patch)
tree79a2171ccb175dcd4229146c4b03d28af412fcb9 /src
parent457b42a6398020c3791f62f8c8637653e0d39bcc (diff)
Remove SkPixelRef::getTexture()
Diffstat (limited to 'src')
-rw-r--r--src/core/SkBitmapDevice.cpp10
-rw-r--r--src/core/SkImagePriv.h2
-rw-r--r--src/image/SkImage.cpp17
-rw-r--r--src/image/SkImage_Gpu.cpp16
4 files changed, 2 insertions, 43 deletions
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> SkImage::MakeFromBitmap(const SkBitmap& bm) {
return nullptr;
}
-#if SK_SUPPORT_GPU
- if (GrTexture* tex = pr->getTexture()) {
- SkAutoTUnref<GrTexture> 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<SkImage_Gpu>(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> 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> SkImage::MakeTextureFromMipMap(GrContext* ctx, const SkImageInfo& info,
const GrMipLevel* texels, int mipLevelCount,
SkBudgeted budgeted) {