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 CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_H_
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_H_
8 #include "content/common/gpu/client/gpu_memory_buffer_impl.h"
12 // Implementation of GPU memory buffer based on Ozone native buffers.
13 class GpuMemoryBufferImplOzoneNativeBuffer : public GpuMemoryBufferImpl {
15 static void Create(gfx::GpuMemoryBufferId id,
16 const gfx::Size& size,
19 const CreationCallback& callback);
21 static void AllocateForChildProcess(gfx::GpuMemoryBufferId id,
22 const gfx::Size& size,
25 const AllocationCallback& callback);
27 static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle(
28 const gfx::GpuMemoryBufferHandle& handle,
29 const gfx::Size& size,
31 const DestructionCallback& callback);
33 static void DeletedByChildProcess(gfx::GpuMemoryBufferId id,
37 static bool IsFormatSupported(Format format);
38 static bool IsUsageSupported(Usage usage);
39 static bool IsConfigurationSupported(Format format, Usage usage);
41 // Overridden from gfx::GpuMemoryBuffer:
43 void Unmap() override;
44 uint32 GetStride() const override;
45 gfx::GpuMemoryBufferHandle GetHandle() const override;
48 GpuMemoryBufferImplOzoneNativeBuffer(gfx::GpuMemoryBufferId id,
49 const gfx::Size& size,
51 const DestructionCallback& callback);
52 ~GpuMemoryBufferImplOzoneNativeBuffer() override;
54 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplOzoneNativeBuffer);
57 } // namespace content
59 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_H_