1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_TRACKER_H_
6 #define GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_TRACKER_H_
8 #include "base/basictypes.h"
9 #include "gles2_impl_export.h"
10 #include "gpu/command_buffer/client/hash_tables.h"
13 class GpuMemoryBuffer
;
21 // Tracks GPU memory buffer objects on the client side.
22 class GLES2_IMPL_EXPORT GpuMemoryBufferTracker
{
24 explicit GpuMemoryBufferTracker(GpuControl
* gpu_control
);
25 virtual ~GpuMemoryBufferTracker();
27 int32
CreateBuffer(size_t width
, size_t height
, int32 internalformat
);
28 gfx::GpuMemoryBuffer
* GetBuffer(int32 image_id
);
29 void RemoveBuffer(int32 image_id
);
32 typedef gpu::hash_map
<int32
, gfx::GpuMemoryBuffer
*> BufferMap
;
34 GpuControl
* gpu_control_
;
36 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferTracker
);
42 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_MEMORY_BUFFER_TRACKER_H_