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(const gfx::GpuMemoryBufferId& id,
32 const gfx::Size& size,
33 unsigned internalformat,
36 // Destroys GPU memory buffer identified by |id|.
37 void DestroyGpuMemoryBuffer(const gfx::GpuMemoryBufferId& id);
39 // Creates a GLImage instance for GPU memory buffer identified by |id|.
40 scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer(
41 const gfx::GpuMemoryBufferId& id,
42 const gfx::Size& size,
43 unsigned internalformat);
46 BufferToPixmapMap native_pixmap_map_;
51 #endif // UI_OZONE_GPU_GPU_MEMORY_BUFFER_FACTORY_OZONE_NATIVE_BUFFER_H_