| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 #include "GrProgramDesc.h" | 7 #include "GrProgramDesc.h" |
| 8 | 8 |
| 9 #include "GrProcessor.h" | 9 #include "GrProcessor.h" |
| 10 #include "GrPipeline.h" | 10 #include "GrPipeline.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 if (requiredFeatures & (GrProcessor::kFragmentPosition_RequiredFeature | | 158 if (requiredFeatures & (GrProcessor::kFragmentPosition_RequiredFeature | |
| 159 GrProcessor::kSampleLocations_RequiredFeature)) { | 159 GrProcessor::kSampleLocations_RequiredFeature)) { |
| 160 header->fSurfaceOriginKey = GrGLSLFragmentShaderBuilder::KeyForSurfaceOr
igin(rt->origin()); | 160 header->fSurfaceOriginKey = GrGLSLFragmentShaderBuilder::KeyForSurfaceOr
igin(rt->origin()); |
| 161 } else { | 161 } else { |
| 162 header->fSurfaceOriginKey = 0; | 162 header->fSurfaceOriginKey = 0; |
| 163 } | 163 } |
| 164 | 164 |
| 165 if (requiredFeatures & GrProcessor::kSampleLocations_RequiredFeature) { | 165 if (requiredFeatures & GrProcessor::kSampleLocations_RequiredFeature) { |
| 166 SkASSERT(pipeline.isHWAntialiasState()); | 166 SkASSERT(pipeline.isHWAntialiasState()); |
| 167 header->fSamplePatternKey = | 167 header->fSamplePatternKey = |
| 168 rt->renderTargetPriv().getMultisampleSpecs(pipeline.getStencil()).fU
niqueID; | 168 rt->renderTargetPriv().getMultisampleSpecs(pipeline).fUniqueID; |
| 169 } else { | 169 } else { |
| 170 header->fSamplePatternKey = 0; | 170 header->fSamplePatternKey = 0; |
| 171 } | 171 } |
| 172 | 172 |
| 173 header->fOutputSwizzle = glslCaps.configOutputSwizzle(rt->config()).asKey(); | 173 header->fOutputSwizzle = glslCaps.configOutputSwizzle(rt->config()).asKey(); |
| 174 | 174 |
| 175 header->fIgnoresCoverage = pipeline.ignoresCoverage() ? 1 : 0; | 175 header->fIgnoresCoverage = pipeline.ignoresCoverage() ? 1 : 0; |
| 176 | 176 |
| 177 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters(); | 177 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters(); |
| 178 header->fColorFragmentProcessorCnt = pipeline.numColorFragmentProcessors(); | 178 header->fColorFragmentProcessorCnt = pipeline.numColorFragmentProcessors(); |
| 179 header->fCoverageFragmentProcessorCnt = pipeline.numCoverageFragmentProcesso
rs(); | 179 header->fCoverageFragmentProcessorCnt = pipeline.numCoverageFragmentProcesso
rs(); |
| 180 // Fail if the client requested more processors than the key can fit. | 180 // Fail if the client requested more processors than the key can fit. |
| 181 if (header->fColorFragmentProcessorCnt != pipeline.numColorFragmentProcessor
s() || | 181 if (header->fColorFragmentProcessorCnt != pipeline.numColorFragmentProcessor
s() || |
| 182 header->fCoverageFragmentProcessorCnt != pipeline.numCoverageFragmentPro
cessors()) { | 182 header->fCoverageFragmentProcessorCnt != pipeline.numCoverageFragmentPro
cessors()) { |
| 183 return false; | 183 return false; |
| 184 } | 184 } |
| 185 header->fHasPointSize = hasPointSize ? 1 : 0; | 185 header->fHasPointSize = hasPointSize ? 1 : 0; |
| 186 return true; | 186 return true; |
| 187 } | 187 } |
| OLD | NEW |