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

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: depends on https://codereview.chromium.org/1134993003/ 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/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..d8e4ef5343febbdd38929a5b4643ef576eebb2fe
--- /dev/null
+++ b/ui/ozone/platform/drm/gpu/intel_drm_pixmap.h
@@ -0,0 +1,69 @@
+// 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/geometry/size.h"
+#include "ui/ozone/public/native_pixmap.h"
+#include "ui/ozone/public/surface_factory_ozone.h"
+
+typedef struct _drm_intel_bo drm_intel_bo;
+
+namespace ui {
+
+class IntelDrmPixmap : public NativePixmap {
dshwang 2015/06/29 17:22:05 All code using Intel DRM are in this class. Both G
+ public:
+ static scoped_refptr<IntelDrmPixmap> Create(
+ base::FileDescriptor device_fd,
+ SurfaceFactoryOzone::BufferFormat format,
+ const gfx::Size& size);
+
+ // Renderer uses this API.
+ static scoped_refptr<IntelDrmPixmap> CreateFromHandle(
+ base::FileDescriptor device_fd,
+ base::FileDescriptor handle,
+ SurfaceFactoryOzone::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;
+ BufferUsage GetBufferUsage() const override;
+ void* Map() override;
+ void Unmap() override;
+
+ private:
+ IntelDrmPixmap();
+ ~IntelDrmPixmap() override;
+
+ bool Initialize(base::FileDescriptor device_fd,
+ SurfaceFactoryOzone::BufferFormat format,
+ const gfx::Size& size);
+ bool InitializeFromHandle(base::FileDescriptor device_fd,
+ base::FileDescriptor handle,
+ SurfaceFactoryOzone::BufferFormat format,
+ const gfx::Size& size);
+
+ drm_intel_bo* buffer_;
+ base::ScopedFD prime_fd_;
+ uint32 stride_;
+
+ DISALLOW_COPY_AND_ASSIGN(IntelDrmPixmap);
+};
+
+} // namespace ui
+
+#endif // UI_OZONE_PLATFORM_DRM_GPU_INTEL_DRM_PIXMAP_H_

Powered by Google App Engine
This is Rietveld 408576698