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

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

Issue 23537028: Enable vertexless shading when path rendering is supported (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 months 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 7
8 #include "gl/GrGLShaderBuilder.h" 8 #include "gl/GrGLShaderBuilder.h"
9 #include "gl/GrGLProgram.h" 9 #include "gl/GrGLProgram.h"
10 #include "gl/GrGLUniformHandle.h" 10 #include "gl/GrGLUniformHandle.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 if (kUnusedUniform != uni.fFSLocation) { 226 if (kUnusedUniform != uni.fFSLocation) {
227 GR_GL_CALL(fGpu->glInterface(), 227 GR_GL_CALL(fGpu->glInterface(),
228 UniformMatrix4fv(uni.fFSLocation + offset, arrayCount, false, matrices)); 228 UniformMatrix4fv(uni.fFSLocation + offset, arrayCount, false, matrices));
229 } 229 }
230 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) { 230 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
231 GR_GL_CALL(fGpu->glInterface(), 231 GR_GL_CALL(fGpu->glInterface(),
232 UniformMatrix4fv(uni.fVSLocation + offset, arrayCount, false, matrices)); 232 UniformMatrix4fv(uni.fVSLocation + offset, arrayCount, false, matrices));
233 } 233 }
234 } 234 }
235 235
236 void GrGLUniformManager::enableGlobalTexGen(int unitIndex,
237 int numComponents,
238 const GrGLfloat* coefficients) const {
239 fGpu->enableTexGen(unitIndex, numComponents, coefficients);
240 }
241
242 void GrGLUniformManager::enableGlobalTexGen(int unitIndex,
243 int numComponents,
244 const SkMatrix& matrix) const {
245 fGpu->enableTexGen(unitIndex, numComponents, matrix);
246 }
247
236 void GrGLUniformManager::setSkMatrix(UniformHandle u, const SkMatrix& matrix) co nst { 248 void GrGLUniformManager::setSkMatrix(UniformHandle u, const SkMatrix& matrix) co nst {
237 // GR_STATIC_ASSERT(SK_SCALAR_IS_FLOAT); 249 // GR_STATIC_ASSERT(SK_SCALAR_IS_FLOAT);
238 GrGLfloat mt[] = { 250 GrGLfloat mt[] = {
239 matrix.get(SkMatrix::kMScaleX), 251 matrix.get(SkMatrix::kMScaleX),
240 matrix.get(SkMatrix::kMSkewY), 252 matrix.get(SkMatrix::kMSkewY),
241 matrix.get(SkMatrix::kMPersp0), 253 matrix.get(SkMatrix::kMPersp0),
242 matrix.get(SkMatrix::kMSkewX), 254 matrix.get(SkMatrix::kMSkewX),
243 matrix.get(SkMatrix::kMScaleY), 255 matrix.get(SkMatrix::kMScaleY),
244 matrix.get(SkMatrix::kMPersp1), 256 matrix.get(SkMatrix::kMPersp1),
245 matrix.get(SkMatrix::kMTransX), 257 matrix.get(SkMatrix::kMTransX),
(...skipping 20 matching lines...) Expand all
266 if (GrGLShaderBuilder::kFragment_Visibility & uniforms[i].fVisibility) { 278 if (GrGLShaderBuilder::kFragment_Visibility & uniforms[i].fVisibility) {
267 fUniforms[i].fFSLocation = location; 279 fUniforms[i].fFSLocation = location;
268 } 280 }
269 } 281 }
270 } 282 }
271 283
272 const GrGLUniformManager::BuilderUniform& 284 const GrGLUniformManager::BuilderUniform&
273 GrGLUniformManager::getBuilderUniform(const BuilderUniformArray& array, UniformH andle handle) const { 285 GrGLUniformManager::getBuilderUniform(const BuilderUniformArray& array, UniformH andle handle) const {
274 return array[handle.toUniformIndex()]; 286 return array[handle.toUniformIndex()];
275 } 287 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698