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

Unified Diff: gpu/command_buffer/common/id_allocator.h

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, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_ids_autogen.h ('k') | gpu/command_buffer/common/id_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/id_allocator.h
diff --git a/gpu/command_buffer/common/id_allocator.h b/gpu/command_buffer/common/id_allocator.h
index 3f2dc4a65e295c2b3e4d42ab9633c366c6de0b43..b877083008ad724f515799283d66173215d03344 100644
--- a/gpu/command_buffer/common/id_allocator.h
+++ b/gpu/command_buffer/common/id_allocator.h
@@ -23,39 +23,27 @@ typedef uint32_t ResourceId;
// Invalid resource ID.
static const ResourceId kInvalidResource = 0u;
-class GPU_EXPORT IdAllocatorInterface {
+// A class to manage the allocation of resource IDs.
+class GPU_EXPORT IdAllocator {
public:
- virtual ~IdAllocatorInterface();
+ IdAllocator();
+ ~IdAllocator();
// Allocates a new resource ID.
- virtual ResourceId AllocateID() = 0;
+ ResourceId AllocateID();
// Allocates an Id starting at or above desired_id.
// Note: may wrap if it starts near limit.
- virtual ResourceId AllocateIDAtOrAbove(ResourceId desired_id) = 0;
+ ResourceId AllocateIDAtOrAbove(ResourceId desired_id);
// Marks an id as used. Returns false if id was already used.
- virtual bool MarkAsUsed(ResourceId id) = 0;
+ bool MarkAsUsed(ResourceId id);
// Frees a resource ID.
- virtual void FreeID(ResourceId id) = 0;
+ void FreeID(ResourceId id);
// Checks whether or not a resource ID is in use.
- virtual bool InUse(ResourceId id) const = 0;
-};
-
-// A class to manage the allocation of resource IDs.
-class GPU_EXPORT IdAllocator : public IdAllocatorInterface {
- public:
- IdAllocator();
- virtual ~IdAllocator();
-
- // Implement IdAllocatorInterface.
- virtual ResourceId AllocateID() OVERRIDE;
- virtual ResourceId AllocateIDAtOrAbove(ResourceId desired_id) OVERRIDE;
- virtual bool MarkAsUsed(ResourceId id) OVERRIDE;
- virtual void FreeID(ResourceId id) OVERRIDE;
- virtual bool InUse(ResourceId id) const OVERRIDE;
+ bool InUse(ResourceId id) const;
private:
// TODO(gman): This would work much better with ranges or a hash table.
@@ -73,28 +61,6 @@ class GPU_EXPORT IdAllocator : public IdAllocatorInterface {
DISALLOW_COPY_AND_ASSIGN(IdAllocator);
};
-// A class to manage the allocation of resource IDs that are never reused. This
-// implementation does not track which IDs are currently used. It is useful for
-// shared and programs which cannot be implicitly created by binding a
-// previously unused ID.
-class NonReusedIdAllocator : public IdAllocatorInterface {
- public:
- NonReusedIdAllocator();
- virtual ~NonReusedIdAllocator();
-
- // Implement IdAllocatorInterface.
- virtual ResourceId AllocateID() OVERRIDE;
- virtual ResourceId AllocateIDAtOrAbove(ResourceId desired_id) OVERRIDE;
- virtual bool MarkAsUsed(ResourceId id) OVERRIDE;
- virtual void FreeID(ResourceId id) OVERRIDE;
- virtual bool InUse(ResourceId id) const OVERRIDE;
-
- private:
- ResourceId last_id_;
-
- DISALLOW_COPY_AND_ASSIGN(NonReusedIdAllocator);
-};
-
} // namespace gpu
#endif // GPU_COMMAND_BUFFER_CLIENT_ID_ALLOCATOR_H_
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_ids_autogen.h ('k') | gpu/command_buffer/common/id_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698