| 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 "gpu/command_buffer/client/share_group.h" | 5 #include "gpu/command_buffer/client/share_group.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <stack> | 9 #include <stack> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 | 345 |
| 346 private: | 346 private: |
| 347 base::Lock lock_; | 347 base::Lock lock_; |
| 348 IdAllocator id_allocator_; | 348 IdAllocator id_allocator_; |
| 349 }; | 349 }; |
| 350 | 350 |
| 351 ShareGroup::ShareGroup(bool bind_generates_resource, uint64_t tracing_guid) | 351 ShareGroup::ShareGroup(bool bind_generates_resource, uint64_t tracing_guid) |
| 352 : bind_generates_resource_(bind_generates_resource), | 352 : bind_generates_resource_(bind_generates_resource), |
| 353 tracing_guid_(tracing_guid) { | 353 tracing_guid_(tracing_guid) { |
| 354 if (bind_generates_resource) { | 354 if (bind_generates_resource) { |
| 355 for (int i = 0; i < id_namespaces::kNumIdNamespaces; ++i) { | 355 for (int i = 0; |
| 356 if (i == id_namespaces::kProgramsAndShaders) { | 356 i < static_cast<int>(SharedIdNamespaces::kNumSharedIdNamespaces); |
| 357 ++i) { |
| 358 if (i == static_cast<int>(SharedIdNamespaces::kProgramsAndShaders)) { |
| 357 id_handlers_[i].reset(new NonReusedIdHandler()); | 359 id_handlers_[i].reset(new NonReusedIdHandler()); |
| 358 } else { | 360 } else { |
| 359 id_handlers_[i].reset(new IdHandler()); | 361 id_handlers_[i].reset(new IdHandler()); |
| 360 } | 362 } |
| 361 } | 363 } |
| 362 } else { | 364 } else { |
| 363 for (int i = 0; i < id_namespaces::kNumIdNamespaces; ++i) { | 365 for (int i = 0; |
| 364 if (i == id_namespaces::kProgramsAndShaders) { | 366 i < static_cast<int>(SharedIdNamespaces::kNumSharedIdNamespaces); |
| 367 ++i) { |
| 368 if (i == static_cast<int>(SharedIdNamespaces::kProgramsAndShaders)) { |
| 365 id_handlers_[i].reset(new NonReusedIdHandler()); | 369 id_handlers_[i].reset(new NonReusedIdHandler()); |
| 366 } else { | 370 } else { |
| 367 id_handlers_[i].reset(new StrictIdHandler(i)); | 371 id_handlers_[i].reset(new StrictIdHandler(i)); |
| 368 } | 372 } |
| 369 } | 373 } |
| 370 } | 374 } |
| 371 program_info_manager_.reset(new ProgramInfoManager); | 375 program_info_manager_.reset(new ProgramInfoManager); |
| 372 for (auto& range_id_handler : range_id_handlers_) { | 376 for (auto& range_id_handler : range_id_handlers_) { |
| 373 range_id_handler.reset(new RangeIdHandler()); | 377 range_id_handler.reset(new RangeIdHandler()); |
| 374 } | 378 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 385 } | 389 } |
| 386 | 390 |
| 387 void ShareGroup::SetProgramInfoManagerForTesting(ProgramInfoManager* manager) { | 391 void ShareGroup::SetProgramInfoManagerForTesting(ProgramInfoManager* manager) { |
| 388 program_info_manager_.reset(manager); | 392 program_info_manager_.reset(manager); |
| 389 } | 393 } |
| 390 | 394 |
| 391 ShareGroup::~ShareGroup() {} | 395 ShareGroup::~ShareGroup() {} |
| 392 | 396 |
| 393 } // namespace gles2 | 397 } // namespace gles2 |
| 394 } // namespace gpu | 398 } // namespace gpu |
| OLD | NEW |