| 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 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 void GrProcOptInfo::calcCoverageWithBatch(const GrDrawBatch* batch, | 23 void GrProcOptInfo::calcCoverageWithBatch(const GrDrawBatch* batch, |
| 24 const GrFragmentProcessor* const proce
ssors[], | 24 const GrFragmentProcessor* const proce
ssors[], |
| 25 int cnt) { | 25 int cnt) { |
| 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::calcColorWithPrimProc(const GrPrimitiveProcessor* primProc, | |
| 33 const GrFragmentProcessor * const proc
essors[], | |
| 34 int cnt) { | |
| 35 GrInitInvariantOutput out; | |
| 36 primProc->getInvariantOutputColor(&out); | |
| 37 fInOut.reset(out); | |
| 38 this->internalCalc(processors, cnt, primProc->willReadFragmentPosition()); | |
| 39 } | |
| 40 | |
| 41 void GrProcOptInfo::calcCoverageWithPrimProc(const GrPrimitiveProcessor* primPro
c, | |
| 42 const GrFragmentProcessor * const p
rocessors[], | |
| 43 int cnt) { | |
| 44 GrInitInvariantOutput out; | |
| 45 primProc->getInvariantOutputCoverage(&out); | |
| 46 fInOut.reset(out); | |
| 47 this->internalCalc(processors, cnt, primProc->willReadFragmentPosition()); | |
| 48 } | |
| 49 | |
| 50 void GrProcOptInfo::calcWithInitialValues(const GrFragmentProcessor * const proc
essors[], | 32 void GrProcOptInfo::calcWithInitialValues(const GrFragmentProcessor * const proc
essors[], |
| 51 int cnt, | 33 int cnt, |
| 52 GrColor startColor, | 34 GrColor startColor, |
| 53 GrColorComponentFlags flags, | 35 GrColorComponentFlags flags, |
| 54 bool areCoverageStages) { | 36 bool areCoverageStages) { |
| 55 GrInitInvariantOutput out; | 37 GrInitInvariantOutput out; |
| 56 out.fIsSingleComponent = areCoverageStages; | 38 out.fIsSingleComponent = areCoverageStages; |
| 57 out.fColor = startColor; | 39 out.fColor = startColor; |
| 58 out.fValidFlags = flags; | 40 out.fValidFlags = flags; |
| 59 fInOut.reset(out); | 41 fInOut.reset(out); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 87 fInputColor = fInOut.color(); | 69 fInputColor = fInOut.color(); |
| 88 fInputColorIsUsed = true; | 70 fInputColorIsUsed = true; |
| 89 // Since we are clearing all previous color stages we are in a state
where we have found | 71 // 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. | 72 // zero stages that don't multiply the inputColor. |
| 91 fInOut.resetNonMulStageFound(); | 73 fInOut.resetNonMulStageFound(); |
| 92 // Reset these since we don't care if previous stages read these val
ues | 74 // Reset these since we don't care if previous stages read these val
ues |
| 93 fReadsFragPosition = initWillReadFragmentPosition; | 75 fReadsFragPosition = initWillReadFragmentPosition; |
| 94 } | 76 } |
| 95 } | 77 } |
| 96 } | 78 } |
| OLD | NEW |