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

Unified Diff: ui/ozone/platform/drm/gpu/intel_drm_pixmap.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: rebase after ClientNativePixmap is introduced Created 5 years, 4 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
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_surface_factory.cc ('k') | ui/ozone/platform/drm/gpu/intel_drm_pixmap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/gpu/intel_drm_pixmap.h
diff --git a/ui/ozone/platform/drm/gpu/intel_drm_pixmap.h b/ui/ozone/platform/drm/gpu/intel_drm_pixmap.h
new file mode 100644
index 0000000000000000000000000000000000000000..05ac3f386b6afac2a672e340bc71a02f1dc8e254
--- /dev/null
+++ b/ui/ozone/platform/drm/gpu/intel_drm_pixmap.h
@@ -0,0 +1,86 @@
+// 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_INTEL_DRM_PIXMAP_H_
+#define UI_OZONE_PLATFORM_DRM_GPU_INTEL_DRM_PIXMAP_H_
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "ui/gfx/buffer_types.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/ozone/public/client_native_pixmap.h"
+#include "ui/ozone/public/native_pixmap.h"
+
+typedef struct _drm_intel_bo drm_intel_bo;
+
+namespace ui {
+
+class IntelDrmPixmap : public NativePixmap {
+ public:
+ static scoped_refptr<IntelDrmPixmap> Create(
+ const base::FileDescriptor& device_fd,
+ gfx::BufferFormat format,
+ const gfx::Size& size);
+
+ // NativePixmap:
+ void* GetEGLClientBuffer() override;
+ int GetDmaBufFd() override;
+ int GetDmaBufPitch() override;
+
+ bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
+ int plane_z_order,
+ gfx::OverlayTransform plane_transform,
+ const gfx::Rect& display_bounds,
+ const gfx::RectF& crop_rect) override;
+ void SetScalingCallback(const ScalingCallback& scaling_callback) override;
+ scoped_refptr<NativePixmap> GetScaledPixmap(gfx::Size new_size) override;
+ gfx::NativePixmapHandle ExportHandle() override;
+
+ private:
+ IntelDrmPixmap();
+ ~IntelDrmPixmap() override;
+
+ bool Initialize(const base::FileDescriptor& device_fd,
+ gfx::BufferFormat format,
+ const gfx::Size& size);
+
+ drm_intel_bo* buffer_;
+ base::ScopedFD prime_fd_;
+ uint32 stride_;
+
+ DISALLOW_COPY_AND_ASSIGN(IntelDrmPixmap);
+};
+
+class IntelDrmClientPixmap : public ClientNativePixmap {
+ public:
+ static scoped_ptr<IntelDrmClientPixmap> CreateFromHandle(
+ const gfx::NativePixmapHandle& handle,
+ const base::FileDescriptor& device_fd,
+ gfx::BufferFormat format,
+ const gfx::Size& size);
+ ~IntelDrmClientPixmap() override;
+
+ // CilentNativePixmap:
+ bool Map(void** data) override;
+ void Unmap() override;
+ void GetStride(int* stride) const override;
+
+ private:
+ IntelDrmClientPixmap();
+
+ bool InitializeFromHandle(const gfx::NativePixmapHandle& handle,
+ const base::FileDescriptor& device_fd,
+ gfx::BufferFormat format,
+ const gfx::Size& size);
+
+ drm_intel_bo* buffer_;
+ base::ScopedFD prime_fd_;
+ uint32 stride_;
+
+ DISALLOW_COPY_AND_ASSIGN(IntelDrmClientPixmap);
+};
+
+} // namespace ui
+
+#endif // UI_OZONE_PLATFORM_DRM_GPU_INTEL_DRM_PIXMAP_H_
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_surface_factory.cc ('k') | ui/ozone/platform/drm/gpu/intel_drm_pixmap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698