aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-02-14 14:15:48 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-14 20:42:06 +0000
commit46da1cc9f20c277f7789355038d426931195aa65 (patch)
tree4db2c96d3e6252165bd2e5bae9c1bf3ac6f3c5c3 /src/gpu
parent431815dcfb27d26aed11ab6445a9f49b00ebbedb (diff)
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 <robertphillips@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrContext.cpp1
-rw-r--r--src/gpu/GrContextPriv.h2
2 files changed, 3 insertions, 0 deletions
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<SkColorSpace> colorSpace,
const SkSurfaceProps* = nullptr);
+ bool disableGpuYUVConversion() const { return fContext->fDisableGpuYUVConversion; }
+
private:
explicit GrContextPriv(GrContext* context) : fContext(context) {}
GrContextPriv(const GrContextPriv&) {} // unimpl