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; i < ToInt(SharedIdNamespaces::kNumSharedIdNamespaces); |
356 if (i == id_namespaces::kProgramsAndShaders) { | 356 ++i) { |
| 357 if (i == ToInt(SharedIdNamespaces::kProgramsAndShaders)) { |
357 id_handlers_[i].reset(new NonReusedIdHandler()); | 358 id_handlers_[i].reset(new NonReusedIdHandler()); |
358 } else { | 359 } else { |
359 id_handlers_[i].reset(new IdHandler()); | 360 id_handlers_[i].reset(new IdHandler()); |
360 } | 361 } |
361 } | 362 } |
362 } else { | 363 } else { |
363 for (int i = 0; i < id_namespaces::kNumIdNamespaces; ++i) { | 364 for (int i = 0; i < ToInt(SharedIdNamespaces::kNumSharedIdNamespaces); |
364 if (i == id_namespaces::kProgramsAndShaders) { | 365 ++i) { |
| 366 if (i == ToInt(SharedIdNamespaces::kProgramsAndShaders)) { |
365 id_handlers_[i].reset(new NonReusedIdHandler()); | 367 id_handlers_[i].reset(new NonReusedIdHandler()); |
366 } else { | 368 } else { |
367 id_handlers_[i].reset(new StrictIdHandler(i)); | 369 id_handlers_[i].reset(new StrictIdHandler(i)); |
368 } | 370 } |
369 } | 371 } |
370 } | 372 } |
371 program_info_manager_.reset(new ProgramInfoManager); | 373 program_info_manager_.reset(new ProgramInfoManager); |
372 for (auto& range_id_handler : range_id_handlers_) { | 374 for (auto& range_id_handler : range_id_handlers_) { |
373 range_id_handler.reset(new RangeIdHandler()); | 375 range_id_handler.reset(new RangeIdHandler()); |
374 } | 376 } |
(...skipping 10 matching lines...) Expand all Loading... |
385 } | 387 } |
386 | 388 |
387 void ShareGroup::SetProgramInfoManagerForTesting(ProgramInfoManager* manager) { | 389 void ShareGroup::SetProgramInfoManagerForTesting(ProgramInfoManager* manager) { |
388 program_info_manager_.reset(manager); | 390 program_info_manager_.reset(manager); |
389 } | 391 } |
390 | 392 |
391 ShareGroup::~ShareGroup() {} | 393 ShareGroup::~ShareGroup() {} |
392 | 394 |
393 } // namespace gles2 | 395 } // namespace gles2 |
394 } // namespace gpu | 396 } // namespace gpu |
OLD | NEW |