| 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 #include "GrGLGpu.h" | 9 #include "GrGLGpu.h" |
| 10 #include "GrGLGLSL.h" | 10 #include "GrGLGLSL.h" |
| (...skipping 2793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2804 return this->copySurfaceAsBlitFramebuffer(dst, src, srcRect, dstPoint); | 2804 return this->copySurfaceAsBlitFramebuffer(dst, src, srcRect, dstPoint); |
| 2805 } | 2805 } |
| 2806 | 2806 |
| 2807 return false; | 2807 return false; |
| 2808 } | 2808 } |
| 2809 | 2809 |
| 2810 | 2810 |
| 2811 void GrGLGpu::createCopyProgram() { | 2811 void GrGLGpu::createCopyProgram() { |
| 2812 const char* version = GrGLGetGLSLVersionDecl(this->ctxInfo()); | 2812 const char* version = GrGLGetGLSLVersionDecl(this->ctxInfo()); |
| 2813 | 2813 |
| 2814 GrGLShaderVar aVertex("a_vertex", kVec2f_GrSLType, GrShaderVar::kAttribute_T
ypeModifier); | 2814 GrGLSLShaderVar aVertex("a_vertex", kVec2f_GrSLType, GrShaderVar::kAttribute
_TypeModifier); |
| 2815 GrGLShaderVar uTexCoordXform("u_texCoordXform", kVec4f_GrSLType, | 2815 GrGLSLShaderVar uTexCoordXform("u_texCoordXform", kVec4f_GrSLType, |
| 2816 GrShaderVar::kUniform_TypeModifier); | 2816 GrShaderVar::kUniform_TypeModifier); |
| 2817 GrGLShaderVar uPosXform("u_posXform", kVec4f_GrSLType, GrShaderVar::kUniform
_TypeModifier); | 2817 GrGLSLShaderVar uPosXform("u_posXform", kVec4f_GrSLType, GrShaderVar::kUnifo
rm_TypeModifier); |
| 2818 GrGLShaderVar uTexture("u_texture", kSampler2D_GrSLType, GrShaderVar::kUnifo
rm_TypeModifier); | 2818 GrGLSLShaderVar uTexture("u_texture", kSampler2D_GrSLType, GrShaderVar::kUni
form_TypeModifier); |
| 2819 GrGLShaderVar vTexCoord("v_texCoord", kVec2f_GrSLType, GrShaderVar::kVarying
Out_TypeModifier); | 2819 GrGLSLShaderVar vTexCoord("v_texCoord", kVec2f_GrSLType, GrShaderVar::kVaryi
ngOut_TypeModifier); |
| 2820 GrGLShaderVar oFragColor("o_FragColor", kVec4f_GrSLType, GrShaderVar::kOut_T
ypeModifier); | 2820 GrGLSLShaderVar oFragColor("o_FragColor", kVec4f_GrSLType, GrShaderVar::kOut
_TypeModifier); |
| 2821 | 2821 |
| 2822 SkString vshaderTxt(version); | 2822 SkString vshaderTxt(version); |
| 2823 aVertex.appendDecl(this->glCaps().glslCaps(), &vshaderTxt); | 2823 aVertex.appendDecl(this->glCaps().glslCaps(), &vshaderTxt); |
| 2824 vshaderTxt.append(";"); | 2824 vshaderTxt.append(";"); |
| 2825 uTexCoordXform.appendDecl(this->glCaps().glslCaps(), &vshaderTxt); | 2825 uTexCoordXform.appendDecl(this->glCaps().glslCaps(), &vshaderTxt); |
| 2826 vshaderTxt.append(";"); | 2826 vshaderTxt.append(";"); |
| 2827 uPosXform.appendDecl(this->glCaps().glslCaps(), &vshaderTxt); | 2827 uPosXform.appendDecl(this->glCaps().glslCaps(), &vshaderTxt); |
| 2828 vshaderTxt.append(";"); | 2828 vshaderTxt.append(";"); |
| 2829 vTexCoord.appendDecl(this->glCaps().glslCaps(), &vshaderTxt); | 2829 vTexCoord.appendDecl(this->glCaps().glslCaps(), &vshaderTxt); |
| 2830 vshaderTxt.append(";"); | 2830 vshaderTxt.append(";"); |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3182 this->setVertexArrayID(gpu, 0); | 3182 this->setVertexArrayID(gpu, 0); |
| 3183 } | 3183 } |
| 3184 int attrCount = gpu->glCaps().maxVertexAttributes(); | 3184 int attrCount = gpu->glCaps().maxVertexAttributes(); |
| 3185 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 3185 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
| 3186 fDefaultVertexArrayAttribState.resize(attrCount); | 3186 fDefaultVertexArrayAttribState.resize(attrCount); |
| 3187 } | 3187 } |
| 3188 attribState = &fDefaultVertexArrayAttribState; | 3188 attribState = &fDefaultVertexArrayAttribState; |
| 3189 } | 3189 } |
| 3190 return attribState; | 3190 return attribState; |
| 3191 } | 3191 } |
| OLD | NEW |