OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef GPU_COMMAND_BUFFER_SERVICE_VALUEBUFFER_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_VALUEBUFFER_MANAGER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_VALUEBUFFER_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_VALUEBUFFER_MANAGER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "gpu/command_buffer/common/value_state.h" |
12 #include "gpu/command_buffer/service/gl_utils.h" | 13 #include "gpu/command_buffer/service/gl_utils.h" |
13 #include "gpu/gpu_export.h" | 14 #include "gpu/gpu_export.h" |
14 | 15 |
15 namespace gpu { | 16 namespace gpu { |
16 namespace gles2 { | 17 namespace gles2 { |
17 | 18 |
18 class ValuebufferManager; | 19 class ValuebufferManager; |
19 | 20 |
20 union ValueState { | |
21 float float_value[4]; | |
22 int int_value[4]; | |
23 }; | |
24 | |
25 class GPU_EXPORT Valuebuffer : public base::RefCounted<Valuebuffer> { | 21 class GPU_EXPORT Valuebuffer : public base::RefCounted<Valuebuffer> { |
26 public: | 22 public: |
27 Valuebuffer(ValuebufferManager* manager, GLuint client_id); | 23 Valuebuffer(ValuebufferManager* manager, GLuint client_id); |
28 | 24 |
29 GLuint client_id() const { return client_id_; } | 25 GLuint client_id() const { return client_id_; } |
30 | 26 |
31 bool IsDeleted() const { return client_id_ == 0; } | 27 bool IsDeleted() const { return client_id_ == 0; } |
32 | 28 |
33 void MarkAsValid() { has_been_bound_ = true; } | 29 void MarkAsValid() { has_been_bound_ = true; } |
34 | 30 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // Current value state in the system | 110 // Current value state in the system |
115 Valuebuffer::StateMap pending_state_map_; | 111 Valuebuffer::StateMap pending_state_map_; |
116 | 112 |
117 DISALLOW_COPY_AND_ASSIGN(ValuebufferManager); | 113 DISALLOW_COPY_AND_ASSIGN(ValuebufferManager); |
118 }; | 114 }; |
119 | 115 |
120 } // namespace gles2 | 116 } // namespace gles2 |
121 } // namespace gpu | 117 } // namespace gpu |
122 | 118 |
123 #endif // GPU_COMMAND_BUFFER_SERVICE_VALUEBUFFER_MANAGER_H_ | 119 #endif // GPU_COMMAND_BUFFER_SERVICE_VALUEBUFFER_MANAGER_H_ |
OLD | NEW |