Chromium Code Reviews| 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 |
| 11 #include "GrTypes.h" | 11 #include "GrTypes.h" |
| 12 #include "SkTArray.h" | 12 #include "GrTypesPriv.h" |
| 13 #include "glsl/GrGLSLProgramDataManager.h" | 13 #include "SkString.h" |
| 14 | 14 |
| 15 class GrGLSLSampler { | 15 class GrGLSLSampler { |
| 16 public: | 16 public: |
| 17 typedef GrGLSLProgramDataManager::UniformHandle UniformHandle; | 17 explicit GrGLSLSampler(uint32_t visibility, GrPixelConfig config) |
| 18 typedef SkTArray<GrGLSLSampler> SamplerArray; | 18 : fVisibility(visibility) |
| 19 | |
| 20 GrGLSLSampler(UniformHandle uniform, GrPixelConfig config) | |
| 21 : fSamplerUniform(uniform) | |
| 22 , fConfig(config) { | 19 , fConfig(config) { |
| 23 SkASSERT(kUnknown_GrPixelConfig != fConfig); | 20 SkASSERT(kUnknown_GrPixelConfig != fConfig); |
| 24 } | 21 } |
| 25 | 22 |
| 23 uint32_t visibility() const { return fVisibility; } | |
| 26 GrPixelConfig config() const { return fConfig; } | 24 GrPixelConfig config() const { return fConfig; } |
| 25 virtual GrSLType type() const = 0; | |
| 26 | |
| 27 // Returns the string to be used for the sampler in glsl sample functions (t exture, texture2D, | |
| 28 // etc.) | |
| 29 virtual const char* getSamplerFunctionName() const = 0; | |
|
Chris Dalton
2016/04/13 21:56:40
This function is a bit problematic because there i
egdaniel
2016/04/13 23:44:45
Okay so this function may just have been poorly na
egdaniel
2016/04/13 23:51:43
Also I just noticed I didn't upload the change tha
| |
| 27 | 30 |
| 28 private: | 31 private: |
| 29 UniformHandle fSamplerUniform; | 32 uint32_t fVisibility; |
| 30 GrPixelConfig fConfig; | 33 GrPixelConfig fConfig; |
| 31 | |
| 32 friend class GrGLSLShaderBuilder; | |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 #endif | 36 #endif |
| OLD | NEW |