| 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 #ifndef GrGLSL_DEFINED | 8 #ifndef GrGLSL_DEFINED | 
| 9 #define GrGLSL_DEFINED | 9 #define GrGLSL_DEFINED | 
| 10 | 10 | 
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 51 }; | 51 }; | 
| 52 | 52 | 
| 53 bool GrGLSLSupportsNamedFragmentShaderOutputs(GrGLSLGeneration); | 53 bool GrGLSLSupportsNamedFragmentShaderOutputs(GrGLSLGeneration); | 
| 54 | 54 | 
| 55 /** | 55 /** | 
| 56  * Gets the name of the function that should be used to sample a 2D texture. Coo
     rd type is used | 56  * Gets the name of the function that should be used to sample a 2D texture. Coo
     rd type is used | 
| 57  * to indicate whether the texture is sampled using projective textured (kVec3f)
      or not (kVec2f). | 57  * to indicate whether the texture is sampled using projective textured (kVec3f)
      or not (kVec2f). | 
| 58  */ | 58  */ | 
| 59 inline const char* GrGLSLTexture2DFunctionName(GrSLType coordType, GrSLType samp
     lerType, | 59 inline const char* GrGLSLTexture2DFunctionName(GrSLType coordType, GrSLType samp
     lerType, | 
| 60                                                GrGLSLGeneration glslGen) { | 60                                                GrGLSLGeneration glslGen) { | 
| 61     SkASSERT(GrSLTypeIsSamplerType(samplerType)); | 61     SkASSERT(GrSLTypeIs2DTextureType(samplerType)); | 
| 62     SkASSERT(kVec2f_GrSLType == coordType || kVec3f_GrSLType == coordType); | 62     SkASSERT(kVec2f_GrSLType == coordType || kVec3f_GrSLType == coordType); | 
| 63     // GL_TEXTURE_RECTANGLE_ARB is written against OpenGL 2.0/GLSL 1.10. At that
      time there were | 63     // GL_TEXTURE_RECTANGLE_ARB is written against OpenGL 2.0/GLSL 1.10. At that
      time there were | 
| 64     // separate texture*() functions. In OpenGL 3.0/GLSL 1.30 the different text
     ure*() functions | 64     // separate texture*() functions. In OpenGL 3.0/GLSL 1.30 the different text
     ure*() functions | 
| 65     // were deprecated in favor or the unified texture() function. RECTANGLE tex
     tures became | 65     // were deprecated in favor or the unified texture() function. RECTANGLE tex
     tures became | 
| 66     // standard in OpenGL 3.2/GLSL 1.50 and use texture(). It isn't completely c
     lear what function | 66     // standard in OpenGL 3.2/GLSL 1.50 and use texture(). It isn't completely c
     lear what function | 
| 67     // should be used for RECTANGLE textures in GLSL versions >= 1.30 && < 1.50.
      We're going with | 67     // should be used for RECTANGLE textures in GLSL versions >= 1.30 && < 1.50.
      We're going with | 
| 68     // using texture(). | 68     // using texture(). | 
| 69     if (glslGen >= k130_GrGLSLGeneration) { | 69     if (glslGen >= k130_GrGLSLGeneration) { | 
| 70         return (kVec2f_GrSLType == coordType) ? "texture" : "textureProj"; | 70         return (kVec2f_GrSLType == coordType) ? "texture" : "textureProj"; | 
| 71     } | 71     } | 
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 103         case kMat33f_GrSLType: | 103         case kMat33f_GrSLType: | 
| 104             return "mat3"; | 104             return "mat3"; | 
| 105         case kMat44f_GrSLType: | 105         case kMat44f_GrSLType: | 
| 106             return "mat4"; | 106             return "mat4"; | 
| 107         case kSampler2D_GrSLType: | 107         case kSampler2D_GrSLType: | 
| 108             return "sampler2D"; | 108             return "sampler2D"; | 
| 109         case kSamplerExternal_GrSLType: | 109         case kSamplerExternal_GrSLType: | 
| 110             return "samplerExternalOES"; | 110             return "samplerExternalOES"; | 
| 111         case kSampler2DRect_GrSLType: | 111         case kSampler2DRect_GrSLType: | 
| 112             return "sampler2DRect"; | 112             return "sampler2DRect"; | 
|  | 113         case kSamplerBuffer_GrSLType: | 
|  | 114             return "samplerBuffer"; | 
| 113         case kBool_GrSLType: | 115         case kBool_GrSLType: | 
| 114             return "bool"; | 116             return "bool"; | 
| 115         case kInt_GrSLType: | 117         case kInt_GrSLType: | 
| 116             return "int"; | 118             return "int"; | 
| 117         case kUint_GrSLType: | 119         case kUint_GrSLType: | 
| 118             return "uint"; | 120             return "uint"; | 
| 119         default: | 121         default: | 
| 120             SkFAIL("Unknown shader var type."); | 122             SkFAIL("Unknown shader var type."); | 
| 121             return ""; // suppress warning | 123             return ""; // suppress warning | 
| 122     } | 124     } | 
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 357 | 359 | 
| 358 /** | 360 /** | 
| 359  * Does an inplace mul, *=, of vec4VarName by mulFactor. | 361  * Does an inplace mul, *=, of vec4VarName by mulFactor. | 
| 360  * A semicolon is added after the assignment. | 362  * A semicolon is added after the assignment. | 
| 361  */ | 363  */ | 
| 362 void GrGLSLMulVarBy4f(SkString* outAppend, const char* vec4VarName, const GrGLSL
     Expr4& mulFactor); | 364 void GrGLSLMulVarBy4f(SkString* outAppend, const char* vec4VarName, const GrGLSL
     Expr4& mulFactor); | 
| 363 | 365 | 
| 364 #include "GrGLSL_impl.h" | 366 #include "GrGLSL_impl.h" | 
| 365 | 367 | 
| 366 #endif | 368 #endif | 
| OLD | NEW | 
|---|