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

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: Blend off ODS and only on XP 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
« no previous file with comments | « src/gpu/gl/GrGLProgram.cpp ('k') | src/gpu/gl/GrGLXferProcessor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 desc->fKey.reset(); 182 desc->fKey.reset();
183 return false; 183 return false;
184 } 184 }
185 } 185 }
186 186
187 for (int s = 0; s < optState.numFragmentStages(); ++s) { 187 for (int s = 0; s < optState.numFragmentStages(); ++s) {
188 const GrPendingFragmentStage& fps = optState.getFragmentStage(s); 188 const GrPendingFragmentStage& fps = optState.getFragmentStage(s);
189 const GrFragmentProcessor& fp = *fps.getProcessor(); 189 const GrFragmentProcessor& fp = *fps.getProcessor();
190 GrProcessorKeyBuilder b(&desc->fKey); 190 GrProcessorKeyBuilder b(&desc->fKey);
191 fp.getGLProcessorKey(gpu->glCaps(), &b); 191 fp.getGLProcessorKey(gpu->glCaps(), &b);
192 if (!get_meta_key(*fps.getProcessor(), gpu->glCaps(), 192 if (!get_meta_key(fp, gpu->glCaps(),
193 gen_transform_key(fps, requiresLocalCoordAttrib), 0, &b )) { 193 gen_transform_key(fps, requiresLocalCoordAttrib), 0, & b)) {
194 desc->fKey.reset(); 194 desc->fKey.reset();
195 return false; 195 return false;
196 } 196 }
197 } 197 }
198 198
199 const GrXferProcessor& xp = *optState.getXferProcessor();
200 GrProcessorKeyBuilder b(&desc->fKey);
201 xp.getGLProcessorKey(gpu->glCaps(), &b);
202 if (!get_meta_key(xp, gpu->glCaps(), 0, 0, &b)) {
203 desc->fKey.reset();
204 return false;
205 }
206
199 // --------DO NOT MOVE HEADER ABOVE THIS LINE------------------------------- ------------------- 207 // --------DO NOT MOVE HEADER ABOVE THIS LINE------------------------------- -------------------
200 // Because header is a pointer into the dynamic array, we can't push any new data into the key 208 // Because header is a pointer into the dynamic array, we can't push any new data into the key
201 // below here. 209 // below here.
202 GLKeyHeader* header = desc->atOffset<GLKeyHeader, kHeaderOffset>(); 210 GLKeyHeader* header = desc->atOffset<GLKeyHeader, kHeaderOffset>();
203 211
204 // make sure any padding in the header is zeroed. 212 // make sure any padding in the header is zeroed.
205 memset(header, 0, kHeaderSize); 213 memset(header, 0, kHeaderSize);
206 214
207 header->fHasGeometryProcessor = optState.hasGeometryProcessor(); 215 header->fHasGeometryProcessor = optState.hasGeometryProcessor();
208 216
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } 261 }
254 262
255 if (descInfo.fReadsFragPosition) { 263 if (descInfo.fReadsFragPosition) {
256 header->fFragPosKey = 264 header->fFragPosKey =
257 GrGLFragmentShaderBuilder::KeyForFragmentPosition(optState.getRe nderTarget(), 265 GrGLFragmentShaderBuilder::KeyForFragmentPosition(optState.getRe nderTarget(),
258 gpu->glCaps()) ; 266 gpu->glCaps()) ;
259 } else { 267 } else {
260 header->fFragPosKey = 0; 268 header->fFragPosKey = 0;
261 } 269 }
262 270
263 header->fPrimaryOutputType = descInfo.fPrimaryOutputType;
264 header->fSecondaryOutputType = descInfo.fSecondaryOutputType;
265
266 header->fColorEffectCnt = optState.numColorStages(); 271 header->fColorEffectCnt = optState.numColorStages();
267 header->fCoverageEffectCnt = optState.numCoverageStages(); 272 header->fCoverageEffectCnt = optState.numCoverageStages();
268 desc->finalize(); 273 desc->finalize();
269 return true; 274 return true;
270 } 275 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLProgram.cpp ('k') | src/gpu/gl/GrGLXferProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698