| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |