aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ccpr
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2018-05-23 12:00:07 -0600
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-23 18:58:51 +0000
commita71305cf9ed883f086f3efaaca7cb72b676a4332 (patch)
tree18c6a13dae79b6741f64875a103700a5bcbbe241 /src/gpu/ccpr
parentbed9d5ec3e1c83d17325069c739853a856564a83 (diff)
ccpr: Add a mechanism to detach and merge pending paths
Bug: skia:7988 Change-Id: Ie3fd7c5d57abdf70db40d309b7a83333045ad972 Reviewed-on: https://skia-review.googlesource.com/129622 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/ccpr')
-rw-r--r--src/gpu/ccpr/GrCoverageCountingPathRenderer.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gpu/ccpr/GrCoverageCountingPathRenderer.h b/src/gpu/ccpr/GrCoverageCountingPathRenderer.h
index dd0b190170..d10186601c 100644
--- a/src/gpu/ccpr/GrCoverageCountingPathRenderer.h
+++ b/src/gpu/ccpr/GrCoverageCountingPathRenderer.h
@@ -57,6 +57,19 @@ public:
SkASSERT(!fFlushing);
}
+ using PendingPathsMap = std::map<uint32_t, std::unique_ptr<GrCCPerOpListPaths>>;
+
+ // In DDL mode, Ganesh needs to be able to move the pending GrCCPerOpListPaths to the DDL object
+ // (detachPendingPaths) and then return them upon replay (mergePendingPaths).
+ PendingPathsMap detachPendingPaths() { return std::move(fPendingPaths); }
+
+ void mergePendingPaths(PendingPathsMap&& paths) {
+ // Ensure there are no duplicate opList IDs between the incoming path map and ours.
+ SkDEBUGCODE(for (const auto& it : paths) SkASSERT(!fPendingPaths.count(it.first)));
+ fPendingPaths.insert(std::make_move_iterator(paths.begin()),
+ std::make_move_iterator(paths.end()));
+ }
+
// GrPathRenderer overrides.
StencilSupport onGetStencilSupport(const GrShape&) const override {
return GrPathRenderer::kNoSupport_StencilSupport;
@@ -84,7 +97,7 @@ private:
// fPendingPaths holds the GrCCPerOpListPaths objects that have already been created, but not
// flushed, and those that are still being created. All GrCCPerOpListPaths objects will first
// reside in fPendingPaths, then be moved to fFlushingPaths during preFlush().
- std::map<uint32_t, std::unique_ptr<GrCCPerOpListPaths>> fPendingPaths;
+ PendingPathsMap fPendingPaths;
// fFlushingPaths holds the GrCCPerOpListPaths objects that are currently being flushed.
// (It will only contain elements when fFlushing is true.)