Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1405)

Unified Diff: content/common/gpu/client/gpu_memory_buffer_impl_ozone_gbm_intel.h

Issue 1071273002: NotForReview: Implement zero/one-copy texture for ozone freon using Intel DRM Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/client/gpu_memory_buffer_impl_ozone_gbm_intel.h
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_ozone_gbm_intel.h b/content/common/gpu/client/gpu_memory_buffer_impl_ozone_gbm_intel.h
new file mode 100644
index 0000000000000000000000000000000000000000..46a0301194c4fa491009c1c0e6f6b6c87b948c73
--- /dev/null
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_ozone_gbm_intel.h
@@ -0,0 +1,50 @@
+// 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_INTEL_H_
+#define CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_GBM_INTEL_H_
+
+extern "C" {
+#include <libdrm/intel_bufmgr.h>
+}
+
+#include "content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.h"
+
+namespace content {
+
+// Implementation of GPU memory buffer based on Ozone GBM libdrm_intel.so.
+class GpuMemoryBufferImplOzoneGbmIntel
reveman 2015/04/13 00:46:13 It should either be implemented behind OzoneNative
dshwang 2015/04/14 13:15:55 behind OzoneNativeBuffer. It's ozone specific beca
+ : public GpuMemoryBufferImplOzoneNativeBuffer {
+ public:
+ static scoped_ptr<GpuMemoryBufferImpl> CreateFromHandle(
+ const gfx::GpuMemoryBufferHandle& handle,
+ const gfx::Size& size,
+ Format format,
+ const DestructionCallback& callback);
+ ~GpuMemoryBufferImplOzoneGbmIntel() override;
+
+ // Overridden from gfx::GpuMemoryBuffer:
+ bool Map(void** data) override;
+ void Unmap() override;
+ void GetStride(uint32* stride) const override;
+ gfx::GpuMemoryBufferHandle GetHandle() const override;
+
+ private:
+ GpuMemoryBufferImplOzoneGbmIntel(gfx::GpuMemoryBufferId id,
+ const gfx::Size& size,
+ Format format,
+ const DestructionCallback& callback);
+
+ bool Initialize(const gfx::GpuMemoryBufferHandle& handle);
+
+ drm_intel_bo* buffer_;
+ base::ScopedFD prime_fd_;
+ uint32 stride_;
+
+ DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImplOzoneGbmIntel);
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_GPU_CLIENT_GPU_MEMORY_BUFFER_IMPL_OZONE_GBM_INTEL_H_

Powered by Google App Engine
This is Rietveld 408576698