OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 GrGLUniformManager_DEFINED | 8 #ifndef GrGLUniformManager_DEFINED |
9 #define GrGLUniformManager_DEFINED | 9 #define GrGLUniformManager_DEFINED |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 bool operator==(const UniformHandle& other) const { return other.fValue
== fValue; } | 31 bool operator==(const UniformHandle& other) const { return other.fValue
== fValue; } |
32 | 32 |
33 UniformHandle() | 33 UniformHandle() |
34 : fValue(0) { | 34 : fValue(0) { |
35 } | 35 } |
36 | 36 |
37 private: | 37 private: |
38 UniformHandle(int value) | 38 UniformHandle(int value) |
39 : fValue(~value) { | 39 : fValue(~value) { |
40 GrAssert(isValid()); | 40 SkASSERT(isValid()); |
41 } | 41 } |
42 | 42 |
43 int toUniformIndex() const { GrAssert(isValid()); return ~fValue; } | 43 int toUniformIndex() const { SkASSERT(isValid()); return ~fValue; } |
44 | 44 |
45 int fValue; | 45 int fValue; |
46 friend class GrGLUniformManager; // For accessing toUniformIndex(). | 46 friend class GrGLUniformManager; // For accessing toUniformIndex(). |
47 }; | 47 }; |
48 | 48 |
49 GrGLUniformManager(const GrGLContext& context) : fContext(context) {} | 49 GrGLUniformManager(const GrGLContext& context) : fContext(context) {} |
50 | 50 |
51 UniformHandle appendUniform(GrSLType type, int arrayCount = GrGLShaderVar::k
NonArray); | 51 UniformHandle appendUniform(GrSLType type, int arrayCount = GrGLShaderVar::k
NonArray); |
52 | 52 |
53 /** Functions for uploading uniform values. The varities ending in v can be
used to upload to an | 53 /** Functions for uploading uniform values. The varities ending in v can be
used to upload to an |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 GrGLint fFSLocation; | 101 GrGLint fFSLocation; |
102 GrSLType fType; | 102 GrSLType fType; |
103 int fArrayCount; | 103 int fArrayCount; |
104 }; | 104 }; |
105 | 105 |
106 SkTArray<Uniform, true> fUniforms; | 106 SkTArray<Uniform, true> fUniforms; |
107 const GrGLContext& fContext; | 107 const GrGLContext& fContext; |
108 }; | 108 }; |
109 | 109 |
110 #endif | 110 #endif |
OLD | NEW |