OLD | NEW |
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 definition of the IdAllocator class. | 5 // This file contains the definition of the IdAllocator class. |
6 | 6 |
7 #ifndef GPU_COMMAND_BUFFER_CLIENT_ID_ALLOCATOR_H_ | 7 #ifndef GPU_COMMAND_BUFFER_CLIENT_ID_ALLOCATOR_H_ |
8 #define GPU_COMMAND_BUFFER_CLIENT_ID_ALLOCATOR_H_ | 8 #define GPU_COMMAND_BUFFER_CLIENT_ID_ALLOCATOR_H_ |
9 | 9 |
10 #include <set> | 10 #include <set> |
11 #include <utility> | 11 #include <utility> |
12 #include "../common/types.h" | 12 #include "../common/types.h" |
13 | 13 |
14 // TODO(apatrick): Having regular GL flush semantics on the client side, it | |
15 // probably isn't necessary to round trip to the service to allocate IDs. | |
16 // Retire this code. | |
17 | |
18 namespace gpu { | 14 namespace gpu { |
19 | 15 |
20 // A resource ID, key to the resource maps. | 16 // A resource ID, key to the resource maps. |
21 typedef uint32 ResourceId; | 17 typedef uint32 ResourceId; |
22 // Invalid resource ID. | 18 // Invalid resource ID. |
23 static const ResourceId kInvalidResource = 0u; | 19 static const ResourceId kInvalidResource = 0u; |
24 | 20 |
25 class IdAllocatorInterface { | 21 class IdAllocatorInterface { |
26 public: | 22 public: |
27 virtual ~IdAllocatorInterface(); | 23 virtual ~IdAllocatorInterface(); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 86 |
91 private: | 87 private: |
92 ResourceId last_id_; | 88 ResourceId last_id_; |
93 | 89 |
94 DISALLOW_COPY_AND_ASSIGN(NonReusedIdAllocator); | 90 DISALLOW_COPY_AND_ASSIGN(NonReusedIdAllocator); |
95 }; | 91 }; |
96 | 92 |
97 } // namespace gpu | 93 } // namespace gpu |
98 | 94 |
99 #endif // GPU_COMMAND_BUFFER_CLIENT_ID_ALLOCATOR_H_ | 95 #endif // GPU_COMMAND_BUFFER_CLIENT_ID_ALLOCATOR_H_ |
OLD | NEW |