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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 // --------DO NOT MOVE HEADER ABOVE THIS LINE-------------------------------
------------------- | 152 // --------DO NOT MOVE HEADER ABOVE THIS LINE-------------------------------
------------------- |
153 // Because header is a pointer into the dynamic array, we can't push any new
data into the key | 153 // Because header is a pointer into the dynamic array, we can't push any new
data into the key |
154 // below here. | 154 // below here. |
155 KeyHeader* header = glDesc->atOffset<KeyHeader, kHeaderOffset>(); | 155 KeyHeader* header = glDesc->atOffset<KeyHeader, kHeaderOffset>(); |
156 | 156 |
157 // make sure any padding in the header is zeroed. | 157 // make sure any padding in the header is zeroed. |
158 memset(header, 0, kHeaderSize); | 158 memset(header, 0, kHeaderSize); |
159 | 159 |
160 if (pipeline.readsFragPosition()) { | 160 if (pipeline.readsFragPosition()) { |
161 header->fFragPosKey = | 161 header->fFragPosKey = |
162 GrGLFragmentShaderBuilder::KeyForFragmentPosition(pipeline.getRe
nderTarget(), | 162 GrGLFragmentShaderBuilder::KeyForFragmentPosition(pipeline.getRe
nderTarget()); |
163 gpu->glCaps())
; | |
164 } else { | 163 } else { |
165 header->fFragPosKey = 0; | 164 header->fFragPosKey = 0; |
166 } | 165 } |
167 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters(); | 166 header->fSnapVerticesToPixelCenters = pipeline.snapVerticesToPixelCenters(); |
168 header->fColorEffectCnt = pipeline.numColorFragmentProcessors(); | 167 header->fColorEffectCnt = pipeline.numColorFragmentProcessors(); |
169 header->fCoverageEffectCnt = pipeline.numCoverageFragmentProcessors(); | 168 header->fCoverageEffectCnt = pipeline.numCoverageFragmentProcessors(); |
170 glDesc->finalize(); | 169 glDesc->finalize(); |
171 return true; | 170 return true; |
172 } | 171 } |
OLD | NEW |