| 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_CLIENT_SHARE_GROUP_H_ | 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_SHARE_GROUP_H_ |
| 6 #define GPU_COMMAND_BUFFER_CLIENT_SHARE_GROUP_H_ | 6 #define GPU_COMMAND_BUFFER_CLIENT_SHARE_GROUP_H_ |
| 7 | 7 |
| 8 #include <GLES2/gl2.h> | 8 #include <GLES2/gl2.h> |
| 9 #include "../client/ref_counted.h" | 9 #include "../client/ref_counted.h" |
| 10 #include "../common/gles2_cmd_format.h" | 10 #include "../common/gles2_cmd_format.h" |
| 11 #include "../common/scoped_ptr.h" | 11 #include "../common/scoped_ptr.h" |
| 12 #include "gles2_impl_export.h" | 12 #include "gles2_impl_export.h" |
| 13 | 13 |
| 14 namespace gpu { | 14 namespace gpu { |
| 15 namespace gles2 { | 15 namespace gles2 { |
| 16 | 16 |
| 17 class GLES2Implementation; | 17 class GLES2Implementation; |
| 18 class GLES2ImplementationTest; |
| 18 class ProgramInfoManager; | 19 class ProgramInfoManager; |
| 19 | 20 |
| 20 typedef void (GLES2Implementation::*DeleteFn)(GLsizei n, const GLuint* ids); | 21 typedef void (GLES2Implementation::*DeleteFn)(GLsizei n, const GLuint* ids); |
| 21 | 22 |
| 22 // Base class for IdHandlers | 23 // Base class for IdHandlers |
| 23 class IdHandlerInterface { | 24 class IdHandlerInterface { |
| 24 public: | 25 public: |
| 25 IdHandlerInterface() { } | 26 IdHandlerInterface() { } |
| 26 virtual ~IdHandlerInterface() { } | 27 virtual ~IdHandlerInterface() { } |
| 27 | 28 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 IdHandlerInterface* GetIdHandler(int namespace_id) const { | 66 IdHandlerInterface* GetIdHandler(int namespace_id) const { |
| 66 return id_handlers_[namespace_id].get(); | 67 return id_handlers_[namespace_id].get(); |
| 67 } | 68 } |
| 68 | 69 |
| 69 ProgramInfoManager* program_info_manager() { | 70 ProgramInfoManager* program_info_manager() { |
| 70 return program_info_manager_.get(); | 71 return program_info_manager_.get(); |
| 71 } | 72 } |
| 72 | 73 |
| 73 private: | 74 private: |
| 74 friend class gpu::RefCountedThreadSafe<ShareGroup>; | 75 friend class gpu::RefCountedThreadSafe<ShareGroup>; |
| 76 friend class gpu::gles2::GLES2ImplementationTest; |
| 75 ~ShareGroup(); | 77 ~ShareGroup(); |
| 76 | 78 |
| 79 // Install a new program info manager. Used for testing only; |
| 80 void set_program_info_manager(ProgramInfoManager* manager); |
| 81 |
| 77 scoped_ptr<IdHandlerInterface> id_handlers_[id_namespaces::kNumIdNamespaces]; | 82 scoped_ptr<IdHandlerInterface> id_handlers_[id_namespaces::kNumIdNamespaces]; |
| 78 scoped_ptr<ProgramInfoManager> program_info_manager_; | 83 scoped_ptr<ProgramInfoManager> program_info_manager_; |
| 79 | 84 |
| 80 // Whether or not this context is sharing resources. | 85 // Whether or not this context is sharing resources. |
| 81 bool sharing_resources_; | 86 bool sharing_resources_; |
| 82 bool bind_generates_resource_; | 87 bool bind_generates_resource_; |
| 83 | 88 |
| 84 GLES2Implementation* gles2_; | 89 GLES2Implementation* gles2_; |
| 85 | 90 |
| 86 DISALLOW_COPY_AND_ASSIGN(ShareGroup); | 91 DISALLOW_COPY_AND_ASSIGN(ShareGroup); |
| 87 }; | 92 }; |
| 88 | 93 |
| 89 } // namespace gles2 | 94 } // namespace gles2 |
| 90 } // namespace gpu | 95 } // namespace gpu |
| 91 | 96 |
| 92 #endif // GPU_COMMAND_BUFFER_CLIENT_SHARE_GROUP_H_ | 97 #endif // GPU_COMMAND_BUFFER_CLIENT_SHARE_GROUP_H_ |
| OLD | NEW |