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

Side by Side Diff: src/gpu/GrYUVProvider.cpp

Issue 1918003003: Bring sk_sp to GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrContext.h" 8 #include "GrContext.h"
9 #include "GrDrawContext.h" 9 #include "GrDrawContext.h"
10 #include "GrYUVProvider.h" 10 #include "GrYUVProvider.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 GrYUVEffect::CreateYUVToRGB(yuvTextures[ 0], 130 GrYUVEffect::CreateYUVToRGB(yuvTextures[ 0],
131 yuvTextures[ 1], 131 yuvTextures[ 1],
132 yuvTextures[ 2], 132 yuvTextures[ 2],
133 yuvInfo.fSiz eInfo.fSizes, 133 yuvInfo.fSiz eInfo.fSizes,
134 yuvInfo.fCol orSpace)); 134 yuvInfo.fCol orSpace));
135 paint.addColorFragmentProcessor(yuvToRgbProcessor); 135 paint.addColorFragmentProcessor(yuvToRgbProcessor);
136 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); 136 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
137 const SkRect r = SkRect::MakeIWH(yuvInfo.fSizeInfo.fSizes[SkYUVSizeInfo::kY] .fWidth, 137 const SkRect r = SkRect::MakeIWH(yuvInfo.fSizeInfo.fSizes[SkYUVSizeInfo::kY] .fWidth,
138 yuvInfo.fSizeInfo.fSizes[SkYUVSizeInfo::kY].fHeight); 138 yuvInfo.fSizeInfo.fSizes[SkYUVSizeInfo::kY].fHeight);
139 139
140 SkAutoTUnref<GrDrawContext> drawContext(ctx->drawContext(renderTarget)); 140 sk_sp<GrDrawContext> drawContext(ctx->drawContext(sk_ref_sp(renderTarget)));
141 if (!drawContext) { 141 if (!drawContext) {
142 return nullptr; 142 return nullptr;
143 } 143 }
144 144
145 drawContext->drawRect(GrClip::WideOpen(), paint, SkMatrix::I(), r); 145 drawContext->drawRect(GrClip::WideOpen(), paint, SkMatrix::I(), r);
146 146
147 return result.release(); 147 return result.release();
148 } 148 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698