OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file contains the ContextState class. | 5 // This file contains the ContextState class. |
6 | 6 |
7 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ | 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ |
8 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ | 8 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "gpu/command_buffer/service/gl_utils.h" | 13 #include "gpu/command_buffer/service/gl_utils.h" |
14 #include "gpu/command_buffer/service/query_manager.h" | 14 #include "gpu/command_buffer/service/query_manager.h" |
15 #include "gpu/command_buffer/service/texture_manager.h" | 15 #include "gpu/command_buffer/service/texture_manager.h" |
16 #include "gpu/command_buffer/service/vertex_attrib_manager.h" | 16 #include "gpu/command_buffer/service/vertex_attrib_manager.h" |
17 #include "gpu/command_buffer/service/vertex_array_manager.h" | 17 #include "gpu/command_buffer/service/vertex_array_manager.h" |
18 #include "gpu/gpu_export.h" | 18 #include "gpu/gpu_export.h" |
19 | 19 |
20 namespace gpu { | 20 namespace gpu { |
21 namespace gles2 { | 21 namespace gles2 { |
22 | 22 |
23 class Buffer; | 23 class Buffer; |
24 class ErrorState; | 24 class ErrorState; |
25 class ErrorStateClient; | |
26 class FeatureInfo; | 25 class FeatureInfo; |
27 class Framebuffer; | 26 class Framebuffer; |
28 class Program; | 27 class Program; |
29 class Renderbuffer; | 28 class Renderbuffer; |
30 | 29 |
31 // State associated with each texture unit. | 30 // State associated with each texture unit. |
32 struct GPU_EXPORT TextureUnit { | 31 struct GPU_EXPORT TextureUnit { |
33 TextureUnit(); | 32 TextureUnit(); |
34 ~TextureUnit(); | 33 ~TextureUnit(); |
35 | 34 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 Vec4() { | 86 Vec4() { |
88 v[0] = 0.0f; | 87 v[0] = 0.0f; |
89 v[1] = 0.0f; | 88 v[1] = 0.0f; |
90 v[2] = 0.0f; | 89 v[2] = 0.0f; |
91 v[3] = 1.0f; | 90 v[3] = 1.0f; |
92 } | 91 } |
93 float v[4]; | 92 float v[4]; |
94 }; | 93 }; |
95 | 94 |
96 struct GPU_EXPORT ContextState { | 95 struct GPU_EXPORT ContextState { |
97 ContextState(FeatureInfo* feature_info, | 96 ContextState(FeatureInfo* feature_info, Logger* logger); |
98 ErrorStateClient* error_state_client, | |
99 Logger* logger); | |
100 ~ContextState(); | 97 ~ContextState(); |
101 | 98 |
102 void Initialize(); | 99 void Initialize(); |
103 | 100 |
104 void RestoreState(const ContextState* prev_state) const; | 101 void RestoreState(const ContextState* prev_state) const; |
105 void InitCapabilities() const; | 102 void InitCapabilities() const; |
106 void InitState() const; | 103 void InitState() const; |
107 | 104 |
108 void RestoreActiveTexture() const; | 105 void RestoreActiveTexture() const; |
109 void RestoreAllTextureUnitBindings(const ContextState* prev_state) const; | 106 void RestoreAllTextureUnitBindings(const ContextState* prev_state) const; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 161 |
165 private: | 162 private: |
166 scoped_ptr<ErrorState> error_state_; | 163 scoped_ptr<ErrorState> error_state_; |
167 }; | 164 }; |
168 | 165 |
169 } // namespace gles2 | 166 } // namespace gles2 |
170 } // namespace gpu | 167 } // namespace gpu |
171 | 168 |
172 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ | 169 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ |
173 | 170 |
OLD | NEW |