| 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 "GrBatch.h" | |
| 11 #include "GrFragmentProcessor.h" | 10 #include "GrFragmentProcessor.h" |
| 12 #include "GrFragmentStage.h" | 11 #include "GrFragmentStage.h" |
| 13 #include "GrGeometryProcessor.h" | 12 #include "GrGeometryProcessor.h" |
| 14 | 13 |
| 15 void GrProcOptInfo::calcColorWithBatch(const GrBatch* batch, | |
| 16 const GrFragmentStage* stages, | |
| 17 int stageCount) { | |
| 18 GrInitInvariantOutput out; | |
| 19 batch->getInvariantOutputColor(&out); | |
| 20 fInOut.reset(out); | |
| 21 this->internalCalc(stages, stageCount, batch->willReadFragmentPosition()); | |
| 22 } | |
| 23 | |
| 24 void GrProcOptInfo::calcCoverageWithBatch(const GrBatch* batch, | |
| 25 const GrFragmentStage* stages, | |
| 26 int stageCount) { | |
| 27 GrInitInvariantOutput out; | |
| 28 batch->getInvariantOutputCoverage(&out); | |
| 29 fInOut.reset(out); | |
| 30 this->internalCalc(stages, stageCount, batch->willReadFragmentPosition()); | |
| 31 } | |
| 32 | |
| 33 void GrProcOptInfo::calcColorWithPrimProc(const GrPrimitiveProcessor* primProc, | 14 void GrProcOptInfo::calcColorWithPrimProc(const GrPrimitiveProcessor* primProc, |
| 34 const GrFragmentStage* stages, | 15 const GrFragmentStage* stages, |
| 35 int stageCount) { | 16 int stageCount) { |
| 36 GrInitInvariantOutput out; | 17 GrInitInvariantOutput out; |
| 37 primProc->getInvariantOutputColor(&out); | 18 primProc->getInvariantOutputColor(&out); |
| 38 fInOut.reset(out); | 19 fInOut.reset(out); |
| 39 this->internalCalc(stages, stageCount, primProc->willReadFragmentPosition())
; | 20 this->internalCalc(stages, stageCount, primProc->willReadFragmentPosition())
; |
| 40 } | 21 } |
| 41 | 22 |
| 42 void GrProcOptInfo::calcCoverageWithPrimProc(const GrPrimitiveProcessor* primPro
c, | 23 void GrProcOptInfo::calcCoverageWithPrimProc(const GrPrimitiveProcessor* primPro
c, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 fInputColor = fInOut.color(); | 69 fInputColor = fInOut.color(); |
| 89 fInputColorIsUsed = true; | 70 fInputColorIsUsed = true; |
| 90 // 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 |
| 91 // zero stages that don't multiply the inputColor. | 72 // zero stages that don't multiply the inputColor. |
| 92 fInOut.resetNonMulStageFound(); | 73 fInOut.resetNonMulStageFound(); |
| 93 // 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 |
| 94 fReadsFragPosition = initWillReadFragmentPosition; | 75 fReadsFragPosition = initWillReadFragmentPosition; |
| 95 } | 76 } |
| 96 } | 77 } |
| 97 } | 78 } |
| OLD | NEW |