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

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

Issue 1145273002: Use high precision vertex attributes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 100-col fixes Created 5 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 "GrGLPrimitiveProcessor.h" 8 #include "GrGLPrimitiveProcessor.h"
9 9
10 #include "builders/GrGLProgramBuilder.h" 10 #include "builders/GrGLProgramBuilder.h"
(...skipping 29 matching lines...) Expand all
40 *colorUniform = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility, 40 *colorUniform = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility,
41 kVec4f_GrSLType, 41 kVec4f_GrSLType,
42 kDefault_GrSLPrecision, 42 kDefault_GrSLPrecision,
43 "Color", 43 "Color",
44 &stagedLocalVarName); 44 &stagedLocalVarName);
45 fs->codeAppendf("%s = %s;", outputName, stagedLocalVarName); 45 fs->codeAppendf("%s = %s;", outputName, stagedLocalVarName);
46 } 46 }
47 47
48 void GrGLPrimitiveProcessor::addUniformViewMatrix(GrGLGPBuilder* pb) { 48 void GrGLPrimitiveProcessor::addUniformViewMatrix(GrGLGPBuilder* pb) {
49 fViewMatrixUniform = pb->addUniform(GrGLProgramBuilder::kVertex_Visibility, 49 fViewMatrixUniform = pb->addUniform(GrGLProgramBuilder::kVertex_Visibility,
50 kMat33f_GrSLType, kDefault_GrSLPrecision , 50 kMat33f_GrSLType, kHigh_GrSLPrecision,
51 "uViewM", 51 "uViewM",
52 &fViewMatrixName); 52 &fViewMatrixName);
53 } 53 }
54 54
55 void GrGLPrimitiveProcessor::setUniformViewMatrix(const GrGLProgramDataManager& pdman, 55 void GrGLPrimitiveProcessor::setUniformViewMatrix(const GrGLProgramDataManager& pdman,
56 const SkMatrix& viewMatrix) { 56 const SkMatrix& viewMatrix) {
57 if (!viewMatrix.isIdentity() && !fViewMatrix.cheapEqualTo(viewMatrix)) { 57 if (!viewMatrix.isIdentity() && !fViewMatrix.cheapEqualTo(viewMatrix)) {
58 SkASSERT(fViewMatrixUniform.isValid()); 58 SkASSERT(fViewMatrixUniform.isValid());
59 fViewMatrix = viewMatrix; 59 fViewMatrix = viewMatrix;
60 60
61 GrGLfloat viewMatrix[3 * 3]; 61 GrGLfloat viewMatrix[3 * 3];
62 GrGLGetMatrix<3>(viewMatrix, fViewMatrix); 62 GrGLGetMatrix<3>(viewMatrix, fViewMatrix);
63 pdman.setMatrix3f(fViewMatrixUniform, viewMatrix); 63 pdman.setMatrix3f(fViewMatrixUniform, viewMatrix);
64 } 64 }
65 } 65 }
OLDNEW
« no previous file with comments | « src/gpu/effects/GrDistanceFieldGeoProc.cpp ('k') | src/gpu/gl/builders/GrGLVertexShaderBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698