X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fgpu%2Fcommand_buffer%2Fclient%2Ffenced_allocator.h;h=8e222e135bf6a329988141138a657e87f8be6c79;hb=004985e17e624662a4c85c76a7654039dc83f028;hp=bb5c55170ab25e2766a4804c762a51ee00e8c2f3;hpb=2f108dbacb161091e42a3479f4e171339b7e7623;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/gpu/command_buffer/client/fenced_allocator.h b/src/gpu/command_buffer/client/fenced_allocator.h index bb5c551..8e222e1 100644 --- a/src/gpu/command_buffer/client/fenced_allocator.h +++ b/src/gpu/command_buffer/client/fenced_allocator.h @@ -7,10 +7,13 @@ #ifndef GPU_COMMAND_BUFFER_CLIENT_FENCED_ALLOCATOR_H_ #define GPU_COMMAND_BUFFER_CLIENT_FENCED_ALLOCATOR_H_ +#include + #include +#include "base/bind.h" #include "base/logging.h" -#include "gpu/command_buffer/common/types.h" +#include "base/macros.h" #include "gpu/gpu_export.h" namespace gpu { @@ -35,7 +38,8 @@ class GPU_EXPORT FencedAllocator { // Creates a FencedAllocator. Note that the size of the buffer is passed, but // not its base address: everything is handled as offsets into the buffer. FencedAllocator(unsigned int size, - CommandBufferHelper *helper); + CommandBufferHelper *helper, + const base::Closure& poll_callback); ~FencedAllocator(); @@ -99,7 +103,7 @@ class GPU_EXPORT FencedAllocator { State state; Offset offset; unsigned int size; - int32 token; // token to wait for in the FREE_PENDING_TOKEN case. + int32_t token; // token to wait for in the FREE_PENDING_TOKEN case. }; // Comparison functor for memory block sorting. @@ -113,7 +117,7 @@ class GPU_EXPORT FencedAllocator { typedef std::vector Container; typedef unsigned int BlockIndex; - static const int32 kUnusedToken = 0; + static const int32_t kUnusedToken = 0; // Gets the index of a memory block, given its offset. BlockIndex GetBlockByOffset(Offset offset); @@ -136,6 +140,7 @@ class GPU_EXPORT FencedAllocator { Offset AllocInBlock(BlockIndex index, unsigned int size); CommandBufferHelper *helper_; + base::Closure poll_callback_; Container blocks_; size_t bytes_in_use_; @@ -148,8 +153,9 @@ class FencedAllocatorWrapper { public: FencedAllocatorWrapper(unsigned int size, CommandBufferHelper* helper, + const base::Closure& poll_callback, void* base) - : allocator_(size, helper), + : allocator_(size, helper, poll_callback), base_(base) { } // Allocates a block of memory. If the buffer is out of directly available