| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrPipelineBuilder.h" | 8 #include "GrPipelineBuilder.h" |
| 9 | 9 |
| 10 #include "GrBatch.h" | 10 #include "GrBatch.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 } | 116 } |
| 117 | 117 |
| 118 //////////////////////////////////////////////////////////////////////////////// | 118 //////////////////////////////////////////////////////////////////////////////// |
| 119 | 119 |
| 120 GrPipelineBuilder::~GrPipelineBuilder() { | 120 GrPipelineBuilder::~GrPipelineBuilder() { |
| 121 SkASSERT(0 == fBlockEffectRemovalCnt); | 121 SkASSERT(0 == fBlockEffectRemovalCnt); |
| 122 } | 122 } |
| 123 | 123 |
| 124 //////////////////////////////////////////////////////////////////////////////// | 124 //////////////////////////////////////////////////////////////////////////////// |
| 125 | 125 |
| 126 bool GrPipelineBuilder::willBlendWithDst(const GrPrimitiveProcessor* pp) const { | 126 bool GrPipelineBuilder::willColorBlendWithDst(const GrPrimitiveProcessor* pp) co
nst { |
| 127 this->calcColorInvariantOutput(pp); | 127 this->calcColorInvariantOutput(pp); |
| 128 this->calcCoverageInvariantOutput(pp); | |
| 129 | 128 |
| 130 GrXPFactory::InvariantOutput output; | 129 GrXPFactory::InvariantBlendedColor blendedColor; |
| 131 fXPFactory->getInvariantOutput(fColorProcInfo, fCoverageProcInfo, &output); | 130 fXPFactory->getInvariantBlendedColor(fColorProcInfo, &blendedColor); |
| 132 return output.fWillBlendWithDst; | 131 return blendedColor.fWillBlendWithDst; |
| 133 } | 132 } |
| 134 | 133 |
| 135 void GrPipelineBuilder::calcColorInvariantOutput(const GrPrimitiveProcessor* pp)
const { | 134 void GrPipelineBuilder::calcColorInvariantOutput(const GrPrimitiveProcessor* pp)
const { |
| 136 fColorProcInfo.calcColorWithPrimProc(pp, fColorStages.begin(), this->numColo
rFragmentStages()); | 135 fColorProcInfo.calcColorWithPrimProc(pp, fColorStages.begin(), this->numColo
rFragmentStages()); |
| 137 fColorProcInfoValid = false; | 136 fColorProcInfoValid = false; |
| 138 | 137 |
| 139 } | 138 } |
| 140 | 139 |
| 141 void GrPipelineBuilder::calcCoverageInvariantOutput(const GrPrimitiveProcessor*
pp) const { | 140 void GrPipelineBuilder::calcCoverageInvariantOutput(const GrPrimitiveProcessor*
pp) const { |
| 142 fCoverageProcInfo.calcCoverageWithPrimProc(pp, fCoverageStages.begin(), | 141 fCoverageProcInfo.calcCoverageWithPrimProc(pp, fCoverageStages.begin(), |
| (...skipping 26 matching lines...) Expand all Loading... |
| 169 void GrPipelineBuilder::calcCoverageInvariantOutput(GrColor coverage) const { | 168 void GrPipelineBuilder::calcCoverageInvariantOutput(GrColor coverage) const { |
| 170 if (!fCoverageProcInfoValid || coverage != fCoverageCache) { | 169 if (!fCoverageProcInfoValid || coverage != fCoverageCache) { |
| 171 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags; | 170 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags; |
| 172 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), | 171 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), |
| 173 this->numCoverageFragmentStages(
), coverage, flags, | 172 this->numCoverageFragmentStages(
), coverage, flags, |
| 174 true); | 173 true); |
| 175 fCoverageProcInfoValid = true; | 174 fCoverageProcInfoValid = true; |
| 176 fCoverageCache = coverage; | 175 fCoverageCache = coverage; |
| 177 } | 176 } |
| 178 } | 177 } |
| OLD | NEW |