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 15 matching lines...) Expand all Loading... |
26 GrInitInvariantOutput out; | 26 GrInitInvariantOutput out; |
27 batch->getInvariantOutputCoverage(&out); | 27 batch->getInvariantOutputCoverage(&out); |
28 fInOut.reset(out); | 28 fInOut.reset(out); |
29 this->internalCalc(processors, cnt, batch->willReadFragmentPosition()); | 29 this->internalCalc(processors, cnt, batch->willReadFragmentPosition()); |
30 } | 30 } |
31 | 31 |
32 void GrProcOptInfo::calcWithInitialValues(const GrFragmentProcessor * const proc
essors[], | 32 void GrProcOptInfo::calcWithInitialValues(const GrFragmentProcessor * const proc
essors[], |
33 int cnt, | 33 int cnt, |
34 GrColor startColor, | 34 GrColor startColor, |
35 GrColorComponentFlags flags, | 35 GrColorComponentFlags flags, |
36 bool areCoverageStages) { | 36 bool areCoverageStages, |
| 37 bool isLCD) { |
37 GrInitInvariantOutput out; | 38 GrInitInvariantOutput out; |
38 out.fIsSingleComponent = areCoverageStages; | 39 out.fIsSingleComponent = areCoverageStages; |
39 out.fColor = startColor; | 40 out.fColor = startColor; |
40 out.fValidFlags = flags; | 41 out.fValidFlags = flags; |
| 42 out.fIsLCDCoverage = isLCD; |
41 fInOut.reset(out); | 43 fInOut.reset(out); |
42 this->internalCalc(processors, cnt, false); | 44 this->internalCalc(processors, cnt, false); |
43 } | 45 } |
44 | 46 |
45 void GrProcOptInfo::internalCalc(const GrFragmentProcessor* const processors[], | 47 void GrProcOptInfo::internalCalc(const GrFragmentProcessor* const processors[], |
46 int cnt, | 48 int cnt, |
47 bool initWillReadFragmentPosition) { | 49 bool initWillReadFragmentPosition) { |
48 fFirstEffectiveProcessorIndex = 0; | 50 fFirstEffectiveProcessorIndex = 0; |
49 fInputColorIsUsed = true; | 51 fInputColorIsUsed = true; |
50 fInputColor = fInOut.color(); | 52 fInputColor = fInOut.color(); |
(...skipping 18 matching lines...) Expand all Loading... |
69 fInputColor = fInOut.color(); | 71 fInputColor = fInOut.color(); |
70 fInputColorIsUsed = true; | 72 fInputColorIsUsed = true; |
71 // Since we are clearing all previous color stages we are in a state
where we have found | 73 // Since we are clearing all previous color stages we are in a state
where we have found |
72 // zero stages that don't multiply the inputColor. | 74 // zero stages that don't multiply the inputColor. |
73 fInOut.resetNonMulStageFound(); | 75 fInOut.resetNonMulStageFound(); |
74 // Reset these since we don't care if previous stages read these val
ues | 76 // Reset these since we don't care if previous stages read these val
ues |
75 fReadsFragPosition = initWillReadFragmentPosition; | 77 fReadsFragPosition = initWillReadFragmentPosition; |
76 } | 78 } |
77 } | 79 } |
78 } | 80 } |
OLD | NEW |