diff options
author | 2017-09-28 10:10:55 -0400 | |
---|---|---|
committer | 2017-09-28 14:46:07 +0000 | |
commit | 742f3d02a1c6a916d7e0ed3bedb0b546bbe3c15f (patch) | |
tree | 5232ae60fde957274230f6c0812a4337a34a7f68 /src/gpu/GrOpList.h | |
parent | 05572fa6e784b3037e94966c74c8a358348b2245 (diff) |
Make threaded proxy generation MDB-friendly, and defer instantiation
Replaces GrPrepareCallback with GrDeferredProxyUploader, stored directly
on GrTextureProxy. Op lists now store a list of referenced proxies that
are being generated by worker threads. At flush time, iterate over those
proxies, and invoke their uploader.
Lifetime of the uploader object is now tied to the proxy, but the ASAP
upload function will free the proxy's uploader, if it's called.
Bug: skia:
Change-Id: Ieb2c6a805d19990012839a8e103c3ca5b8d3dfc6
Reviewed-on: https://skia-review.googlesource.com/49904
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrOpList.h')
-rw-r--r-- | src/gpu/GrOpList.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/gpu/GrOpList.h b/src/gpu/GrOpList.h index 7a97961b19..6322008f25 100644 --- a/src/gpu/GrOpList.h +++ b/src/gpu/GrOpList.h @@ -23,7 +23,6 @@ class GrAuditTrail; class GrCaps; class GrOpFlushState; -class GrPrepareCallback; class GrRenderTargetOpList; class GrResourceAllocator; class GrResourceProvider; @@ -39,8 +38,10 @@ public: GrOpList(GrResourceProvider*, GrSurfaceProxy*, GrAuditTrail*); ~GrOpList() override; - // These three methods are invoked at flush time + // These four methods are invoked at flush time bool instantiate(GrResourceProvider* resourceProvider); + // Instantiates any "threaded" texture proxies that are being prepared elsewhere + void instantiateDeferredProxies(GrResourceProvider* resourceProvider); void prepare(GrOpFlushState* flushState); bool execute(GrOpFlushState* flushState) { return this->onExecute(flushState); } @@ -59,8 +60,6 @@ public: virtual void reset(); - void addPrepareCallback(std::unique_ptr<GrPrepareCallback> callback); - // TODO: in an MDB world, where the OpLists don't allocate GPU resources, it seems like // these could go away virtual void abandonGpuResources() = 0; @@ -181,8 +180,8 @@ private: // 'this' GrOpList relies on the output of the GrOpLists in 'fDependencies' SkSTArray<1, GrOpList*, true> fDependencies; - // These are used rarely, most clients never produce any - SkTArray<std::unique_ptr<GrPrepareCallback>> fPrepareCallbacks; + // List of texture proxies whose contents are being prepared on a worker thread + SkTArray<GrTextureProxy*, true> fDeferredProxies; typedef SkRefCnt INHERITED; }; |