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