aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ccpr
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-05-30 14:59:23 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-30 14:59:29 +0000
commitcf9086ce1ebd9efa27e96cfb09d9c72aac68aca1 (patch)
treee6b776e608da1465230d88ab108ccd1a8c2e6f3f /src/gpu/ccpr
parent462505f3100f0abc52adfd4506b62719e7151e18 (diff)
Revert "Allow CCPR in DDL mode"
This reverts commit 93540dd15715057e00b4f136977f441720317b60. Reason for revert: Chrome! > Allow CCPR in DDL mode > > Bug: skia:7988 > Change-Id: If757f29e0156c0ef7045b437b04e17aebe4de851 > Reviewed-on: https://skia-review.googlesource.com/130509 > Commit-Queue: Robert Phillips <robertphillips@google.com> > Reviewed-by: Chris Dalton <csmartdalton@google.com> > Reviewed-by: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,robertphillips@google.com,csmartdalton@google.com Change-Id: Ibb5017d1bf307545969069b94987e0a51a22e333 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7988 Reviewed-on: https://skia-review.googlesource.com/130880 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/ccpr')
-rw-r--r--src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp10
-rw-r--r--src/gpu/ccpr/GrCoverageCountingPathRenderer.h21
2 files changed, 8 insertions, 23 deletions
diff --git a/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp b/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
index 63e503b4c1..d51c0b525a 100644
--- a/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
+++ b/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
@@ -50,7 +50,7 @@ sk_sp<GrCoverageCountingPathRenderer> GrCoverageCountingPathRenderer::CreateIfSu
GrCCPerOpListPaths* GrCoverageCountingPathRenderer::lookupPendingPaths(uint32_t opListID) {
auto it = fPendingPaths.find(opListID);
if (fPendingPaths.end() == it) {
- sk_sp<GrCCPerOpListPaths> paths = sk_make_sp<GrCCPerOpListPaths>();
+ auto paths = skstd::make_unique<GrCCPerOpListPaths>();
it = fPendingPaths.insert(std::make_pair(opListID, std::move(paths))).first;
}
return it->second.get();
@@ -227,7 +227,6 @@ void GrCoverageCountingPathRenderer::preFlush(GrOnFlushResourceProvider* onFlush
// Commit flushing paths to the resources once they are successfully completed.
for (auto& flushingPaths : fFlushingPaths) {
- SkASSERT(!flushingPaths->fFlushResources);
flushingPaths->fFlushResources = resources;
}
}
@@ -235,13 +234,6 @@ void GrCoverageCountingPathRenderer::preFlush(GrOnFlushResourceProvider* onFlush
void GrCoverageCountingPathRenderer::postFlush(GrDeferredUploadToken, const uint32_t* opListIDs,
int numOpListIDs) {
SkASSERT(fFlushing);
-
- // In DDL mode these aren't guaranteed to be deleted so we must clear out the perFlush
- // resources manually.
- for (auto& flushingPaths : fFlushingPaths) {
- flushingPaths->fFlushResources = nullptr;
- }
-
// We wait to erase these until after flush, once Ops and FPs are done accessing their data.
fFlushingPaths.reset();
SkDEBUGCODE(fFlushing = false);
diff --git a/src/gpu/ccpr/GrCoverageCountingPathRenderer.h b/src/gpu/ccpr/GrCoverageCountingPathRenderer.h
index 66374ea007..d10186601c 100644
--- a/src/gpu/ccpr/GrCoverageCountingPathRenderer.h
+++ b/src/gpu/ccpr/GrCoverageCountingPathRenderer.h
@@ -21,8 +21,7 @@ class GrCCDrawPathsOp;
/**
* Tracks all the paths in a given opList that will be drawn when it flushes.
*/
-// DDL TODO: given the usage pattern in DDL mode, this could probably be non-atomic refcounting.
-struct GrCCPerOpListPaths : SkRefCnt {
+struct GrCCPerOpListPaths {
~GrCCPerOpListPaths() {
// Ensure there are no surviving DrawPathsOps with a dangling pointer into this class.
if (!fDrawOps.isEmpty()) {
@@ -58,23 +57,17 @@ public:
SkASSERT(!fFlushing);
}
- using PendingPathsMap = std::map<uint32_t, sk_sp<GrCCPerOpListPaths>>;
+ 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(const PendingPathsMap& paths) {
-#ifdef SK_DEBUG
+ void mergePendingPaths(PendingPathsMap&& paths) {
// Ensure there are no duplicate opList IDs between the incoming path map and ours.
- // This should always be true since opList IDs are globally unique and these are coming
- // from different DDL recordings.
- for (const auto& it : paths) {
- SkASSERT(!fPendingPaths.count(it.first));
- }
-#endif
-
- fPendingPaths.insert(paths.begin(), paths.end());
+ 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.
@@ -108,7 +101,7 @@ private:
// fFlushingPaths holds the GrCCPerOpListPaths objects that are currently being flushed.
// (It will only contain elements when fFlushing is true.)
- SkSTArray<4, sk_sp<GrCCPerOpListPaths>> fFlushingPaths;
+ SkSTArray<4, std::unique_ptr<GrCCPerOpListPaths>> fFlushingPaths;
SkDEBUGCODE(bool fFlushing = false);
const bool fDrawCachablePaths;