1 // Copyright 2014 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 UI_OZONE_GPU_GPU_MEMORY_BUFFER_FACTORY_OZONE_NATIVE_BUFFER_H_
6 #define UI_OZONE_GPU_GPU_MEMORY_BUFFER_FACTORY_OZONE_NATIVE_BUFFER_H_
10 #include "base/memory/ref_counted.h"
11 #include "ui/gfx/geometry/size.h"
12 #include "ui/gfx/gpu_memory_buffer.h"
13 #include "ui/ozone/gpu/ozone_gpu_export.h"
22 class OZONE_GPU_EXPORT GpuMemoryBufferFactoryOzoneNativeBuffer {
23 typedef std::map<std::pair<uint32_t, uint32_t>, scoped_refptr<NativePixmap> >
27 GpuMemoryBufferFactoryOzoneNativeBuffer();
28 virtual ~GpuMemoryBufferFactoryOzoneNativeBuffer();
30 // Creates a GPU memory buffer identified by |id|.
31 bool CreateGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
32 const gfx::Size& size,
33 gfx::GpuMemoryBuffer::Format format,
34 gfx::GpuMemoryBuffer::Usage usage,
37 // Destroys GPU memory buffer identified by |id|.
38 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id);
40 // Creates a GLImage instance for GPU memory buffer identified by |id|.
41 scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer(
42 gfx::GpuMemoryBufferId id,
43 const gfx::Size& size,
44 gfx::GpuMemoryBuffer::Format format,
45 unsigned internalformat,
49 BufferToPixmapMap native_pixmap_map_;
54 #endif // UI_OZONE_GPU_GPU_MEMORY_BUFFER_FACTORY_OZONE_NATIVE_BUFFER_H_