diff options
author | 2016-10-27 09:30:08 -0700 | |
---|---|---|
committer | 2016-10-27 09:30:08 -0700 | |
commit | 6bd5284415bd983b0628c4941dff5def40018f5a (patch) | |
tree | 7de7e45431f76db69807204ecdce3ed6fcc4d9e8 /gm/image_pict.cpp | |
parent | 56380524d903f27627a75e2e1189463999725008 (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/image_pict.cpp')
-rw-r--r-- | gm/image_pict.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
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 } |