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

Unified Diff: ui/ozone/platform/drm/gpu/vgem_pixmap.h

Issue 1134993003: ozone: Implement zero/one-copy texture for Ozone GBM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase to new crrev.com/1128113011 Created 5 years, 6 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/vgem_pixmap.h
diff --git a/ui/ozone/platform/drm/gpu/vgem_pixmap.h b/ui/ozone/platform/drm/gpu/vgem_pixmap.h
new file mode 100644
index 0000000000000000000000000000000000000000..aeb40315c16cd3a1fef367a87ac5fc9a999ca835
--- /dev/null
+++ b/ui/ozone/platform/drm/gpu/vgem_pixmap.h
@@ -0,0 +1,48 @@
+// Copyright 2014 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_VGEM_BUFFER_H_
+#define UI_OZONE_PLATFORM_DRM_GPU_VGEM_BUFFER_H_
+
+#include "ui/ozone/public/native_pixmap.h"
+#include "ui/ozone/public/surface_factory_ozone.h"
+
+namespace ui {
+
+class VgemPixmap : public NativePixmap {
+ public:
+ VgemPixmap(base::FileDescriptor handle,
+ base::FileDescriptor vgem_handle,
+ gfx::Size size,
+ SurfaceFactoryOzone::BufferFormat format,
+ BufferUsage usage);
+ bool Initialize();
+
+ // NativePixmap:
+ void* GetEGLClientBuffer() override;
+ int GetDmaBufFd() override;
+ int GetDmaBufPitch() override;
+ BufferUsage GetBufferUsage() const override;
+ void* Map() override;
+ void Unmap() override;
+
+ protected:
+ ~VgemPixmap() override;
+
+ private:
+ uint32_t vgem_bo_handle_;
+ base::ScopedFD dma_buf_;
+ base::FileDescriptor vgem_fd_;
+ gfx::Size size_;
+ SurfaceFactoryOzone::BufferFormat format_;
+ BufferUsage usage_;
+ size_t stride_;
+ void* mmap_ptr_;
+
+ DISALLOW_COPY_AND_ASSIGN(VgemPixmap);
+};
+
+} // namespace ui
+
+#endif // UI_OZONE_PLATFORM_DRM_GPU_VGEM_BUFFER_H_

Powered by Google App Engine
This is Rietveld 408576698