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

Side by Side Diff: gpu/command_buffer/common/id_allocator.cc

Issue 621673002: command_buffer: Remove unused shared id code (GenSharedIdsCHROMIUM, ...) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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
« no previous file with comments | « gpu/command_buffer/common/id_allocator.h ('k') | gpu/command_buffer/service/context_group.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // This file contains the implementation of IdAllocator. 5 // This file contains the implementation of IdAllocator.
6 6
7 #include "gpu/command_buffer/common/id_allocator.h" 7 #include "gpu/command_buffer/common/id_allocator.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
11 namespace gpu { 11 namespace gpu {
12 12
13 IdAllocatorInterface::~IdAllocatorInterface() {
14 }
15
16 IdAllocator::IdAllocator() {} 13 IdAllocator::IdAllocator() {}
17 14
18 IdAllocator::~IdAllocator() {} 15 IdAllocator::~IdAllocator() {}
19 16
20 ResourceId IdAllocator::AllocateID() { 17 ResourceId IdAllocator::AllocateID() {
21 ResourceId id; 18 ResourceId id;
22 ResourceIdSet::iterator iter = free_ids_.begin(); 19 ResourceIdSet::iterator iter = free_ids_.begin();
23 if (iter != free_ids_.end()) { 20 if (iter != free_ids_.end()) {
24 id = *iter; 21 id = *iter;
25 } else { 22 } else {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 for (ResourceIdSet::const_iterator it = used_ids_.begin(); 79 for (ResourceIdSet::const_iterator it = used_ids_.begin();
83 it != used_ids_.end(); ++it) { 80 it != used_ids_.end(); ++it) {
84 if ((*it) != id) { 81 if ((*it) != id) {
85 return id; 82 return id;
86 } 83 }
87 ++id; 84 ++id;
88 } 85 }
89 return id; 86 return id;
90 } 87 }
91 88
92 NonReusedIdAllocator::NonReusedIdAllocator() : last_id_(0) {
93 }
94
95 NonReusedIdAllocator::~NonReusedIdAllocator() {
96 }
97
98 ResourceId NonReusedIdAllocator::AllocateID() {
99 return ++last_id_;
100 }
101
102 ResourceId NonReusedIdAllocator::AllocateIDAtOrAbove(ResourceId desired_id) {
103 if (desired_id > last_id_)
104 last_id_ = desired_id;
105
106 return ++last_id_;
107 }
108
109 bool NonReusedIdAllocator::MarkAsUsed(ResourceId id) {
110 NOTREACHED();
111 return false;
112 }
113
114 void NonReusedIdAllocator::FreeID(ResourceId id) {
115 }
116
117 bool NonReusedIdAllocator::InUse(ResourceId id) const {
118 NOTREACHED();
119 return false;
120 }
121
122 } // namespace gpu 89 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/id_allocator.h ('k') | gpu/command_buffer/service/context_group.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698