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

Unified Diff: src/gpu/GrTextureToYUVPlanes.cpp

Issue 1918003003: Bring sk_sp to GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 8 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
Index: src/gpu/GrTextureToYUVPlanes.cpp
diff --git a/src/gpu/GrTextureToYUVPlanes.cpp b/src/gpu/GrTextureToYUVPlanes.cpp
index 6a8d7b6676e43a684c92e936419289a4b192cdd1..a8eec6365c281e9b8117b5d1b773682c2a223ac3 100644
--- a/src/gpu/GrTextureToYUVPlanes.cpp
+++ b/src/gpu/GrTextureToYUVPlanes.cpp
@@ -117,49 +117,49 @@ bool GrTextureToYUVPlanes(GrTexture* texture, const SkISize sizes[3], void* cons
// Do all the draws before any readback.
if (yuvTex) {
- SkAutoTUnref<GrDrawContext> dc(context->drawContext(yuvTex->asRenderTarget()));
+ sk_sp<GrDrawContext> dc(context->drawContext(sk_ref_sp(yuvTex->asRenderTarget())));
if (!dc) {
return false;
}
- if (!convert_texture(texture, dc, sizes[0].fWidth, sizes[0].fHeight, colorSpace,
+ if (!convert_texture(texture, dc.get(), sizes[0].fWidth, sizes[0].fHeight, colorSpace,
GrYUVEffect::CreateRGBToYUV)) {
return false;
}
} else {
SkASSERT(yTex);
- SkAutoTUnref<GrDrawContext> dc(context->drawContext(yTex->asRenderTarget()));
+ sk_sp<GrDrawContext> dc(context->drawContext(sk_ref_sp(yTex->asRenderTarget())));
if (!dc) {
return false;
}
- if (!convert_texture(texture, dc, sizes[0].fWidth, sizes[0].fHeight, colorSpace,
+ if (!convert_texture(texture, dc.get(), sizes[0].fWidth, sizes[0].fHeight, colorSpace,
GrYUVEffect::CreateRGBToY)) {
return false;
}
if (uvTex) {
- dc.reset(context->drawContext(uvTex->asRenderTarget()));
+ dc = context->drawContext(sk_ref_sp(uvTex->asRenderTarget()));
if (!dc) {
return false;
}
- if (!convert_texture(texture, dc, sizes[1].fWidth, sizes[1].fHeight,
+ if (!convert_texture(texture, dc.get(), sizes[1].fWidth, sizes[1].fHeight,
colorSpace, GrYUVEffect::CreateRGBToUV)) {
return false;
}
} else {
SkASSERT(uTex && vTex);
- dc.reset(context->drawContext(uTex->asRenderTarget()));
+ dc = context->drawContext(sk_ref_sp(uTex->asRenderTarget()));
if (!dc) {
return false;
}
- if (!convert_texture(texture, dc, sizes[1].fWidth, sizes[1].fHeight,
+ if (!convert_texture(texture, dc.get(), sizes[1].fWidth, sizes[1].fHeight,
colorSpace, GrYUVEffect::CreateRGBToU)) {
return false;
}
- dc.reset(context->drawContext(vTex->asRenderTarget()));
+ dc = context->drawContext(sk_ref_sp(vTex->asRenderTarget()));
if (!dc) {
return false;
}
- if (!convert_texture(texture, dc, sizes[2].fWidth, sizes[2].fHeight,
+ if (!convert_texture(texture, dc.get(), sizes[2].fWidth, sizes[2].fHeight,
colorSpace, GrYUVEffect::CreateRGBToV)) {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698