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

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

Issue 169403005: command_buffer: Implement path rendering functions for CHROMIUM_path_rendering (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nv-pr-02-texgen
Patch Set: rebase and cleanup ids 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
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 b877083008ad724f515799283d66173215d03344..7f83a9c6691caefb911d15f4387c7619f127cd9a 100644
--- a/gpu/command_buffer/common/id_allocator.h
+++ b/gpu/command_buffer/common/id_allocator.h
@@ -36,12 +36,20 @@ class GPU_EXPORT IdAllocator {
// Note: may wrap if it starts near limit.
ResourceId AllocateIDAtOrAbove(ResourceId desired_id);
+ // Allocates |range| amount of contiguous ids.
+ // Returns the first id to |first_id| or |kInvalidResource| if
+ // allocation failed.
+ ResourceId AllocateIDRange(uint32_t range);
+
// Marks an id as used. Returns false if id was already used.
bool MarkAsUsed(ResourceId id);
// Frees a resource ID.
void FreeID(ResourceId id);
+ // Frees a |range| amount of contiguous ids, starting from |first_id|.
+ void FreeIDRange(ResourceId first_id, uint32_t range);
+
// Checks whether or not a resource ID is in use.
bool InUse(ResourceId id) const;

Powered by Google App Engine
This is Rietveld 408576698