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

Unified Diff: src/gpu/SkGr.cpp

Issue 973563002: Adding linear interpolation to rgb->yuv conversion (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Only use Exact when necessary Created 5 years, 10 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 | « no previous file | src/gpu/effects/GrYUVtoRGBEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGr.cpp
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index ff6f7fa098ed47cd254d82b9f1edafed023e3655..d10541837795df00a202eeaf6d0ccebfee488480 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -365,8 +365,12 @@ static GrTexture* load_yuv_texture(GrContext* ctx, const GrUniqueKey& optionalKe
for (int i = 0; i < 3; ++i) {
yuvDesc.fWidth = yuvInfo.fSize[i].fWidth;
yuvDesc.fHeight = yuvInfo.fSize[i].fHeight;
- yuvTextures[i].reset(
- ctx->refScratchTexture(yuvDesc, GrContext::kApprox_ScratchTexMatch));
+ bool needsExactTexture =
+ (yuvDesc.fWidth != yuvInfo.fSize[0].fWidth) ||
+ (yuvDesc.fHeight != yuvInfo.fSize[0].fHeight);
+ yuvTextures[i].reset(ctx->refScratchTexture(yuvDesc,
+ needsExactTexture ? GrContext::kExact_ScratchTexMatch :
+ GrContext::kApprox_ScratchTexMatch));
if (!yuvTextures[i] ||
!yuvTextures[i]->writePixels(0, 0, yuvDesc.fWidth, yuvDesc.fHeight,
yuvDesc.fConfig, planes[i], yuvInfo.fRowBytes[i])) {
« no previous file with comments | « no previous file | src/gpu/effects/GrYUVtoRGBEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698