diff options
author | Brian Osman <brianosman@google.com> | 2017-09-28 10:10:55 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-28 14:46:07 +0000 |
commit | 742f3d02a1c6a916d7e0ed3bedb0b546bbe3c15f (patch) | |
tree | 5232ae60fde957274230f6c0812a4337a34a7f68 /src/gpu/GrTextureProxyPriv.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/GrTextureProxyPriv.h')
-rw-r--r-- | src/gpu/GrTextureProxyPriv.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gpu/GrTextureProxyPriv.h b/src/gpu/GrTextureProxyPriv.h index c3ddb9460c..e961493179 100644 --- a/src/gpu/GrTextureProxyPriv.h +++ b/src/gpu/GrTextureProxyPriv.h @@ -10,11 +10,23 @@ #include "GrTextureProxy.h" +class GrDeferredProxyUploader; +class GrOpFlushState; + /** * This class hides the more specialized capabilities of GrTextureProxy. */ class GrTextureProxyPriv { public: + // Attach a deferred uploader to the proxy. Holds data being prepared by a worker thread. + void setDeferredUploader(std::unique_ptr<GrDeferredProxyUploader>); + bool isDeferred() const { return SkToBool(fTextureProxy->fDeferredUploader.get()); } + // For a deferred proxy (one that has a deferred uploader attached), this schedules an ASAP + // upload of that data to the instantiated texture. + void scheduleUpload(GrOpFlushState*); + // Clears any deferred uploader object on the proxy. Used to free the CPU data after the + // contents have been uploaded. + void resetDeferredUploader(); private: explicit GrTextureProxyPriv(GrTextureProxy* textureProxy) : fTextureProxy(textureProxy) {} |