| Index: src/gpu/GrYUVProvider.cpp
|
| diff --git a/src/gpu/GrYUVProvider.cpp b/src/gpu/GrYUVProvider.cpp
|
| index 93859483ad47ce0e7949021bfc35ed30ae55cc03..fc8141c5d43563bb5fd23253291af7ace2832c7a 100644
|
| --- a/src/gpu/GrYUVProvider.cpp
|
| +++ b/src/gpu/GrYUVProvider.cpp
|
| @@ -103,10 +103,13 @@ GrTexture* GrYUVProvider::refAsTexture(GrContext* ctx, const GrSurfaceDesc& desc
|
| yuvTextures[i].reset(ctx->textureProvider()->createApproxTexture(yuvDesc));
|
| }
|
| if (!yuvTextures[i] ||
|
| - !yuvTextures[i]->writePixels(0, 0, yuvDesc.fWidth, yuvDesc.fHeight,
|
| + !yuvTextures[i]->writePixels(NULL, 0, 0, yuvDesc.fWidth, yuvDesc.fHeight,
|
| yuvDesc.fConfig, planes[i], yuvInfo.fRowBytes[i])) {
|
| return nullptr;
|
| - }
|
| + }
|
| +
|
| + yuvTextures[i]->setFromRawPixels(true);
|
| + yuvTextures[i]->setException(true);
|
| }
|
|
|
| GrSurfaceDesc rtDesc = desc;
|
| @@ -117,6 +120,9 @@ GrTexture* GrYUVProvider::refAsTexture(GrContext* ctx, const GrSurfaceDesc& desc
|
| return nullptr;
|
| }
|
|
|
| + // We're rendering to this guy but he is actually coming from raw pixels
|
| + result->fException2 = true;
|
| +
|
| GrRenderTarget* renderTarget = result->asRenderTarget();
|
| SkASSERT(renderTarget);
|
|
|
| @@ -126,7 +132,8 @@ GrTexture* GrYUVProvider::refAsTexture(GrContext* ctx, const GrSurfaceDesc& desc
|
| yuvTextures[1],
|
| yuvTextures[2],
|
| yuvInfo.fSize,
|
| - yuvInfo.fColorSpace));
|
| + yuvInfo.fColorSpace,
|
| + renderTarget));
|
| paint.addColorFragmentProcessor(yuvToRgbProcessor);
|
| const SkRect r = SkRect::MakeIWH(yuvInfo.fSize[0].fWidth, yuvInfo.fSize[0].fHeight);
|
|
|
|
|