| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 GrGLSLSampler_DEFINED | 8 #ifndef GrGLSLSampler_DEFINED |
| 9 #define GrGLSLSampler_DEFINED | 9 #define GrGLSLSampler_DEFINED |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 SkASSERT(kUnknown_GrPixelConfig != fConfig); | 22 SkASSERT(kUnknown_GrPixelConfig != fConfig); |
| 23 } | 23 } |
| 24 | 24 |
| 25 uint32_t visibility() const { return fVisibility; } | 25 uint32_t visibility() const { return fVisibility; } |
| 26 GrPixelConfig config() const { return fConfig; } | 26 GrPixelConfig config() const { return fConfig; } |
| 27 virtual GrSLType type() const = 0; | 27 virtual GrSLType type() const = 0; |
| 28 | 28 |
| 29 // Returns the string to be used for the sampler in glsl 2D texture function
s (texture, | 29 // Returns the string to be used for the sampler in glsl 2D texture function
s (texture, |
| 30 // texture2D, etc.) | 30 // texture2D, etc.) |
| 31 const char* getSamplerNameForTexture2D() const { | 31 const char* getSamplerNameForTexture2D() const { |
| 32 SkASSERT(GrSLTypeIs2DTextureType(this->type())); | 32 SkASSERT(GrSLTypeIs2DCombinedSamplerType(this->type())); |
| 33 return this->onGetSamplerNameForTexture2D(); | 33 return this->onGetSamplerNameForTexture2D(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 // Returns the string to be used for the sampler in glsl texelFetch. | 36 // Returns the string to be used for the sampler in glsl texelFetch. |
| 37 virtual const char* getSamplerNameForTexelFetch() const = 0; | 37 virtual const char* getSamplerNameForTexelFetch() const = 0; |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 virtual const char* onGetSamplerNameForTexture2D() const = 0; | 40 virtual const char* onGetSamplerNameForTexture2D() const = 0; |
| 41 uint32_t fVisibility; | 41 uint32_t fVisibility; |
| 42 GrPixelConfig fConfig; | 42 GrPixelConfig fConfig; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 #endif | 45 #endif |
| OLD | NEW |