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

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

Issue 922273002: YUV scale fix (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Attempted Win fix 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 unified diff | Download patch
« no previous file with comments | « gm/yuvtorgbeffect.cpp ('k') | src/gpu/effects/GrYUVtoRGBEffect.h » ('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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 GrTexture* result = create_texture_for_bmp(ctx, optionalKey, rtDesc, pixelRe f, NULL, 0); 384 GrTexture* result = create_texture_for_bmp(ctx, optionalKey, rtDesc, pixelRe f, NULL, 0);
385 if (!result) { 385 if (!result) {
386 return NULL; 386 return NULL;
387 } 387 }
388 388
389 GrRenderTarget* renderTarget = result->asRenderTarget(); 389 GrRenderTarget* renderTarget = result->asRenderTarget();
390 SkASSERT(renderTarget); 390 SkASSERT(renderTarget);
391 391
392 SkAutoTUnref<GrFragmentProcessor> 392 SkAutoTUnref<GrFragmentProcessor>
393 yuvToRgbProcessor(GrYUVtoRGBEffect::Create(yuvTextures[0], yuvTextures[1 ], yuvTextures[2], 393 yuvToRgbProcessor(GrYUVtoRGBEffect::Create(yuvTextures[0], yuvTextures[1 ], yuvTextures[2],
394 yuvInfo.fColorSpace)); 394 yuvInfo.fSize, yuvInfo.fColor Space));
395 GrPaint paint; 395 GrPaint paint;
396 paint.addColorProcessor(yuvToRgbProcessor); 396 paint.addColorProcessor(yuvToRgbProcessor);
397 SkRect r = SkRect::MakeWH(SkIntToScalar(yuvInfo.fSize[0].fWidth), 397 SkRect r = SkRect::MakeWH(SkIntToScalar(yuvInfo.fSize[0].fWidth),
398 SkIntToScalar(yuvInfo.fSize[0].fHeight)); 398 SkIntToScalar(yuvInfo.fSize[0].fHeight));
399 GrContext::AutoRenderTarget autoRT(ctx, renderTarget); 399 GrContext::AutoRenderTarget autoRT(ctx, renderTarget);
400 GrContext::AutoClip ac(ctx, GrContext::AutoClip::kWideOpen_InitialClip); 400 GrContext::AutoClip ac(ctx, GrContext::AutoClip::kWideOpen_InitialClip);
401 ctx->drawRect(paint, SkMatrix::I(), r); 401 ctx->drawRect(paint, SkMatrix::I(), r);
402 402
403 return result; 403 return result;
404 } 404 }
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol or, &fp) && fp) { 723 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol or, &fp) && fp) {
724 grPaint->addColorProcessor(fp)->unref(); 724 grPaint->addColorProcessor(fp)->unref();
725 constantColor = false; 725 constantColor = false;
726 } 726 }
727 } 727 }
728 728
729 // The grcolor is automatically set when calling asFragmentProcessor. 729 // The grcolor is automatically set when calling asFragmentProcessor.
730 // If the shader can be seen as an effect it returns true and adds its effec t to the grpaint. 730 // If the shader can be seen as an effect it returns true and adds its effec t to the grpaint.
731 SkPaint2GrPaintNoShader(context, skPaint, paintColor, constantColor, grPaint ); 731 SkPaint2GrPaintNoShader(context, skPaint, paintColor, constantColor, grPaint );
732 } 732 }
OLDNEW
« no previous file with comments | « gm/yuvtorgbeffect.cpp ('k') | src/gpu/effects/GrYUVtoRGBEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698