OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "GrGLProgramDesc.h" | 7 #include "GrGLProgramDesc.h" |
8 | 8 |
9 #include "GrGLFragmentProcessor.h" | 9 #include "GrGLFragmentProcessor.h" |
10 #include "GrProcessor.h" | 10 #include "GrProcessor.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 GrProcessorKeyBuilder b(&glDesc->key()); | 128 GrProcessorKeyBuilder b(&glDesc->key()); |
129 | 129 |
130 primProc.getGLProcessorKey(batchTracker, *gpu->glCaps().glslCaps(), &b); | 130 primProc.getGLProcessorKey(batchTracker, *gpu->glCaps().glslCaps(), &b); |
131 //**** use glslCaps here? | 131 //**** use glslCaps here? |
132 if (!get_meta_key(primProc, gpu->glCaps(), 0, &b)) { | 132 if (!get_meta_key(primProc, gpu->glCaps(), 0, &b)) { |
133 glDesc->key().reset(); | 133 glDesc->key().reset(); |
134 return false; | 134 return false; |
135 } | 135 } |
136 | 136 |
137 for (int i = 0; i < pipeline.numFragmentProcessors(); ++i) { | 137 for (int s = 0; s < pipeline.numFragmentStages(); ++s) { |
138 const GrFragmentProcessor& fp = pipeline.getFragmentProcessor(i); | 138 const GrPendingFragmentStage& fps = pipeline.getFragmentStage(s); |
| 139 const GrFragmentProcessor& fp = *fps.processor(); |
139 if (!get_frag_proc_and_meta_keys(primProc, fp, gpu->glCaps(), &b)) { | 140 if (!get_frag_proc_and_meta_keys(primProc, fp, gpu->glCaps(), &b)) { |
140 glDesc->key().reset(); | 141 glDesc->key().reset(); |
141 return false; | 142 return false; |
142 } | 143 } |
143 } | 144 } |
144 | 145 |
145 const GrXferProcessor& xp = *pipeline.getXferProcessor(); | 146 const GrXferProcessor& xp = *pipeline.getXferProcessor(); |
146 xp.getGLProcessorKey(*gpu->glCaps().glslCaps(), &b); | 147 xp.getGLProcessorKey(*gpu->glCaps().glslCaps(), &b); |
147 //**** use glslCaps here? | 148 //**** use glslCaps here? |
148 if (!get_meta_key(xp, gpu->glCaps(), 0, &b)) { | 149 if (!get_meta_key(xp, gpu->glCaps(), 0, &b)) { |
(...skipping 10 matching lines...) Expand all Loading... |
159 memset(header, 0, kHeaderSize); | 160 memset(header, 0, kHeaderSize); |
160 | 161 |
161 if (pipeline.readsFragPosition()) { | 162 if (pipeline.readsFragPosition()) { |
162 header->fFragPosKey = | 163 header->fFragPosKey = |
163 GrGLFragmentShaderBuilder::KeyForFragmentPosition(pipeline.getRe
nderTarget(), | 164 GrGLFragmentShaderBuilder::KeyForFragmentPosition(pipeline.getRe
nderTarget(), |
164 gpu->glCaps())
; | 165 gpu->glCaps())
; |
165 } else { | 166 } else { |
166 header->fFragPosKey = 0; | 167 header->fFragPosKey = 0; |
167 } | 168 } |
168 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters(); | 169 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters(); |
169 header->fColorEffectCnt = pipeline.numColorFragmentProcessors(); | 170 header->fColorEffectCnt = pipeline.numColorFragmentStages(); |
170 header->fCoverageEffectCnt = pipeline.numCoverageFragmentProcessors(); | 171 header->fCoverageEffectCnt = pipeline.numCoverageFragmentStages(); |
171 glDesc->finalize(); | 172 glDesc->finalize(); |
172 return true; | 173 return true; |
173 } | 174 } |
OLD | NEW |