diff options
author | Chris Dalton <csmartdalton@google.com> | 2018-04-27 13:05:19 -0600 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-27 20:27:18 +0000 |
commit | 1dec19a29eab9f861cf8a1df5ff74e7879efb14d (patch) | |
tree | 89d0aca2b1102cba98bf7cba4c21699bbae05180 /src/gpu/GrReducedClip.cpp | |
parent | cb31248132cc5ab08b0333b1ce0ab189dc69d155 (diff) |
ccpr: Remove canMakeClipProcessor
Now that conics are supported we can make a ccpr clip FP out of any
path. No need to ask. And the 'fDrawCachablePaths' check was redundant
since clip paths are always volatile anyway (for now).
Bug: skia:
Change-Id: I670474a3b91f1c252ed323eb627bbb109788e6b8
Reviewed-on: https://skia-review.googlesource.com/124362
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/GrReducedClip.cpp')
-rw-r--r-- | src/gpu/GrReducedClip.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gpu/GrReducedClip.cpp b/src/gpu/GrReducedClip.cpp index 9d27f7696e..1c5150c679 100644 --- a/src/gpu/GrReducedClip.cpp +++ b/src/gpu/GrReducedClip.cpp @@ -35,13 +35,14 @@ */ GrReducedClip::GrReducedClip(const SkClipStack& stack, const SkRect& queryBounds, const GrShaderCaps* caps, int maxWindowRectangles, int maxAnalyticFPs, - GrCoverageCountingPathRenderer* ccpr) + int maxCCPRClipPaths) : fCaps(caps) , fMaxWindowRectangles(maxWindowRectangles) , fMaxAnalyticFPs(maxAnalyticFPs) - , fCCPR(fMaxAnalyticFPs ? ccpr : nullptr) { + , fMaxCCPRClipPaths(maxCCPRClipPaths) { SkASSERT(!queryBounds.isEmpty()); SkASSERT(fMaxWindowRectangles <= GrWindowRectangles::kMaxWindows); + SkASSERT(fMaxCCPRClipPaths <= fMaxAnalyticFPs); fHasScissor = false; fAAClipRectGenID = SK_InvalidGenID; @@ -651,7 +652,7 @@ GrReducedClip::ClipResult GrReducedClip::addAnalyticFP(const SkPath& deviceSpace return ClipResult::kClipped; } - if (fCCPR && GrAA::kYes == aa && fCCPR->canMakeClipProcessor(deviceSpacePath)) { + if (fCCPRClipPaths.count() < fMaxCCPRClipPaths && GrAA::kYes == aa) { // Set aside CCPR paths for later. We will create their clip FPs once we know the ID of the // opList they will operate in. SkPath& ccprClipPath = fCCPRClipPaths.push_back(deviceSpacePath); @@ -955,17 +956,18 @@ bool GrReducedClip::drawStencilClipMask(GrContext* context, } std::unique_ptr<GrFragmentProcessor> GrReducedClip::finishAndDetachAnalyticFPs( - GrProxyProvider* proxyProvider, uint32_t opListID, - int rtWidth, int rtHeight) { + GrCoverageCountingPathRenderer* ccpr, GrProxyProvider* proxyProvider, uint32_t opListID, + int rtWidth, int rtHeight) { // Make sure finishAndDetachAnalyticFPs hasn't been called already. SkDEBUGCODE(for (const auto& fp : fAnalyticFPs) { SkASSERT(fp); }) if (!fCCPRClipPaths.empty()) { fAnalyticFPs.reserve(fAnalyticFPs.count() + fCCPRClipPaths.count()); for (const SkPath& ccprClipPath : fCCPRClipPaths) { + SkASSERT(ccpr); SkASSERT(fHasScissor); - auto fp = fCCPR->makeClipProcessor(proxyProvider, opListID, ccprClipPath, fScissor, - rtWidth, rtHeight); + auto fp = ccpr->makeClipProcessor(proxyProvider, opListID, ccprClipPath, fScissor, + rtWidth, rtHeight); fAnalyticFPs.push_back(std::move(fp)); } fCCPRClipPaths.reset(); |