aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrSoftwarePathRenderer.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-09-28 17:45:20 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-28 17:45:32 +0000
commit9f8d4d36b514ffe3cc3a4a48900e3dc1fecb2a96 (patch)
tree332ff8c62c1dff41f48672c001bddedf956a43b6 /src/gpu/GrSoftwarePathRenderer.cpp
parentabb8bb307cea0cf2fae605bd0e80a81854da760e (diff)
Revert "Revert "Revert "Make threaded proxy generation MDB-friendly, and defer instantiation"""
This reverts commit e8b8397664666bfcba8f088ea073ede915da8a41. Reason for revert: More crashing. Original change's description: > Revert "Revert "Make threaded proxy generation MDB-friendly, and defer instantiation"" > > This reverts commit 837c6c7c0cc76bdb9d61a05244ca5f31e7573c37. > > Bug: skia: > Change-Id: I1821f1b2b772c67f1b749692b398eb757d8073c9 > Reviewed-on: https://skia-review.googlesource.com/52744 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Brian Osman <brianosman@google.com> TBR=egdaniel@google.com,robertphillips@google.com,brianosman@google.com Change-Id: I1c8a81ed1000446c298d646d2cd5e7ebd212f18c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/52860 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/GrSoftwarePathRenderer.cpp')
-rw-r--r--src/gpu/GrSoftwarePathRenderer.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index 8c3d64b77a..dd0e272dbb 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 GrTDeferredProxyUploader. The software path renderer only draws
+ * Payload class for use with GrMaskUploaderPrepareCallback. 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,9 +318,15 @@ bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) {
return false;
}
- auto uploader = skstd::make_unique<GrTDeferredProxyUploader<SoftwarePathData>>(
- *boundsForMask, *args.fViewMatrix, *args.fShape, aa);
- GrTDeferredProxyUploader<SoftwarePathData>* uploaderRaw = uploader.get();
+ // 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 drawAndUploadMask = [uploaderRaw] {
TRACE_EVENT0("skia", "Threaded SW Mask Render");
@@ -332,10 +338,10 @@ bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) {
} else {
SkDEBUGFAIL("Unable to allocate SW mask.");
}
- uploaderRaw->signalAndFreeData();
+ uploaderRaw->getSemaphore()->signal();
};
taskGroup->add(std::move(drawAndUploadMask));
- proxy->texPriv().setDeferredUploader(std::move(uploader));
+ args.fRenderTargetContext->getOpList()->addPrepareCallback(std::move(uploader));
} else {
GrSWMaskHelper helper;
if (!helper.init(*boundsForMask)) {