| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrGLUniformHandler_DEFINED | 8 #ifndef GrGLUniformHandler_DEFINED |
| 9 #define GrGLUniformHandler_DEFINED | 9 #define GrGLUniformHandler_DEFINED |
| 10 | 10 |
| 11 #include "glsl/GrGLSLUniformHandler.h" | 11 #include "glsl/GrGLSLUniformHandler.h" |
| 12 | 12 |
| 13 #include "gl/GrGLProgramDataManager.h" | 13 #include "gl/GrGLProgramDataManager.h" |
| 14 | 14 |
| 15 class GrGLCaps; | 15 class GrGLCaps; |
| 16 | 16 |
| 17 static const int kUniformsPerBlock = 8; | |
| 18 | |
| 19 class GrGLUniformHandler : public GrGLSLUniformHandler { | 17 class GrGLUniformHandler : public GrGLSLUniformHandler { |
| 20 public: | 18 public: |
| 19 static const int kUniformsPerBlock = 8; |
| 20 |
| 21 const GrGLSLShaderVar& getUniformVariable(UniformHandle u) const override { | 21 const GrGLSLShaderVar& getUniformVariable(UniformHandle u) const override { |
| 22 return fUniforms[u.toIndex()].fVariable; | 22 return fUniforms[u.toIndex()].fVariable; |
| 23 } | 23 } |
| 24 | 24 |
| 25 const char* getUniformCStr(UniformHandle u) const override { | 25 const char* getUniformCStr(UniformHandle u) const override { |
| 26 return this->getUniformVariable(u).c_str(); | 26 return this->getUniformVariable(u).c_str(); |
| 27 } | 27 } |
| 28 private: | 28 private: |
| 29 explicit GrGLUniformHandler(GrGLSLProgramBuilder* program) | 29 explicit GrGLUniformHandler(GrGLSLProgramBuilder* program) |
| 30 : INHERITED(program) | 30 : INHERITED(program) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 52 typedef GrGLProgramDataManager::UniformInfoArray UniformInfoArray; | 52 typedef GrGLProgramDataManager::UniformInfoArray UniformInfoArray; |
| 53 | 53 |
| 54 UniformInfoArray fUniforms; | 54 UniformInfoArray fUniforms; |
| 55 | 55 |
| 56 friend class GrGLProgramBuilder; | 56 friend class GrGLProgramBuilder; |
| 57 | 57 |
| 58 typedef GrGLSLUniformHandler INHERITED; | 58 typedef GrGLSLUniformHandler INHERITED; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 #endif | 61 #endif |
| OLD | NEW |