diff options
author | 2017-09-28 10:10:55 -0400 | |
---|---|---|
committer | 2017-09-28 14:46:07 +0000 | |
commit | 742f3d02a1c6a916d7e0ed3bedb0b546bbe3c15f (patch) | |
tree | 5232ae60fde957274230f6c0812a4337a34a7f68 /include | |
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 'include')
-rw-r--r-- | include/private/GrTextureProxy.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/private/GrTextureProxy.h b/include/private/GrTextureProxy.h index 8e72eaddb9..e841baeb1f 100644 --- a/include/private/GrTextureProxy.h +++ b/include/private/GrTextureProxy.h @@ -12,6 +12,7 @@ #include "GrSurfaceProxy.h" class GrCaps; +class GrDeferredProxyUploader; class GrResourceCache; class GrResourceProvider; class GrTextureOpList; @@ -69,6 +70,7 @@ public: protected: friend class GrSurfaceProxy; // for ctors + friend class GrTextureProxyPriv; // Deferred version GrTextureProxy(const GrSurfaceDesc& srcDesc, SkBackingFit, SkBudgeted, @@ -89,6 +91,11 @@ private: GrUniqueKey fUniqueKey; GrResourceCache* fCache; // only set when fUniqueKey is valid + // Only used for proxies whose contents are being prepared on a worker thread. This object + // stores the texture data, allowing the proxy to remain uninstantiated until flush. At that + // point, the proxy is instantiated, and this data is used to perform an ASAP upload. + std::unique_ptr<GrDeferredProxyUploader> fDeferredUploader; + size_t onUninstantiatedGpuMemorySize() const override; // Methods made available via GrTextureProxy::CacheAccess |