Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Side by Side Diff: src/gpu/gl/GrGLProgramDesc.cpp

Issue 764643004: Create xfer processor backend. (Closed) Base URL: https://skia.googlesource.com/skia.git@xferBlendSolo
Patch Set: updated and rebased from prev cls Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "GrGLProcessor.h" 9 #include "GrGLProcessor.h"
10 #include "GrProcessor.h" 10 #include "GrProcessor.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 desc->fKey.reset(); 171 desc->fKey.reset();
172 return false; 172 return false;
173 } 173 }
174 } 174 }
175 175
176 for (int s = 0; s < optState.numFragmentStages(); ++s) { 176 for (int s = 0; s < optState.numFragmentStages(); ++s) {
177 const GrPendingFragmentStage& fps = optState.getFragmentStage(s); 177 const GrPendingFragmentStage& fps = optState.getFragmentStage(s);
178 const GrFragmentProcessor& fp = *fps.getProcessor(); 178 const GrFragmentProcessor& fp = *fps.getProcessor();
179 GrProcessorKeyBuilder b(&desc->fKey); 179 GrProcessorKeyBuilder b(&desc->fKey);
180 fp.getGLProcessorKey(gpu->glCaps(), &b); 180 fp.getGLProcessorKey(gpu->glCaps(), &b);
181 if (!get_meta_key(*fps.getProcessor(), gpu->glCaps(), 181 if (!get_meta_key(fp, gpu->glCaps(),
182 gen_transform_key(fps, requiresLocalCoordAttrib), 0, &b )) { 182 gen_transform_key(fps, requiresLocalCoordAttrib), 0, & b)) {
183 desc->fKey.reset(); 183 desc->fKey.reset();
184 return false; 184 return false;
185 } 185 }
186 } 186 }
187 187
188 const GrXferProcessor& xp = *optState.getXferProcessor();
189 GrProcessorKeyBuilder b(&desc->fKey);
190 xp.getGLProcessorKey(gpu->glCaps(), &b);
191 if (!get_meta_key(xp, gpu->glCaps(), 0, 0, &b)) {
192 desc->fKey.reset();
193 return false;
194 }
195
188 // --------DO NOT MOVE HEADER ABOVE THIS LINE------------------------------- ------------------- 196 // --------DO NOT MOVE HEADER ABOVE THIS LINE------------------------------- -------------------
189 // Because header is a pointer into the dynamic array, we can't push any new data into the key 197 // Because header is a pointer into the dynamic array, we can't push any new data into the key
190 // below here. 198 // below here.
191 GLKeyHeader* header = desc->atOffset<GLKeyHeader, kHeaderOffset>(); 199 GLKeyHeader* header = desc->atOffset<GLKeyHeader, kHeaderOffset>();
192 200
193 // make sure any padding in the header is zeroed. 201 // make sure any padding in the header is zeroed.
194 memset(header, 0, kHeaderSize); 202 memset(header, 0, kHeaderSize);
195 203
196 header->fHasGeometryProcessor = optState.hasGeometryProcessor(); 204 header->fHasGeometryProcessor = optState.hasGeometryProcessor();
197 205
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 } 250 }
243 251
244 if (descInfo.fReadsFragPosition) { 252 if (descInfo.fReadsFragPosition) {
245 header->fFragPosKey = 253 header->fFragPosKey =
246 GrGLFragmentShaderBuilder::KeyForFragmentPosition(optState.getRe nderTarget(), 254 GrGLFragmentShaderBuilder::KeyForFragmentPosition(optState.getRe nderTarget(),
247 gpu->glCaps()) ; 255 gpu->glCaps()) ;
248 } else { 256 } else {
249 header->fFragPosKey = 0; 257 header->fFragPosKey = 0;
250 } 258 }
251 259
252 header->fPrimaryOutputType = descInfo.fPrimaryOutputType;
253 header->fSecondaryOutputType = descInfo.fSecondaryOutputType;
254
255 header->fColorEffectCnt = optState.numColorStages(); 260 header->fColorEffectCnt = optState.numColorStages();
256 header->fCoverageEffectCnt = optState.numCoverageStages(); 261 header->fCoverageEffectCnt = optState.numCoverageStages();
257 desc->finalize(); 262 desc->finalize();
258 return true; 263 return true;
259 } 264 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698