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 "GrPipeline.h" | 8 #include "GrPipeline.h" |
9 | 9 |
10 #include "GrCaps.h" | 10 #include "GrCaps.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } | 113 } |
114 if (!SkToBool(optFlags & GrXferProcessor::kIgnoreCoverage_OptFlag)) { | 114 if (!SkToBool(optFlags & GrXferProcessor::kIgnoreCoverage_OptFlag)) { |
115 opts->fFlags |= GrPipelineOptimizations::kReadsCoverage_Flag; | 115 opts->fFlags |= GrPipelineOptimizations::kReadsCoverage_Flag; |
116 } | 116 } |
117 if (usesLocalCoords) { | 117 if (usesLocalCoords) { |
118 opts->fFlags |= GrPipelineOptimizations::kReadsLocalCoords_Flag; | 118 opts->fFlags |= GrPipelineOptimizations::kReadsLocalCoords_Flag; |
119 } | 119 } |
120 if (SkToBool(optFlags & GrXferProcessor::kCanTweakAlphaForCoverage_OptFlag))
{ | 120 if (SkToBool(optFlags & GrXferProcessor::kCanTweakAlphaForCoverage_OptFlag))
{ |
121 opts->fFlags |= GrPipelineOptimizations::kCanTweakAlphaForCoverage_Flag;
| 121 opts->fFlags |= GrPipelineOptimizations::kCanTweakAlphaForCoverage_Flag;
|
122 } | 122 } |
| 123 |
| 124 GrXPFactory::InvariantBlendedColor blendedColor; |
| 125 builder.fXPFactory->getInvariantBlendedColor(args.fColorPOI, &blendedColor); |
| 126 if (blendedColor.fWillBlendWithDst) { |
| 127 opts->fFlags |= GrPipelineOptimizations::kWillColorBlendWithDst_Flag; |
| 128 } |
| 129 |
123 return pipeline; | 130 return pipeline; |
124 } | 131 } |
125 | 132 |
126 void GrPipeline::adjustProgramFromOptimizations(const GrPipelineBuilder& pipelin
eBuilder, | 133 void GrPipeline::adjustProgramFromOptimizations(const GrPipelineBuilder& pipelin
eBuilder, |
127 GrXferProcessor::OptFlags flags, | 134 GrXferProcessor::OptFlags flags, |
128 const GrProcOptInfo& colorPOI, | 135 const GrProcOptInfo& colorPOI, |
129 const GrProcOptInfo& coveragePOI
, | 136 const GrProcOptInfo& coveragePOI
, |
130 int* firstColorStageIdx, | 137 int* firstColorStageIdx, |
131 int* firstCoverageStageIdx) { | 138 int* firstCoverageStageIdx) { |
132 fReadsFragPosition = fXferProcessor->willReadFragmentPosition(); | 139 fReadsFragPosition = fXferProcessor->willReadFragmentPosition(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 178 |
172 for (int i = 0; i < a.numFragmentStages(); i++) { | 179 for (int i = 0; i < a.numFragmentStages(); i++) { |
173 if (!a.getFragmentStage(i).processor()->isEqual(*b.getFragmentStage(i).p
rocessor(), | 180 if (!a.getFragmentStage(i).processor()->isEqual(*b.getFragmentStage(i).p
rocessor(), |
174 ignoreCoordTransform
s)) { | 181 ignoreCoordTransform
s)) { |
175 return false; | 182 return false; |
176 } | 183 } |
177 } | 184 } |
178 return true; | 185 return true; |
179 } | 186 } |
180 | 187 |
OLD | NEW |