aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2016-10-27 09:30:08 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-10-27 09:30:08 -0700
commit6bd5284415bd983b0628c4941dff5def40018f5a (patch)
tree7de7e45431f76db69807204ecdce3ed6fcc4d9e8 /gm
parent56380524d903f27627a75e2e1189463999725008 (diff)
Remove SkAutoTUnref and SkAutoTDelete from public includes.
This also makes the required changed to src, tests, and tools. The few public APIs modified by this change appear to be unused outside of Skia. Removing these from the public API makes it easier to ensure users are no longer using them. This also updates GrGpu::wrapBackendXXX and the ::onWrapBackendXXX methods to clarify ownership. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2448593002 Review-Url: https://codereview.chromium.org/2448593002
Diffstat (limited to 'gm')
-rw-r--r--gm/deferredtextureimage.cpp4
-rw-r--r--gm/image_pict.cpp19
2 files changed, 12 insertions, 11 deletions
diff --git a/gm/deferredtextureimage.cpp b/gm/deferredtextureimage.cpp
index 087c4eb686..1043c1b6d6 100644
--- a/gm/deferredtextureimage.cpp
+++ b/gm/deferredtextureimage.cpp
@@ -22,7 +22,7 @@ static void DrawDeferredTextureImageData(SkCanvas* canvas,
skiagm::GM::DrawGpuOnlyMessage(canvas);
return;
}
- SkAutoTUnref<GrContextThreadSafeProxy> proxy(context->threadSafeProxy());
+ sk_sp<GrContextThreadSafeProxy> proxy(context->threadSafeProxy());
@@ -80,7 +80,7 @@ static void DrawDeferredTextureImageMipMapTree(SkCanvas* canvas, SkImage* image,
skiagm::GM::DrawGpuOnlyMessage(canvas);
return;
}
- SkAutoTUnref<GrContextThreadSafeProxy> proxy(context->threadSafeProxy());
+ sk_sp<GrContextThreadSafeProxy> proxy(context->threadSafeProxy());
SkPaint paint;
paint.setFilterQuality(params->fQuality);
diff --git a/gm/image_pict.cpp b/gm/image_pict.cpp
index e8cd5e0748..f88a20ba27 100644
--- a/gm/image_pict.cpp
+++ b/gm/image_pict.cpp
@@ -314,10 +314,10 @@ protected:
static void draw_as_tex(SkCanvas* canvas, SkImageCacherator* cache, SkScalar x, SkScalar y) {
#if SK_SUPPORT_GPU
- SkAutoTUnref<GrTexture> texture(cache->lockAsTexture(canvas->getGrContext(),
- GrTextureParams::ClampBilerp(),
- SkSourceGammaTreatment::kRespect,
- nullptr));
+ sk_sp<GrTexture> texture(cache->lockAsTexture(canvas->getGrContext(),
+ GrTextureParams::ClampBilerp(),
+ SkSourceGammaTreatment::kRespect,
+ nullptr));
if (!texture) {
// show placeholder if we have no texture
SkPaint paint;
@@ -330,11 +330,12 @@ protected:
return;
}
// No API to draw a GrTexture directly, so we cheat and create a private image subclass
- SkAutoTUnref<SkImage> image(new SkImage_Gpu(cache->info().width(), cache->info().height(),
- cache->uniqueID(), kPremul_SkAlphaType, texture,
- sk_ref_sp(cache->info().colorSpace()),
- SkBudgeted::kNo));
- canvas->drawImage(image, x, y);
+ sk_sp<SkImage> image(new SkImage_Gpu(cache->info().width(), cache->info().height(),
+ cache->uniqueID(), kPremul_SkAlphaType,
+ std::move(texture),
+ sk_ref_sp(cache->info().colorSpace()),
+ SkBudgeted::kNo));
+ canvas->drawImage(image.get(), x, y);
#endif
}