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

Side by Side Diff: src/gpu/gl/GrGLProgram.h

Issue 1352883002: Fix Ganesh perspective projection bug (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixed overlength line 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/gpu/gl/builders/GrGLVertexShaderBuilder.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 2011 Google Inc. 2 * Copyright 2011 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 8
9 #ifndef GrGLProgram_DEFINED 9 #ifndef GrGLProgram_DEFINED
10 #define GrGLProgram_DEFINED 10 #define GrGLProgram_DEFINED
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 fRenderTargetSize.fWidth = -1; 65 fRenderTargetSize.fWidth = -1;
66 fRenderTargetSize.fHeight = -1; 66 fRenderTargetSize.fHeight = -1;
67 fRenderTargetOrigin = (GrSurfaceOrigin) -1; 67 fRenderTargetOrigin = (GrSurfaceOrigin) -1;
68 } 68 }
69 69
70 /** 70 /**
71 * Gets a vec4 that adjusts the position from Skia device coords to GL's normalized device 71 * Gets a vec4 that adjusts the position from Skia device coords to GL's normalized device
72 * coords. Assuming the transformed position, pos, is a homogeneous vec3 , the vec, v, is 72 * coords. Assuming the transformed position, pos, is a homogeneous vec3 , the vec, v, is
73 * applied as such: 73 * applied as such:
74 * pos.x = dot(v.xy, pos.xz) 74 * pos.x = dot(v.xy, pos.xz)
75 * pos.y = dot(v.zq, pos.yz) 75 * pos.y = dot(v.zw, pos.yz)
76 */ 76 */
77 void getRTAdjustmentVec(GrGLfloat* destVec) { 77 void getRTAdjustmentVec(GrGLfloat* destVec) {
78 destVec[0] = 2.f / fRenderTargetSize.fWidth; 78 destVec[0] = 2.f / fRenderTargetSize.fWidth;
79 destVec[1] = -1.f; 79 destVec[1] = -1.f;
80 if (kBottomLeft_GrSurfaceOrigin == fRenderTargetOrigin) { 80 if (kBottomLeft_GrSurfaceOrigin == fRenderTargetOrigin) {
81 destVec[2] = -2.f / fRenderTargetSize.fHeight; 81 destVec[2] = -2.f / fRenderTargetSize.fHeight;
82 destVec[3] = 1.f; 82 destVec[3] = 1.f;
83 } else { 83 } else {
84 destVec[2] = 2.f / fRenderTargetSize.fHeight; 84 destVec[2] = 2.f / fRenderTargetSize.fHeight;
85 destVec[3] = -1.f; 85 destVec[3] = -1.f;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 GrGLGpu* fGpu; 140 GrGLGpu* fGpu;
141 GrGLProgramDataManager fProgramDataManager; 141 GrGLProgramDataManager fProgramDataManager;
142 SkTArray<UniformHandle> fSamplerUniforms; 142 SkTArray<UniformHandle> fSamplerUniforms;
143 143
144 friend class GrGLProgramBuilder; 144 friend class GrGLProgramBuilder;
145 145
146 typedef SkRefCnt INHERITED; 146 typedef SkRefCnt INHERITED;
147 }; 147 };
148 148
149 #endif 149 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698