| 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 "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "gles2_impl_export.h" | 10 #include "gles2_impl_export.h" |
| 11 #include "gpu/command_buffer/client/ref_counted.h" | 11 #include "gpu/command_buffer/client/ref_counted.h" |
| 12 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 12 #include "gpu/command_buffer/common/gles2_cmd_format.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 GLES2ImplementationTest; |
| 19 class ProgramInfoManager; | 19 class ProgramInfoManager; |
| 20 | 20 |
| 21 typedef void (GLES2Implementation::*DeleteFn)(GLsizei n, const GLuint* ids); | 21 typedef void (GLES2Implementation::*DeleteFn)(GLsizei n, const GLuint* ids); |
| 22 typedef void (GLES2Implementation::*BindFn)(GLenum target, GLuint id); |
| 22 | 23 |
| 23 class ShareGroupContextData { | 24 class ShareGroupContextData { |
| 24 public: | 25 public: |
| 25 struct IdHandlerData { | 26 struct IdHandlerData { |
| 26 IdHandlerData(); | 27 IdHandlerData(); |
| 27 ~IdHandlerData(); | 28 ~IdHandlerData(); |
| 28 | 29 |
| 29 std::vector<GLuint> freed_ids_; | 30 std::vector<GLuint> freed_ids_; |
| 30 uint32 flush_generation_; | 31 uint32 flush_generation_; |
| 31 }; | 32 }; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 48 virtual void MakeIds( | 49 virtual void MakeIds( |
| 49 GLES2Implementation* gl_impl, | 50 GLES2Implementation* gl_impl, |
| 50 GLuint id_offset, GLsizei n, GLuint* ids) = 0; | 51 GLuint id_offset, GLsizei n, GLuint* ids) = 0; |
| 51 | 52 |
| 52 // Frees some ids. | 53 // Frees some ids. |
| 53 virtual bool FreeIds( | 54 virtual bool FreeIds( |
| 54 GLES2Implementation* gl_impl, GLsizei n, const GLuint* ids, | 55 GLES2Implementation* gl_impl, GLsizei n, const GLuint* ids, |
| 55 DeleteFn delete_fn) = 0; | 56 DeleteFn delete_fn) = 0; |
| 56 | 57 |
| 57 // Marks an id as used for glBind functions. id = 0 does nothing. | 58 // Marks an id as used for glBind functions. id = 0 does nothing. |
| 58 virtual bool MarkAsUsedForBind(GLuint id) = 0; | 59 virtual bool MarkAsUsedForBind( |
| 60 GLES2Implementation* gl_impl, |
| 61 GLenum target, |
| 62 GLuint id, |
| 63 BindFn bind_fn) = 0; |
| 59 | 64 |
| 60 // Called when a context in the share group is destructed. | 65 // Called when a context in the share group is destructed. |
| 61 virtual void FreeContext(GLES2Implementation* gl_impl) = 0; | 66 virtual void FreeContext(GLES2Implementation* gl_impl) = 0; |
| 62 }; | 67 }; |
| 63 | 68 |
| 64 // ShareGroup manages shared resources for contexts that are sharing resources. | 69 // ShareGroup manages shared resources for contexts that are sharing resources. |
| 65 class GLES2_IMPL_EXPORT ShareGroup | 70 class GLES2_IMPL_EXPORT ShareGroup |
| 66 : public gpu::RefCountedThreadSafe<ShareGroup> { | 71 : public gpu::RefCountedThreadSafe<ShareGroup> { |
| 67 public: | 72 public: |
| 68 ShareGroup(bool bind_generates_resource); | 73 ShareGroup(bool bind_generates_resource); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 98 | 103 |
| 99 bool bind_generates_resource_; | 104 bool bind_generates_resource_; |
| 100 | 105 |
| 101 DISALLOW_COPY_AND_ASSIGN(ShareGroup); | 106 DISALLOW_COPY_AND_ASSIGN(ShareGroup); |
| 102 }; | 107 }; |
| 103 | 108 |
| 104 } // namespace gles2 | 109 } // namespace gles2 |
| 105 } // namespace gpu | 110 } // namespace gpu |
| 106 | 111 |
| 107 #endif // GPU_COMMAND_BUFFER_CLIENT_SHARE_GROUP_H_ | 112 #endif // GPU_COMMAND_BUFFER_CLIENT_SHARE_GROUP_H_ |
| OLD | NEW |