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

Unified Diff: src/gpu/GrYUVProvider.cpp

Issue 1225923010: Refugee from Dead Machine 4: MDB Monster Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Last update from dead machine Created 4 years, 8 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/gpu/GrXferProcessor.cpp ('k') | src/gpu/SkGpuDevice.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/gpu/GrXferProcessor.cpp ('k') | src/gpu/SkGpuDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698