diff options
author | Brian Osman <brianosman@google.com> | 2017-09-29 09:22:17 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-29 13:48:54 +0000 |
commit | fdd2cb52b781dd68f515a1eb9fe6d054a0ebc226 (patch) | |
tree | be3eb525ce37c3df6c4150ed1e210632b3ec7b13 /src/gpu/GrSoftwarePathRenderer.cpp | |
parent | 5fdee443e750b16dabfe3b1aa61b77207660457a (diff) |
Revert "Revert "Revert "Revert "Make threaded proxy generation MDB-friendly, and defer instantiation""""
This reverts commit 9f8d4d36b514ffe3cc3a4a48900e3dc1fecb2a96.
Bug: skia:
Change-Id: I8d7c1df24d8b13b94404f3d9ba69a1ab55ee00c0
Reviewed-on: https://skia-review.googlesource.com/52920
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrSoftwarePathRenderer.cpp')
-rw-r--r-- | src/gpu/GrSoftwarePathRenderer.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp index dd0e272dbb..8c3d64b77a 100644 --- a/src/gpu/GrSoftwarePathRenderer.cpp +++ b/src/gpu/GrSoftwarePathRenderer.cpp @@ -9,10 +9,10 @@ #include "GrAuditTrail.h" #include "GrClip.h" #include "GrContextPriv.h" +#include "GrDeferredProxyUploader.h" #include "GrGpuResourcePriv.h" #include "GrOpFlushState.h" #include "GrOpList.h" -#include "GrPrepareCallback.h" #include "GrResourceProvider.h" #include "GrSWMaskHelper.h" #include "SkMakeUnique.h" @@ -175,7 +175,7 @@ static sk_sp<GrTextureProxy> make_deferred_mask_texture_proxy(GrContext* context namespace { /** - * Payload class for use with GrMaskUploaderPrepareCallback. The software path renderer only draws + * Payload class for use with GrTDeferredProxyUploader. The software path renderer only draws * a single path into the mask texture. This stores all of the information needed by the worker * thread's call to drawShape (see below, in onDrawPath). */ @@ -318,15 +318,9 @@ bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) { return false; } - // TODO: I believe the assignUniqueKeyToProxy below used to instantiate the proxy before - // before the draw that used the result was being flushed, so the upload was succeeding. - // With assignUniqueKeyToProxy no longer forcing an instantiation it will have to happen - // explicitly elsewhere. - proxy->instantiate(fResourceProvider); - - auto uploader = skstd::make_unique<GrMaskUploaderPrepareCallback<SoftwarePathData>>( - proxy, *boundsForMask, *args.fViewMatrix, *args.fShape, aa); - GrMaskUploaderPrepareCallback<SoftwarePathData>* uploaderRaw = uploader.get(); + auto uploader = skstd::make_unique<GrTDeferredProxyUploader<SoftwarePathData>>( + *boundsForMask, *args.fViewMatrix, *args.fShape, aa); + GrTDeferredProxyUploader<SoftwarePathData>* uploaderRaw = uploader.get(); auto drawAndUploadMask = [uploaderRaw] { TRACE_EVENT0("skia", "Threaded SW Mask Render"); @@ -338,10 +332,10 @@ bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) { } else { SkDEBUGFAIL("Unable to allocate SW mask."); } - uploaderRaw->getSemaphore()->signal(); + uploaderRaw->signalAndFreeData(); }; taskGroup->add(std::move(drawAndUploadMask)); - args.fRenderTargetContext->getOpList()->addPrepareCallback(std::move(uploader)); + proxy->texPriv().setDeferredUploader(std::move(uploader)); } else { GrSWMaskHelper helper; if (!helper.init(*boundsForMask)) { |