diff options
author | Brian Osman <brianosman@google.com> | 2017-10-02 16:38:32 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-02 21:04:08 +0000 |
commit | 099fa0fb9801a138f12cf7cdf46b6581d81acce8 (patch) | |
tree | 2c3fcfa090c75737f528591095db6604d1f3ccce /src/gpu/GrClipStackClip.cpp | |
parent | 74a8296d7c47efc6e23bd978efd1fdf4dbe29eb9 (diff) |
Revert^6 "Make threaded proxy generation MDB-friendly, and defer instantiation"
ANGLE bots were getting lots of corrupted GMs - we set fPreferVRAMUseOverFlushes
to false. In that case, multiple deferred proxies were instantiating to the same
scratch resource. Any proxy that we're going to fill with an ASAP upload needs
to have no pending IO - we hoist all those loads to the front of the flush, so
normal IO tracking doesn't really help.
Bug: skia:
Change-Id: Id36fd8700e522db412a3c992b93c778e2ebb1188
Reviewed-on: https://skia-review.googlesource.com/53940
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/GrClipStackClip.cpp')
-rw-r--r-- | src/gpu/GrClipStackClip.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp index 10880b4891..c33ffd29d9 100644 --- a/src/gpu/GrClipStackClip.cpp +++ b/src/gpu/GrClipStackClip.cpp @@ -9,11 +9,11 @@ #include "GrAppliedClip.h" #include "GrContextPriv.h" +#include "GrDeferredProxyUploader.h" #include "GrDrawingManager.h" #include "GrRenderTargetContextPriv.h" #include "GrFixedClip.h" #include "GrGpuResourcePriv.h" -#include "GrPrepareCallback.h" #include "GrResourceProvider.h" #include "GrStencilAttachment.h" #include "GrSWMaskHelper.h" @@ -428,7 +428,7 @@ sk_sp<GrTextureProxy> GrClipStackClip::createAlphaClipMask(GrContext* context, namespace { /** - * Payload class for use with GrMaskUploaderPrepareCallback. The clip mask code renders multiple + * Payload class for use with GrTDeferredProxyUploader. The clip mask code renders multiple * elements, each storing their own AA setting (and already transformed into device space). This * stores all of the information needed by the worker thread to draw all clip elements (see below, * in createSoftwareClipMask). @@ -524,17 +524,11 @@ sk_sp<GrTextureProxy> GrClipStackClip::createSoftwareClipMask( desc.fHeight = maskSpaceIBounds.height(); desc.fConfig = kAlpha_8_GrPixelConfig; proxy = GrSurfaceProxy::MakeDeferred(context->resourceProvider(), desc, - SkBackingFit::kApprox, SkBudgeted::kYes); + SkBackingFit::kApprox, SkBudgeted::kYes, + GrResourceProvider::kNoPendingIO_Flag); - // TODO: I believe the assignUniqueKeyToProxy below used to instantiate the proxy 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(context->resourceProvider()); - - auto uploader = skstd::make_unique<GrMaskUploaderPrepareCallback<ClipMaskData>>( - proxy, reducedClip); - GrMaskUploaderPrepareCallback<ClipMaskData>* uploaderRaw = uploader.get(); + auto uploader = skstd::make_unique<GrTDeferredProxyUploader<ClipMaskData>>(reducedClip); + GrTDeferredProxyUploader<ClipMaskData>* uploaderRaw = uploader.get(); auto drawAndUploadMask = [uploaderRaw, maskSpaceIBounds] { TRACE_EVENT0("skia", "Threaded SW Clip Mask Render"); GrSWMaskHelper helper(uploaderRaw->getPixels()); @@ -545,11 +539,11 @@ sk_sp<GrTextureProxy> GrClipStackClip::createSoftwareClipMask( } else { SkDEBUGFAIL("Unable to allocate SW clip mask."); } - uploaderRaw->getSemaphore()->signal(); + uploaderRaw->signalAndFreeData(); }; taskGroup->add(std::move(drawAndUploadMask)); - renderTargetContext->getOpList()->addPrepareCallback(std::move(uploader)); + proxy->texPriv().setDeferredUploader(std::move(uploader)); } else { GrSWMaskHelper helper; if (!helper.init(maskSpaceIBounds)) { |