| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "GrProcOptInfo.h" | 8 #include "GrProcOptInfo.h" |
| 9 | 9 |
| 10 #include "GrGeometryProcessor.h" | 10 #include "GrGeometryProcessor.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 GrInitInvariantOutput out; | 44 GrInitInvariantOutput out; |
| 45 primProc->getInvariantOutputCoverage(&out); | 45 primProc->getInvariantOutputCoverage(&out); |
| 46 fInOut.reset(out); | 46 fInOut.reset(out); |
| 47 this->internalCalc(processors, cnt, primProc->willReadFragmentPosition()); | 47 this->internalCalc(processors, cnt, primProc->willReadFragmentPosition()); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void GrProcOptInfo::calcWithInitialValues(const GrFragmentProcessor * const proc
essors[], | 50 void GrProcOptInfo::calcWithInitialValues(const GrFragmentProcessor * const proc
essors[], |
| 51 int cnt, | 51 int cnt, |
| 52 GrColor startColor, | 52 GrColor startColor, |
| 53 GrColorComponentFlags flags, | 53 GrColorComponentFlags flags, |
| 54 bool areCoverageStages) { | 54 bool areCoverageStages, |
| 55 bool isLCD) { |
| 55 GrInitInvariantOutput out; | 56 GrInitInvariantOutput out; |
| 56 out.fIsSingleComponent = areCoverageStages; | 57 out.fIsSingleComponent = areCoverageStages; |
| 57 out.fColor = startColor; | 58 out.fColor = startColor; |
| 58 out.fValidFlags = flags; | 59 out.fValidFlags = flags; |
| 60 out.fIsLCDCoverage = isLCD; |
| 59 fInOut.reset(out); | 61 fInOut.reset(out); |
| 60 this->internalCalc(processors, cnt, false); | 62 this->internalCalc(processors, cnt, false); |
| 61 } | 63 } |
| 62 | 64 |
| 63 void GrProcOptInfo::internalCalc(const GrFragmentProcessor* const processors[], | 65 void GrProcOptInfo::internalCalc(const GrFragmentProcessor* const processors[], |
| 64 int cnt, | 66 int cnt, |
| 65 bool initWillReadFragmentPosition) { | 67 bool initWillReadFragmentPosition) { |
| 66 fFirstEffectiveProcessorIndex = 0; | 68 fFirstEffectiveProcessorIndex = 0; |
| 67 fInputColorIsUsed = true; | 69 fInputColorIsUsed = true; |
| 68 fInputColor = fInOut.color(); | 70 fInputColor = fInOut.color(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 87 fInputColor = fInOut.color(); | 89 fInputColor = fInOut.color(); |
| 88 fInputColorIsUsed = true; | 90 fInputColorIsUsed = true; |
| 89 // Since we are clearing all previous color stages we are in a state
where we have found | 91 // Since we are clearing all previous color stages we are in a state
where we have found |
| 90 // zero stages that don't multiply the inputColor. | 92 // zero stages that don't multiply the inputColor. |
| 91 fInOut.resetNonMulStageFound(); | 93 fInOut.resetNonMulStageFound(); |
| 92 // Reset these since we don't care if previous stages read these val
ues | 94 // Reset these since we don't care if previous stages read these val
ues |
| 93 fReadsFragPosition = initWillReadFragmentPosition; | 95 fReadsFragPosition = initWillReadFragmentPosition; |
| 94 } | 96 } |
| 95 } | 97 } |
| 96 } | 98 } |
| OLD | NEW |