Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Unified Diff: gm/image_pict.cpp

Issue 2448593002: Remove SkAutoTUnref and SkAutoTDelete from public includes. (Closed)
Patch Set: And Vulcan. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/deferredtextureimage.cpp ('k') | include/codec/SkAndroidCodec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/image_pict.cpp
diff --git a/gm/image_pict.cpp b/gm/image_pict.cpp
index e8cd5e0748c42579141076b383731f447cc1a89c..f88a20ba277ea46b0bf752f948701ae925e1d7e1 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
}
« no previous file with comments | « gm/deferredtextureimage.cpp ('k') | include/codec/SkAndroidCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698