diff options
author | 2017-03-02 08:49:19 -0500 | |
---|---|---|
committer | 2017-03-02 15:28:02 +0000 | |
commit | bfafcba05a54e1bc9c3074353a155d61119d095c (patch) | |
tree | 1304d38dddb0253db2462028712db89aa5b21bbb /src/gpu/GrProcOptInfo.cpp | |
parent | bb5af6b70086cca8cbaa17b6ecfd462be3ab0b9e (diff) |
Determine whether any fp uses local coords in FragmentProcessorAnalysis rather than GrPipeline creation
Change-Id: I3b6253cd2b0081dfece51125082fd78f647e45e1
Reviewed-on: https://skia-review.googlesource.com/9133
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrProcOptInfo.cpp')
-rw-r--r-- | src/gpu/GrProcOptInfo.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gpu/GrProcOptInfo.cpp b/src/gpu/GrProcOptInfo.cpp index 9eda9bbd12..902a7c77e4 100644 --- a/src/gpu/GrProcOptInfo.cpp +++ b/src/gpu/GrProcOptInfo.cpp @@ -12,7 +12,8 @@ void GrProcOptInfo::analyzeProcessors(const GrFragmentProcessor* const* processors, int cnt) { for (int i = 0; i < cnt; ++i) { bool knowCurrentOutput = fProcessorsVisitedWithKnownOutput == fTotalProcessorsVisited; - if (!knowCurrentOutput && !fAllProcessorsCompatibleWithCoverageAsAlpha && !fIsOpaque) { + if (fUsesLocalCoords && !knowCurrentOutput && + !fAllProcessorsCompatibleWithCoverageAsAlpha && !fIsOpaque) { fTotalProcessorsVisited += cnt - i; return; } @@ -21,12 +22,19 @@ void GrProcOptInfo::analyzeProcessors(const GrFragmentProcessor* const* processo &fLastKnownOutputColor)) { ++fProcessorsVisitedWithKnownOutput; fIsOpaque = fLastKnownOutputColor.isOpaque(); + // We reset these since the caller is expected to not use the earlier fragment + // processors. + fAllProcessorsCompatibleWithCoverageAsAlpha = true; + fUsesLocalCoords = false; } else if (fIsOpaque && !fp->preservesOpaqueInput()) { fIsOpaque = false; } if (fAllProcessorsCompatibleWithCoverageAsAlpha && !fp->compatibleWithCoverageAsAlpha()) { fAllProcessorsCompatibleWithCoverageAsAlpha = false; } + if (fp->usesLocalCoords()) { + fUsesLocalCoords = true; + } ++fTotalProcessorsVisited; } } |