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

Unified Diff: src/gpu/SkGr.cpp

Issue 516463005: Add support for the Rec601 YUV color space to GrYUVtoRGBEffect. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use float literals to make VS happy Created 6 years, 3 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 | « src/core/SkPixelRef.cpp ('k') | src/gpu/effects/GrYUVtoRGBEffect.h » ('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 73773b00d144c532b802af8b99d1e91f991d70d2..56f3a16b6dceb8525e70e482cb9eaf264d98cc7a 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -222,7 +222,7 @@ static GrTexture *load_yuv_texture(GrContext* ctx, bool cache, const GrTexturePa
const SkBitmap& bm, const GrTextureDesc& desc) {
SkPixelRef* pixelRef = bm.pixelRef();
SkISize yuvSizes[3];
- if ((NULL == pixelRef) || !pixelRef->getYUV8Planes(yuvSizes, NULL, NULL)) {
+ if ((NULL == pixelRef) || !pixelRef->getYUV8Planes(yuvSizes, NULL, NULL, NULL)) {
return NULL;
}
@@ -239,8 +239,10 @@ static GrTexture *load_yuv_texture(GrContext* ctx, bool cache, const GrTexturePa
planes[1] = (uint8_t*)planes[0] + sizes[0];
planes[2] = (uint8_t*)planes[1] + sizes[1];
+ SkYUVColorSpace colorSpace;
+
// Get the YUV planes
- if (!pixelRef->getYUV8Planes(yuvSizes, planes, rowBytes)) {
+ if (!pixelRef->getYUV8Planes(yuvSizes, planes, rowBytes, &colorSpace)) {
return NULL;
}
@@ -269,7 +271,8 @@ static GrTexture *load_yuv_texture(GrContext* ctx, bool cache, const GrTexturePa
GrRenderTarget* renderTarget = result ? result->asRenderTarget() : NULL;
if (renderTarget) {
SkAutoTUnref<GrEffect> yuvToRgbEffect(GrYUVtoRGBEffect::Create(
- yuvTextures[0].texture(), yuvTextures[1].texture(), yuvTextures[2].texture()));
+ yuvTextures[0].texture(), yuvTextures[1].texture(), yuvTextures[2].texture(),
+ colorSpace));
GrPaint paint;
paint.addColorEffect(yuvToRgbEffect);
SkRect r = SkRect::MakeWH(SkIntToScalar(yuvSizes[0].fWidth),
« no previous file with comments | « src/core/SkPixelRef.cpp ('k') | src/gpu/effects/GrYUVtoRGBEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698