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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 namespace gpu { | 25 namespace gpu { |
26 | 26 |
27 struct GpuPreferences; | 27 struct GpuPreferences; |
28 | 28 |
29 namespace gles2 { | 29 namespace gles2 { |
30 | 30 |
31 class FeatureInfo; | 31 class FeatureInfo; |
32 class ProgramCache; | 32 class ProgramCache; |
33 class ProgramManager; | 33 class ProgramManager; |
| 34 class ProgressReporter; |
34 class Shader; | 35 class Shader; |
35 class ShaderManager; | 36 class ShaderManager; |
36 | 37 |
37 // This is used to track which attributes a particular program needs | 38 // This is used to track which attributes a particular program needs |
38 // so we can verify at glDrawXXX time that every attribute is either disabled | 39 // so we can verify at glDrawXXX time that every attribute is either disabled |
39 // or if enabled that it points to a valid source. | 40 // or if enabled that it points to a valid source. |
40 class GPU_EXPORT Program : public base::RefCounted<Program> { | 41 class GPU_EXPORT Program : public base::RefCounted<Program> { |
41 public: | 42 public: |
42 static const int kMaxAttachedShaders = 2; | 43 static const int kMaxAttachedShaders = 2; |
43 | 44 |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 ProgramManager(ProgramCache* program_cache, | 596 ProgramManager(ProgramCache* program_cache, |
596 uint32_t max_varying_vectors, | 597 uint32_t max_varying_vectors, |
597 uint32_t max_draw_buffers, | 598 uint32_t max_draw_buffers, |
598 uint32_t max_dual_source_draw_buffers, | 599 uint32_t max_dual_source_draw_buffers, |
599 uint32_t max_vertex_attribs, | 600 uint32_t max_vertex_attribs, |
600 const GpuPreferences& gpu_preferences, | 601 const GpuPreferences& gpu_preferences, |
601 FeatureInfo* feature_info); | 602 FeatureInfo* feature_info); |
602 ~ProgramManager(); | 603 ~ProgramManager(); |
603 | 604 |
604 // Must call before destruction. | 605 // Must call before destruction. |
605 void Destroy(bool have_context); | 606 void Destroy(bool have_context, ProgressReporter* progress_reporter); |
606 | 607 |
607 // Creates a new program. | 608 // Creates a new program. |
608 Program* CreateProgram(GLuint client_id, GLuint service_id); | 609 Program* CreateProgram(GLuint client_id, GLuint service_id); |
609 | 610 |
610 // Gets a program. | 611 // Gets a program. |
611 Program* GetProgram(GLuint client_id); | 612 Program* GetProgram(GLuint client_id); |
612 | 613 |
613 // Gets a client id for a given service id. | 614 // Gets a client id for a given service id. |
614 bool GetClientId(GLuint service_id, GLuint* client_id) const; | 615 bool GetClientId(GLuint service_id, GLuint* client_id) const; |
615 | 616 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 }; | 685 }; |
685 | 686 |
686 inline const FeatureInfo& Program::feature_info() const { | 687 inline const FeatureInfo& Program::feature_info() const { |
687 return *manager_->feature_info_.get(); | 688 return *manager_->feature_info_.get(); |
688 } | 689 } |
689 | 690 |
690 } // namespace gles2 | 691 } // namespace gles2 |
691 } // namespace gpu | 692 } // namespace gpu |
692 | 693 |
693 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ | 694 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ |
OLD | NEW |