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

Side by Side 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: Switched YUV textures from Approx to Exact Created 5 years, 9 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
« no previous file with comments | « no previous file | src/gpu/effects/GrYUVtoRGBEffect.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2010 Google Inc. 2 * Copyright 2010 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 "SkGr.h" 8 #include "SkGr.h"
9 9
10 #include "GrXferProcessor.h" 10 #include "GrXferProcessor.h"
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 } 359 }
360 } 360 }
361 361
362 GrSurfaceDesc yuvDesc; 362 GrSurfaceDesc yuvDesc;
363 yuvDesc.fConfig = kAlpha_8_GrPixelConfig; 363 yuvDesc.fConfig = kAlpha_8_GrPixelConfig;
364 SkAutoTUnref<GrTexture> yuvTextures[3]; 364 SkAutoTUnref<GrTexture> yuvTextures[3];
365 for (int i = 0; i < 3; ++i) { 365 for (int i = 0; i < 3; ++i) {
366 yuvDesc.fWidth = yuvInfo.fSize[i].fWidth; 366 yuvDesc.fWidth = yuvInfo.fSize[i].fWidth;
367 yuvDesc.fHeight = yuvInfo.fSize[i].fHeight; 367 yuvDesc.fHeight = yuvInfo.fSize[i].fHeight;
368 yuvTextures[i].reset( 368 yuvTextures[i].reset(
369 ctx->refScratchTexture(yuvDesc, GrContext::kApprox_ScratchTexMatch)) ; 369 ctx->refScratchTexture(yuvDesc, GrContext::kExact_ScratchTexMatch));
bsalomon 2015/03/05 16:13:05 Maybe only do this if we will use bilerp? Otherwis
sugoi1 2015/03/05 16:22:35 Done.
370 if (!yuvTextures[i] || 370 if (!yuvTextures[i] ||
371 !yuvTextures[i]->writePixels(0, 0, yuvDesc.fWidth, yuvDesc.fHeight, 371 !yuvTextures[i]->writePixels(0, 0, yuvDesc.fWidth, yuvDesc.fHeight,
372 yuvDesc.fConfig, planes[i], yuvInfo.fRo wBytes[i])) { 372 yuvDesc.fConfig, planes[i], yuvInfo.fRo wBytes[i])) {
373 return NULL; 373 return NULL;
374 } 374 }
375 } 375 }
376 376
377 GrSurfaceDesc rtDesc = desc; 377 GrSurfaceDesc rtDesc = desc;
378 rtDesc.fFlags = rtDesc.fFlags | kRenderTarget_GrSurfaceFlag; 378 rtDesc.fFlags = rtDesc.fFlags | kRenderTarget_GrSurfaceFlag;
379 379
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol or, &fp) && fp) { 716 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol or, &fp) && fp) {
717 grPaint->addColorProcessor(fp)->unref(); 717 grPaint->addColorProcessor(fp)->unref();
718 constantColor = false; 718 constantColor = false;
719 } 719 }
720 } 720 }
721 721
722 // The grcolor is automatically set when calling asFragmentProcessor. 722 // The grcolor is automatically set when calling asFragmentProcessor.
723 // If the shader can be seen as an effect it returns true and adds its effec t to the grpaint. 723 // If the shader can be seen as an effect it returns true and adds its effec t to the grpaint.
724 SkPaint2GrPaintNoShader(context, rt, skPaint, paintColor, constantColor, grP aint); 724 SkPaint2GrPaintNoShader(context, rt, skPaint, paintColor, constantColor, grP aint);
725 } 725 }
OLDNEW
« 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