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 #include "../client/atomicops.h" | 5 #include "../client/atomicops.h" |
6 #include "../client/share_group.h" | 6 #include "../client/share_group.h" |
7 #include "../client/gles2_implementation.h" | 7 #include "../client/gles2_implementation.h" |
8 #include "../client/program_info_manager.h" | 8 #include "../client/program_info_manager.h" |
9 #include "../common/id_allocator.h" | 9 #include "../common/id_allocator.h" |
10 #include "../common/logging.h" | 10 #include "../common/logging.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 return false; | 110 return false; |
111 } | 111 } |
112 | 112 |
113 private: | 113 private: |
114 GLuint last_id_; | 114 GLuint last_id_; |
115 }; | 115 }; |
116 | 116 |
117 // An id handler for shared ids. | 117 // An id handler for shared ids. |
118 class SharedIdHandler : public IdHandlerInterface { | 118 class SharedIdHandler : public IdHandlerInterface { |
119 public: | 119 public: |
120 SharedIdHandler( | 120 explicit SharedIdHandler( |
121 id_namespaces::IdNamespaces id_namespace) | 121 id_namespaces::IdNamespaces id_namespace) |
122 : id_namespace_(id_namespace) { | 122 : id_namespace_(id_namespace) { |
123 } | 123 } |
124 | 124 |
125 virtual ~SharedIdHandler() {} | 125 virtual ~SharedIdHandler() {} |
126 | 126 |
127 // Overridden from IdHandlerInterface. | 127 // Overridden from IdHandlerInterface. |
128 virtual void Destroy(GLES2Implementation* /* gl_impl */) OVERRIDE { | 128 virtual void Destroy(GLES2Implementation* /* gl_impl */) OVERRIDE { |
129 } | 129 } |
130 | 130 |
(...skipping 20 matching lines...) Expand all Loading... |
151 // This has no meaning for shared resources. | 151 // This has no meaning for shared resources. |
152 return true; | 152 return true; |
153 } | 153 } |
154 | 154 |
155 private: | 155 private: |
156 id_namespaces::IdNamespaces id_namespace_; | 156 id_namespaces::IdNamespaces id_namespace_; |
157 }; | 157 }; |
158 | 158 |
159 class ThreadSafeIdHandlerWrapper : public IdHandlerInterface { | 159 class ThreadSafeIdHandlerWrapper : public IdHandlerInterface { |
160 public: | 160 public: |
161 ThreadSafeIdHandlerWrapper(IdHandlerInterface* id_handler) | 161 explicit ThreadSafeIdHandlerWrapper(IdHandlerInterface* id_handler) |
162 : id_handler_(id_handler) { | 162 : id_handler_(id_handler) { |
163 } | 163 } |
164 virtual ~ThreadSafeIdHandlerWrapper() { } | 164 virtual ~ThreadSafeIdHandlerWrapper() { } |
165 | 165 |
166 // Overridden from IdHandlerInterface. | 166 // Overridden from IdHandlerInterface. |
167 virtual void Destroy(GLES2Implementation* gl_impl) OVERRIDE { | 167 virtual void Destroy(GLES2Implementation* gl_impl) OVERRIDE { |
168 AutoLock auto_lock(lock_); | 168 AutoLock auto_lock(lock_); |
169 id_handler_->Destroy(gl_impl); | 169 id_handler_->Destroy(gl_impl); |
170 } | 170 } |
171 | 171 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 237 |
238 ShareGroup::~ShareGroup() { | 238 ShareGroup::~ShareGroup() { |
239 for (int i = 0; i < id_namespaces::kNumIdNamespaces; ++i) { | 239 for (int i = 0; i < id_namespaces::kNumIdNamespaces; ++i) { |
240 id_handlers_[i]->Destroy(gles2_); | 240 id_handlers_[i]->Destroy(gles2_); |
241 id_handlers_[i].reset(); | 241 id_handlers_[i].reset(); |
242 } | 242 } |
243 } | 243 } |
244 | 244 |
245 } // namespace gles2 | 245 } // namespace gles2 |
246 } // namespace gpu | 246 } // namespace gpu |
OLD | NEW |