| 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..5324c2a1f5eab4db41e0bb888984e48dc6d03494
|
| --- /dev/null
|
| +++ b/ui/ozone/platform/drm/gpu/vgem_pixmap.h
|
| @@ -0,0 +1,55 @@
|
| +// 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;
|
| + 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;
|
| +
|
| + 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_
|
|
|