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

Unified Diff: ui/ozone/platform/drm/gpu/gbm_map_pixmap_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: ui/ozone/platform/drm/gpu/gbm_map_pixmap_intel.h
diff --git a/ui/ozone/platform/drm/gpu/gbm_map_pixmap_intel.h b/ui/ozone/platform/drm/gpu/gbm_map_pixmap_intel.h
new file mode 100644
index 0000000000000000000000000000000000000000..1512f44e076d52cf2b5211690bc90ce5dc0c64c3
--- /dev/null
+++ b/ui/ozone/platform/drm/gpu/gbm_map_pixmap_intel.h
@@ -0,0 +1,54 @@
+// 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 UI_OZONE_PLATFORM_DRM_GPU_GBM_MAP_PIXMAP_INTEL_H_
+#define UI_OZONE_PLATFORM_DRM_GPU_GBM_MAP_PIXMAP_INTEL_H_
+
+extern "C" {
+#include <libdrm/intel_bufmgr.h>
+}
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/ozone/platform/drm/gpu/gbm_buffer_base.h"
+#include "ui/ozone/public/native_pixmap.h"
+#include "ui/ozone/public/surface_factory_ozone.h"
+
+namespace ui {
+
+class GbmDevice;
+
+class GbmMapPixmapIntel : public NativePixmap {
+ public:
+ static scoped_refptr<GbmMapPixmapIntel> CreatePixmap(
+ const scoped_refptr<GbmDevice>& gbm,
+ SurfaceFactoryOzone::BufferFormat format,
+ const gfx::Size& size,
+ gfx::GpuMemoryBufferHandle* handle);
+
+ // NativePixmap:
+ void* GetEGLClientBuffer() override;
+ int GetDmaBufFd() override;
+ int GetDmaBufPitch() override;
+
+ private:
+ GbmMapPixmapIntel();
+ ~GbmMapPixmapIntel() override;
+
+ bool Initialize(const scoped_refptr<GbmDevice>& gbm,
+ SurfaceFactoryOzone::BufferFormat format,
+ const gfx::Size& size,
+ gfx::GpuMemoryBufferHandle* handle);
+
+ drm_intel_bo* buffer_;
+ base::ScopedFD prime_fd_;
+ uint32 stride_;
+
+ DISALLOW_COPY_AND_ASSIGN(GbmMapPixmapIntel);
+};
+
+} // namespace ui
+
+#endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_MAP_PIXMAP_INTEL_H_

Powered by Google App Engine
This is Rietveld 408576698