Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: gpu/command_buffer/client/share_group.cc

Issue 59383006: Delete gpu/command_buffer/client/atomicops.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "gpu/command_buffer/client/share_group.h" 5 #include "gpu/command_buffer/client/share_group.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "gpu/command_buffer/client/atomicops.h" 8 #include "base/synchronization/lock.h"
9 #include "gpu/command_buffer/client/gles2_implementation.h" 9 #include "gpu/command_buffer/client/gles2_implementation.h"
10 #include "gpu/command_buffer/client/program_info_manager.h" 10 #include "gpu/command_buffer/client/program_info_manager.h"
11 #include "gpu/command_buffer/common/id_allocator.h" 11 #include "gpu/command_buffer/common/id_allocator.h"
12 12
13 namespace gpu { 13 namespace gpu {
14 namespace gles2 { 14 namespace gles2 {
15 15
16 COMPILE_ASSERT(gpu::kInvalidResource == 0, 16 COMPILE_ASSERT(gpu::kInvalidResource == 0,
17 INVALID_RESOURCE_NOT_0_AS_GL_EXPECTS); 17 INVALID_RESOURCE_NOT_0_AS_GL_EXPECTS);
18 18
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 ThreadSafeIdHandlerWrapper(IdHandlerInterface* id_handler) 150 ThreadSafeIdHandlerWrapper(IdHandlerInterface* id_handler)
151 : id_handler_(id_handler) { 151 : id_handler_(id_handler) {
152 } 152 }
153 virtual ~ThreadSafeIdHandlerWrapper() { } 153 virtual ~ThreadSafeIdHandlerWrapper() { }
154 154
155 // Overridden from IdHandlerInterface. 155 // Overridden from IdHandlerInterface.
156 virtual void MakeIds(GLES2Implementation* gl_impl, 156 virtual void MakeIds(GLES2Implementation* gl_impl,
157 GLuint id_offset, 157 GLuint id_offset,
158 GLsizei n, 158 GLsizei n,
159 GLuint* ids) OVERRIDE { 159 GLuint* ids) OVERRIDE {
160 AutoLock auto_lock(lock_); 160 base::AutoLock auto_lock(lock_);
161 id_handler_->MakeIds(gl_impl, id_offset, n, ids); 161 id_handler_->MakeIds(gl_impl, id_offset, n, ids);
162 } 162 }
163 163
164 // Overridden from IdHandlerInterface. 164 // Overridden from IdHandlerInterface.
165 virtual bool FreeIds(GLES2Implementation* gl_impl, 165 virtual bool FreeIds(GLES2Implementation* gl_impl,
166 GLsizei n, 166 GLsizei n,
167 const GLuint* ids, 167 const GLuint* ids,
168 DeleteFn delete_fn) OVERRIDE { 168 DeleteFn delete_fn) OVERRIDE {
169 AutoLock auto_lock(lock_); 169 base::AutoLock auto_lock(lock_);
170 return id_handler_->FreeIds(gl_impl, n, ids, delete_fn); 170 return id_handler_->FreeIds(gl_impl, n, ids, delete_fn);
171 } 171 }
172 172
173 // Overridden from IdHandlerInterface. 173 // Overridden from IdHandlerInterface.
174 virtual bool MarkAsUsedForBind(GLuint id) OVERRIDE { 174 virtual bool MarkAsUsedForBind(GLuint id) OVERRIDE {
175 AutoLock auto_lock(lock_); 175 base::AutoLock auto_lock(lock_);
176 return id_handler_->MarkAsUsedForBind(id); 176 return id_handler_->MarkAsUsedForBind(id);
177 } 177 }
178 178
179 private: 179 private:
180 scoped_ptr<IdHandlerInterface> id_handler_; 180 scoped_ptr<IdHandlerInterface> id_handler_;
181 Lock lock_; 181 base::Lock lock_;
182 }; 182 };
183 183
184 ShareGroup::ShareGroup(bool bind_generates_resource) 184 ShareGroup::ShareGroup(bool bind_generates_resource)
185 : bind_generates_resource_(bind_generates_resource) { 185 : bind_generates_resource_(bind_generates_resource) {
186 if (bind_generates_resource) { 186 if (bind_generates_resource) {
187 for (int i = 0; i < id_namespaces::kNumIdNamespaces; ++i) { 187 for (int i = 0; i < id_namespaces::kNumIdNamespaces; ++i) {
188 if (i == id_namespaces::kProgramsAndShaders) { 188 if (i == id_namespaces::kProgramsAndShaders) {
189 id_handlers_[i].reset(new ThreadSafeIdHandlerWrapper( 189 id_handlers_[i].reset(new ThreadSafeIdHandlerWrapper(
190 new NonReusedIdHandler())); 190 new NonReusedIdHandler()));
191 } else { 191 } else {
(...skipping 16 matching lines...) Expand all
208 } 208 }
209 209
210 void ShareGroup::set_program_info_manager(ProgramInfoManager* manager) { 210 void ShareGroup::set_program_info_manager(ProgramInfoManager* manager) {
211 program_info_manager_.reset(manager); 211 program_info_manager_.reset(manager);
212 } 212 }
213 213
214 ShareGroup::~ShareGroup() {} 214 ShareGroup::~ShareGroup() {}
215 215
216 } // namespace gles2 216 } // namespace gles2
217 } // namespace gpu 217 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/query_tracker.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698