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 |
14 namespace gpu { | 18 namespace gpu { |
15 | 19 |
16 // A resource ID, key to the resource maps. | 20 // A resource ID, key to the resource maps. |
17 typedef uint32 ResourceId; | 21 typedef uint32 ResourceId; |
18 // Invalid resource ID. | 22 // Invalid resource ID. |
19 static const ResourceId kInvalidResource = 0u; | 23 static const ResourceId kInvalidResource = 0u; |
20 | 24 |
21 class IdAllocatorInterface { | 25 class IdAllocatorInterface { |
22 public: | 26 public: |
23 virtual ~IdAllocatorInterface(); | 27 virtual ~IdAllocatorInterface(); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 90 |
87 private: | 91 private: |
88 ResourceId last_id_; | 92 ResourceId last_id_; |
89 | 93 |
90 DISALLOW_COPY_AND_ASSIGN(NonReusedIdAllocator); | 94 DISALLOW_COPY_AND_ASSIGN(NonReusedIdAllocator); |
91 }; | 95 }; |
92 | 96 |
93 } // namespace gpu | 97 } // namespace gpu |
94 | 98 |
95 #endif // GPU_COMMAND_BUFFER_CLIENT_ID_ALLOCATOR_H_ | 99 #endif // GPU_COMMAND_BUFFER_CLIENT_ID_ALLOCATOR_H_ |
OLD | NEW |