From bfafcba05a54e1bc9c3074353a155d61119d095c Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Thu, 2 Mar 2017 08:49:19 -0500 Subject: 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 Commit-Queue: Brian Salomon --- src/gpu/GrProcOptInfo.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/gpu/GrProcOptInfo.cpp') 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; } } -- cgit v1.2.3