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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 fColorProcInfoValid = false; | 80 fColorProcInfoValid = false; |
81 fCoverageProcInfoValid = false; | 81 fCoverageProcInfoValid = false; |
82 | 82 |
83 fColorCache = GrColor_ILLEGAL; | 83 fColorCache = GrColor_ILLEGAL; |
84 fCoverageCache = GrColor_ILLEGAL; | 84 fCoverageCache = GrColor_ILLEGAL; |
85 } | 85 } |
86 | 86 |
87 //////////////////////////////////////////////////////////////////////////////s | 87 //////////////////////////////////////////////////////////////////////////////s |
88 | 88 |
89 bool GrPipelineBuilder::willXPNeedDstTexture(const GrCaps& caps, | 89 bool GrPipelineBuilder::willXPNeedDstCopy(const GrCaps& caps, |
90 const GrProcOptInfo& colorPOI, | 90 const GrProcOptInfo& colorPOI, |
91 const GrProcOptInfo& coveragePOI) c
onst { | 91 const GrProcOptInfo& coveragePOI) cons
t { |
92 return this->getXPFactory()->willNeedDstTexture(caps, colorPOI, coveragePOI)
; | 92 return this->getXPFactory()->willNeedDstCopy(caps, colorPOI, coveragePOI); |
93 } | 93 } |
94 | 94 |
95 void GrPipelineBuilder::AutoRestoreFragmentProcessors::set(GrPipelineBuilder* pi
pelineBuilder) { | 95 void GrPipelineBuilder::AutoRestoreFragmentProcessors::set(GrPipelineBuilder* pi
pelineBuilder) { |
96 if (fPipelineBuilder) { | 96 if (fPipelineBuilder) { |
97 int m = fPipelineBuilder->numColorFragmentStages() - fColorEffectCnt; | 97 int m = fPipelineBuilder->numColorFragmentStages() - fColorEffectCnt; |
98 SkASSERT(m >= 0); | 98 SkASSERT(m >= 0); |
99 fPipelineBuilder->fColorStages.pop_back_n(m); | 99 fPipelineBuilder->fColorStages.pop_back_n(m); |
100 | 100 |
101 int n = fPipelineBuilder->numCoverageFragmentStages() - fCoverageEffectC
nt; | 101 int n = fPipelineBuilder->numCoverageFragmentStages() - fCoverageEffectC
nt; |
102 SkASSERT(n >= 0); | 102 SkASSERT(n >= 0); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 void GrPipelineBuilder::calcCoverageInvariantOutput(GrColor coverage) const { | 169 void GrPipelineBuilder::calcCoverageInvariantOutput(GrColor coverage) const { |
170 if (!fCoverageProcInfoValid || coverage != fCoverageCache) { | 170 if (!fCoverageProcInfoValid || coverage != fCoverageCache) { |
171 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags; | 171 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags; |
172 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), | 172 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), |
173 this->numCoverageFragmentStages(
), coverage, flags, | 173 this->numCoverageFragmentStages(
), coverage, flags, |
174 true); | 174 true); |
175 fCoverageProcInfoValid = true; | 175 fCoverageProcInfoValid = true; |
176 fCoverageCache = coverage; | 176 fCoverageCache = coverage; |
177 } | 177 } |
178 } | 178 } |
OLD | NEW |