Index: content/common/gpu/client/gpu_memory_buffer_impl_ozone_gbm.h |
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_ozone_gbm.h b/content/common/gpu/client/gpu_memory_buffer_impl_ozone_gbm.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c715058d22c5a187b2c904347ffced230adff7cf |
--- /dev/null |
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_ozone_gbm.h |
@@ -0,0 +1,49 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_GBM_H_ |
+#define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_GBM_H_ |
+ |
+#include "content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.h" |
+ |
+struct gbm_bo; |
+ |
+namespace content { |
+ |
+// Implementation of GPU memory buffer based on Ozone GBM. |
+class GpuMemoryBufferImplOzoneGbm |
reveman
2015/05/11 16:40:56
We shouldn't have multiple Ozone abstractions for
dshwang
2015/05/11 17:11:53
it's directly related to spang's concern also.
Gpu
dshwang
2015/05/14 12:25:46
I understand. I merge this into OzoneNativeBuffer.
|
+ : public GpuMemoryBufferImplOzoneNativeBuffer { |
+ public: |
+ static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle( |
+ const gfx::GpuMemoryBufferHandle& handle, |
+ const gfx::Size& size, |
+ Format format, |
+ const DestructionCallback& callback); |
+ ~GpuMemoryBufferImplOzoneGbm() override; |
+ |
+ // Overridden from gfx::GpuMemoryBuffer: |
+ bool Map(void** data) override; |
+ void Unmap() override; |
+ void GetStride(int* stride) const override; |
+ gfx::GpuMemoryBufferHandle GetHandle() const override; |
+ |
+ private: |
+ GpuMemoryBufferImplOzoneGbm(gfx::GpuMemoryBufferId id, |
+ const gfx::Size& size, |
+ Format format, |
+ const DestructionCallback& callback); |
+ |
+ bool Initialize(const gfx::GpuMemoryBufferHandle& handle); |
+ |
+ uint32_t vgem_bo_handle_; |
+ base::ScopedFD dma_buf_; |
+ size_t stride_; |
+ void* mmap_ptr_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplOzoneGbm); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_GBM_H_ |