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 #ifndef GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "gpu/command_buffer/service/common_decoder.h" | 15 #include "gpu/command_buffer/service/common_decoder.h" |
16 #include "gpu/command_buffer/service/gl_utils.h" | 16 #include "gpu/command_buffer/service/gl_utils.h" |
17 #include "gpu/command_buffer/service/shader_manager.h" | 17 #include "gpu/command_buffer/service/shader_manager.h" |
18 #include "gpu/gpu_export.h" | |
19 | 18 |
20 namespace gpu { | 19 namespace gpu { |
21 namespace gles2 { | 20 namespace gles2 { |
22 | 21 |
23 // Tracks the Programs. | 22 // Tracks the Programs. |
24 // | 23 // |
25 // NOTE: To support shared resources an instance of this class will | 24 // NOTE: To support shared resources an instance of this class will |
26 // need to be shared by multiple GLES2Decoders. | 25 // need to be shared by multiple GLES2Decoders. |
27 class GPU_EXPORT ProgramManager { | 26 class ProgramManager { |
28 public: | 27 public: |
29 // This is used to track which attributes a particular program needs | 28 // This is used to track which attributes a particular program needs |
30 // so we can verify at glDrawXXX time that every attribute is either disabled | 29 // so we can verify at glDrawXXX time that every attribute is either disabled |
31 // or if enabled that it points to a valid source. | 30 // or if enabled that it points to a valid source. |
32 class GPU_EXPORT ProgramInfo : public base::RefCounted<ProgramInfo> { | 31 class ProgramInfo : public base::RefCounted<ProgramInfo> { |
33 public: | 32 public: |
34 typedef scoped_refptr<ProgramInfo> Ref; | 33 typedef scoped_refptr<ProgramInfo> Ref; |
35 | 34 |
36 static const int kMaxAttachedShaders = 2; | 35 static const int kMaxAttachedShaders = 2; |
37 | 36 |
38 struct UniformInfo { | 37 struct UniformInfo { |
39 UniformInfo( | 38 UniformInfo( |
40 GLsizei _size, GLenum _type, GLint _fake_location_base, | 39 GLsizei _size, GLenum _type, GLint _fake_location_base, |
41 const std::string& _name); | 40 const std::string& _name); |
42 ~UniformInfo(); | 41 ~UniformInfo(); |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 void RemoveProgramInfoIfUnused( | 307 void RemoveProgramInfoIfUnused( |
309 ShaderManager* shader_manager, ProgramInfo* info); | 308 ShaderManager* shader_manager, ProgramInfo* info); |
310 | 309 |
311 DISALLOW_COPY_AND_ASSIGN(ProgramManager); | 310 DISALLOW_COPY_AND_ASSIGN(ProgramManager); |
312 }; | 311 }; |
313 | 312 |
314 } // namespace gles2 | 313 } // namespace gles2 |
315 } // namespace gpu | 314 } // namespace gpu |
316 | 315 |
317 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ | 316 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ |
OLD | NEW |