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