| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 GrProcessorKeyBuilder* b) { | 94 GrProcessorKeyBuilder* b) { |
| 95 for (int i = 0; i < fp.numChildProcessors(); ++i) { | 95 for (int i = 0; i < fp.numChildProcessors(); ++i) { |
| 96 if (!gen_frag_proc_and_meta_keys(primProc, fp.childProcessor(i), glslCap
s, b)) { | 96 if (!gen_frag_proc_and_meta_keys(primProc, fp.childProcessor(i), glslCap
s, b)) { |
| 97 return false; | 97 return false; |
| 98 } | 98 } |
| 99 } | 99 } |
| 100 | 100 |
| 101 fp.getGLSLProcessorKey(glslCaps, b); | 101 fp.getGLSLProcessorKey(glslCaps, b); |
| 102 | 102 |
| 103 return gen_meta_key(fp, glslCaps, primProc.getTransformKey(fp.coordTransform
s(), | 103 return gen_meta_key(fp, glslCaps, primProc.getTransformKey(fp.coordTransform
s(), |
| 104 fp.numTransformsE
xclChildren()), b); | 104 fp.numCoordTransf
orms()), b); |
| 105 } | 105 } |
| 106 | 106 |
| 107 bool GrProgramDesc::Build(GrProgramDesc* desc, | 107 bool GrProgramDesc::Build(GrProgramDesc* desc, |
| 108 const GrPrimitiveProcessor& primProc, | 108 const GrPrimitiveProcessor& primProc, |
| 109 const GrPipeline& pipeline, | 109 const GrPipeline& pipeline, |
| 110 const GrGLSLCaps& glslCaps) { | 110 const GrGLSLCaps& glslCaps) { |
| 111 // The descriptor is used as a cache key. Thus when a field of the | 111 // The descriptor is used as a cache key. Thus when a field of the |
| 112 // descriptor will not affect program generation (because of the attribute | 112 // descriptor will not affect program generation (because of the attribute |
| 113 // bindings in use or other descriptor field settings) it should be set | 113 // bindings in use or other descriptor field settings) it should be set |
| 114 // to a canonical value to avoid duplicate programs with different keys. | 114 // to a canonical value to avoid duplicate programs with different keys. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 header->fIgnoresCoverage = 1; | 175 header->fIgnoresCoverage = 1; |
| 176 } else { | 176 } else { |
| 177 header->fIgnoresCoverage = 0; | 177 header->fIgnoresCoverage = 0; |
| 178 } | 178 } |
| 179 | 179 |
| 180 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters(); | 180 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters(); |
| 181 header->fColorEffectCnt = pipeline.numColorFragmentProcessors(); | 181 header->fColorEffectCnt = pipeline.numColorFragmentProcessors(); |
| 182 header->fCoverageEffectCnt = pipeline.numCoverageFragmentProcessors(); | 182 header->fCoverageEffectCnt = pipeline.numCoverageFragmentProcessors(); |
| 183 return true; | 183 return true; |
| 184 } | 184 } |
| OLD | NEW |