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

Unified Diff: src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp

Issue 1352883002: Fix Ganesh perspective projection bug (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix Ganesh perspective projection bug Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLProgram.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
diff --git a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
index cde827939219dd9e3c7a1a7adef3f69009bf4e53..03ebca3ee132aaf38d7fab2aaa7c9d75172fc2e8 100644
--- a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
@@ -61,9 +61,10 @@ void GrGLVertexBuilder::transformToNormalizedDeviceSpace(const GrShaderVar& posV
"gl_Position = vec4(_posTmp.x * %s.x + %s.y, _posTmp.y * %s.z + %s.w, 0, 1);}",
joshualitt 2015/09/17 16:40:51 line wrap :-p
robertphillips 2015/09/17 16:45:41 Done.
fRtAdjustName, fRtAdjustName, fRtAdjustName, fRtAdjustName);
} else if (kVec3f_GrSLType == posVar.getType()) {
- this->codeAppendf("gl_Position = vec4(dot(%s.xz, %s.xy)/%s.z, dot(%s.yz, %s.zw)/%s.z, 0, 1);",
- posVar.c_str(), fRtAdjustName, posVar.c_str(),
- posVar.c_str(), fRtAdjustName, posVar.c_str());
+ this->codeAppendf("gl_Position = vec4(dot(%s.xz, %s.xy), dot(%s.yz, %s.zw), 0, %s.z);",
+ posVar.c_str(), fRtAdjustName,
+ posVar.c_str(), fRtAdjustName,
+ posVar.c_str());
} else {
SkASSERT(kVec2f_GrSLType == posVar.getType());
this->codeAppendf("gl_Position = vec4(%s.x * %s.x + %s.y, %s.y * %s.z + %s.w, 0, 1);",
« no previous file with comments | « src/gpu/gl/GrGLProgram.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698