Chromium Code Reviews| Index: gpu/command_buffer/service/context_state.h |
| diff --git a/gpu/command_buffer/service/context_state.h b/gpu/command_buffer/service/context_state.h |
| index 32bef4cea3ec3f9099eb087b40090f22f2ec41bb..26c6936bf5add1f01bc7f40c1dbdfd271281e9ab 100644 |
| --- a/gpu/command_buffer/service/context_state.h |
| +++ b/gpu/command_buffer/service/context_state.h |
| @@ -101,14 +101,45 @@ struct GPU_EXPORT TextureUnit { |
| } |
| }; |
| -struct Vec4 { |
| +class GPU_EXPORT Vec4 { |
| + public: |
| + enum DataType { |
| + kFloat, |
| + kInt, |
| + kUInt, |
| + }; |
| + |
| Vec4() { |
| - v[0] = 0.0f; |
| - v[1] = 0.0f; |
| - v[2] = 0.0f; |
| - v[3] = 1.0f; |
| + v_[0].float_value = 0.0f; |
| + v_[1].float_value = 0.0f; |
| + v_[2].float_value = 0.0f; |
| + v_[3].float_value = 1.0f; |
| + type_ = kFloat; |
| + } |
| + |
| + void GetValues(GLfloat* values) const; |
|
piman
2015/05/13 19:33:27
nit: we typically disallow overloading per style g
|
| + void GetValues(GLint* values) const; |
| + void GetValues(GLuint* values) const; |
| + |
| + void SetValues(const GLfloat* values); |
| + void SetValues(const GLint* values); |
| + void SetValues(const GLuint* values); |
| + |
| + DataType type() const { |
| + return type_; |
| } |
| - float v[4]; |
| + |
| + bool Equal(const Vec4& other) const; |
| + |
| + private: |
| + union ValueUnion { |
| + GLfloat float_value; |
| + GLint int_value; |
| + GLuint uint_value; |
| + }; |
| + |
| + ValueUnion v_[4]; |
| + DataType type_; |
| }; |
| struct GPU_EXPORT ContextState { |