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

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

Issue 1431433003: Move shader compiling to ProgramBuilder and various ShaderBuilder cleanups. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nits Created 5 years, 1 month 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/builders/GrGLFragmentShaderBuilder.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 "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
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 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLProgram.cpp ('k') | src/gpu/gl/builders/GrGLFragmentShaderBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698