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" |
(...skipping 29 matching lines...) Expand all Loading... |
40 DeleteFn delete_fn) = 0; | 40 DeleteFn delete_fn) = 0; |
41 | 41 |
42 // Marks an id as used for glBind functions. id = 0 does nothing. | 42 // Marks an id as used for glBind functions. id = 0 does nothing. |
43 virtual bool MarkAsUsedForBind(GLuint id) = 0; | 43 virtual bool MarkAsUsedForBind(GLuint id) = 0; |
44 }; | 44 }; |
45 | 45 |
46 // ShareGroup manages shared resources for contexts that are sharing resources. | 46 // ShareGroup manages shared resources for contexts that are sharing resources. |
47 class GLES2_IMPL_EXPORT ShareGroup | 47 class GLES2_IMPL_EXPORT ShareGroup |
48 : public gpu::RefCountedThreadSafe<ShareGroup> { | 48 : public gpu::RefCountedThreadSafe<ShareGroup> { |
49 public: | 49 public: |
50 typedef scoped_refptr<ShareGroup> Ref; | |
51 | |
52 ShareGroup(bool share_resources, bool bind_generates_resource); | 50 ShareGroup(bool share_resources, bool bind_generates_resource); |
53 | 51 |
54 void SetGLES2ImplementationForDestruction(GLES2Implementation* gl_impl); | 52 void SetGLES2ImplementationForDestruction(GLES2Implementation* gl_impl); |
55 | 53 |
56 bool sharing_resources() const { | 54 bool sharing_resources() const { |
57 return sharing_resources_; | 55 return sharing_resources_; |
58 } | 56 } |
59 | 57 |
60 bool bind_generates_resource() const { | 58 bool bind_generates_resource() const { |
61 return bind_generates_resource_; | 59 return bind_generates_resource_; |
(...skipping 26 matching lines...) Expand all Loading... |
88 | 86 |
89 GLES2Implementation* gles2_; | 87 GLES2Implementation* gles2_; |
90 | 88 |
91 DISALLOW_COPY_AND_ASSIGN(ShareGroup); | 89 DISALLOW_COPY_AND_ASSIGN(ShareGroup); |
92 }; | 90 }; |
93 | 91 |
94 } // namespace gles2 | 92 } // namespace gles2 |
95 } // namespace gpu | 93 } // namespace gpu |
96 | 94 |
97 #endif // GPU_COMMAND_BUFFER_CLIENT_SHARE_GROUP_H_ | 95 #endif // GPU_COMMAND_BUFFER_CLIENT_SHARE_GROUP_H_ |
OLD | NEW |