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

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

Issue 920933002: fix for uniform view matrix being uploaded but not used (Closed) Base URL: https://skia.googlesource.com/skia.git@gp_cleanup_1
Patch Set: Created 5 years, 10 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
« no previous file with comments | « src/gpu/gl/GrGLGeometryProcessor.h ('k') | src/gpu/gl/GrGLPrimitiveProcessor.cpp » ('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 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 "GrGLGeometryProcessor.h" 8 #include "GrGLGeometryProcessor.h"
9 9
10 #include "builders/GrGLProgramBuilder.h" 10 #include "builders/GrGLProgramBuilder.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 for (int t = 0; t < numTransforms; ++t) { 99 for (int t = 0; t < numTransforms; ++t) {
100 SkASSERT(procTransforms[t].fHandle.isValid()); 100 SkASSERT(procTransforms[t].fHandle.isValid());
101 const SkMatrix& transform = GetTransformMatrix(primProc.localMatrix(), * transforms[t]); 101 const SkMatrix& transform = GetTransformMatrix(primProc.localMatrix(), * transforms[t]);
102 if (!procTransforms[t].fCurrentValue.cheapEqualTo(transform)) { 102 if (!procTransforms[t].fCurrentValue.cheapEqualTo(transform)) {
103 pdman.setSkMatrix(procTransforms[t].fHandle.convertToUniformHandle() , transform); 103 pdman.setSkMatrix(procTransforms[t].fHandle.convertToUniformHandle() , transform);
104 procTransforms[t].fCurrentValue = transform; 104 procTransforms[t].fCurrentValue = transform;
105 } 105 }
106 } 106 }
107 } 107 }
108 108
109 void GrGLGeometryProcessor::SetupPosition(GrGLVertexBuilder* vsBuilder, 109 void GrGLGeometryProcessor::setupPosition(GrGLGPBuilder* pb,
110 GrGPArgs* gpArgs, 110 GrGPArgs* gpArgs,
111 const char* posName, 111 const char* posName,
112 const SkMatrix& mat, 112 const SkMatrix& mat) {
113 const char* matName) { 113 GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
114 if (mat.isIdentity()) { 114 if (mat.isIdentity()) {
115 gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2"); 115 gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2");
116 116
117 vsBuilder->codeAppendf("vec2 %s = %s;", gpArgs->fPositionVar.c_str(), po sName); 117 vsBuilder->codeAppendf("vec2 %s = %s;", gpArgs->fPositionVar.c_str(), po sName);
118 } else if (!mat.hasPerspective()) { 118 } else if (!mat.hasPerspective()) {
119 this->addUniformViewMatrix(pb);
119 gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2"); 120 gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2");
120 121
121 vsBuilder->codeAppendf("vec2 %s = vec2(%s * vec3(%s, 1));", 122 vsBuilder->codeAppendf("vec2 %s = vec2(%s * vec3(%s, 1));",
122 gpArgs->fPositionVar.c_str(), matName, posName); 123 gpArgs->fPositionVar.c_str(), this->uViewM(), pos Name);
123 } else { 124 } else {
125 this->addUniformViewMatrix(pb);
124 gpArgs->fPositionVar.set(kVec3f_GrSLType, "pos3"); 126 gpArgs->fPositionVar.set(kVec3f_GrSLType, "pos3");
125 127
126 vsBuilder->codeAppendf("vec3 %s = %s * vec3(%s, 1);", 128 vsBuilder->codeAppendf("vec3 %s = %s * vec3(%s, 1);",
127 gpArgs->fPositionVar.c_str(), matName, posName); 129 gpArgs->fPositionVar.c_str(), this->uViewM(), pos Name);
128 } 130 }
129 } 131 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLGeometryProcessor.h ('k') | src/gpu/gl/GrGLPrimitiveProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698