#ifndef CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_
#define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_IO_SURFACE_H_
#include "base/mac/scoped_cftyperef.h"
#include "content/common/gpu/client/gpu_memory_buffer_impl.h"
class IOSurfaceSupport;
namespace content {
class GpuMemoryBufferImplIOSurface : public GpuMemoryBufferImpl {
public:
GpuMemoryBufferImplIOSurface(gfx::Size size, unsigned internalformat);
virtual ~GpuMemoryBufferImplIOSurface();
static bool IsFormatSupported(unsigned internalformat);
static uint32 PixelFormat(unsigned internalformat);
bool Initialize(gfx::GpuMemoryBufferHandle handle);
virtual void* Map(AccessMode mode) OVERRIDE;
virtual void Unmap() OVERRIDE;
virtual uint32 GetStride() const OVERRIDE;
virtual gfx::GpuMemoryBufferHandle GetHandle() const OVERRIDE;
private:
IOSurfaceSupport* io_surface_support_;
base::ScopedCFTypeRef<CFTypeRef> io_surface_;
DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplIOSurface);
};
}
#endif