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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 pipeline->fNumColorProcessors = builder.numColorFragmentProcessors() - first
ColorProcessorIdx; | 89 pipeline->fNumColorProcessors = builder.numColorFragmentProcessors() - first
ColorProcessorIdx; |
90 int numTotalProcessors = pipeline->fNumColorProcessors + | 90 int numTotalProcessors = pipeline->fNumColorProcessors + |
91 builder.numCoverageFragmentProcessors() - firstCove
rageProcessorIdx; | 91 builder.numCoverageFragmentProcessors() - firstCove
rageProcessorIdx; |
92 pipeline->fFragmentProcessors.reset(numTotalProcessors); | 92 pipeline->fFragmentProcessors.reset(numTotalProcessors); |
93 int currFPIdx = 0; | 93 int currFPIdx = 0; |
94 for (int i = firstColorProcessorIdx; i < builder.numColorFragmentProcessors(
); | 94 for (int i = firstColorProcessorIdx; i < builder.numColorFragmentProcessors(
); |
95 ++i, ++currFPIdx) { | 95 ++i, ++currFPIdx) { |
96 const GrFragmentProcessor* fp = builder.getColorFragmentProcessor(i); | 96 const GrFragmentProcessor* fp = builder.getColorFragmentProcessor(i); |
97 pipeline->fFragmentProcessors[currFPIdx].reset(fp); | 97 pipeline->fFragmentProcessors[currFPIdx].reset(fp); |
98 usesLocalCoords = usesLocalCoords || fp->usesLocalCoords(); | 98 usesLocalCoords = usesLocalCoords || fp->usesLocalCoords(); |
99 fp->gatherCoordTransforms(&pipeline->fCoordTransforms); | |
100 } | 99 } |
101 | 100 |
102 for (int i = firstCoverageProcessorIdx; i < builder.numCoverageFragmentProce
ssors(); | 101 for (int i = firstCoverageProcessorIdx; i < builder.numCoverageFragmentProce
ssors(); |
103 ++i, ++currFPIdx) { | 102 ++i, ++currFPIdx) { |
104 const GrFragmentProcessor* fp = builder.getCoverageFragmentProcessor(i); | 103 const GrFragmentProcessor* fp = builder.getCoverageFragmentProcessor(i); |
105 pipeline->fFragmentProcessors[currFPIdx].reset(fp); | 104 pipeline->fFragmentProcessors[currFPIdx].reset(fp); |
106 usesLocalCoords = usesLocalCoords || fp->usesLocalCoords(); | 105 usesLocalCoords = usesLocalCoords || fp->usesLocalCoords(); |
107 fp->gatherCoordTransforms(&pipeline->fCoordTransforms); | |
108 } | 106 } |
109 | 107 |
110 // Setup info we need to pass to GrPrimitiveProcessors that are used with th
is GrPipeline. | 108 // Setup info we need to pass to GrPrimitiveProcessors that are used with th
is GrPipeline. |
111 opts->fFlags = 0; | 109 opts->fFlags = 0; |
112 if (!SkToBool(optFlags & GrXferProcessor::kIgnoreColor_OptFlag)) { | 110 if (!SkToBool(optFlags & GrXferProcessor::kIgnoreColor_OptFlag)) { |
113 opts->fFlags |= GrPipelineOptimizations::kReadsColor_Flag; | 111 opts->fFlags |= GrPipelineOptimizations::kReadsColor_Flag; |
114 } | 112 } |
115 if (GrColor_ILLEGAL != overrideColor) { | 113 if (GrColor_ILLEGAL != overrideColor) { |
116 opts->fFlags |= GrPipelineOptimizations::kUseOverrideColor_Flag; | 114 opts->fFlags |= GrPipelineOptimizations::kUseOverrideColor_Flag; |
117 opts->fOverrideColor = overrideColor; | 115 opts->fOverrideColor = overrideColor; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 } | 180 } |
183 | 181 |
184 for (int i = 0; i < a.numFragmentProcessors(); i++) { | 182 for (int i = 0; i < a.numFragmentProcessors(); i++) { |
185 if (!a.getFragmentProcessor(i).isEqual(b.getFragmentProcessor(i), ignore
CoordTransforms)) { | 183 if (!a.getFragmentProcessor(i).isEqual(b.getFragmentProcessor(i), ignore
CoordTransforms)) { |
186 return false; | 184 return false; |
187 } | 185 } |
188 } | 186 } |
189 return true; | 187 return true; |
190 } | 188 } |
191 | 189 |
OLD | NEW |