From 46da1cc9f20c277f7789355038d426931195aa65 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Tue, 14 Feb 2017 14:15:48 -0500 Subject: GrContext option to prevent GPU based YUV -> RGB Rob and I spent a long time debugging why this wasn't working for Flutter - doing the more complex operations on the loading thread produces a blank texture when it's used later on the drawing thread. Limiting ourselves to just creating and uploading RGBA data fixes that. We need to debug what's going wrong, but in the meantime, this lets Flutter use Skia APIs to manage GPU uploading and lifetime of texture-backed images, while still doing those uploads on their IO thread. BUG=skia: Change-Id: Ibf5c37f2439814544beab8c93c2a646f7a9e779d Reviewed-on: https://skia-review.googlesource.com/8443 Reviewed-by: Robert Phillips Commit-Queue: Brian Osman --- src/gpu/GrContext.cpp | 1 + src/gpu/GrContextPriv.h | 2 ++ 2 files changed, 3 insertions(+) (limited to 'src/gpu') diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 4b67d5466b..1001110614 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -91,6 +91,7 @@ void GrContext::initCommon(const GrContextOptions& options) { fResourceCache = new GrResourceCache(fCaps); fResourceProvider = new GrResourceProvider(fGpu, fResourceCache, &fSingleOwner); + fDisableGpuYUVConversion = options.fDisableGpuYUVConversion; fDidTestPMConversions = false; GrRenderTargetOpList::Options rtOpListOptions; diff --git a/src/gpu/GrContextPriv.h b/src/gpu/GrContextPriv.h index 8ad3483e0d..9ee0b9c66f 100644 --- a/src/gpu/GrContextPriv.h +++ b/src/gpu/GrContextPriv.h @@ -57,6 +57,8 @@ public: sk_sp colorSpace, const SkSurfaceProps* = nullptr); + bool disableGpuYUVConversion() const { return fContext->fDisableGpuYUVConversion; } + private: explicit GrContextPriv(GrContext* context) : fContext(context) {} GrContextPriv(const GrContextPriv&) {} // unimpl -- cgit v1.2.3