Chromium Code Reviews| Index: ui/gfx/linux/native_pixmap_dmabuf_stub.h |
| diff --git a/ui/gfx/linux/native_pixmap_dmabuf_stub.h b/ui/gfx/linux/native_pixmap_dmabuf_stub.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8ff4e9da345c87cb93cb25e7345455f03c242f91 |
| --- /dev/null |
| +++ b/ui/gfx/linux/native_pixmap_dmabuf_stub.h |
| @@ -0,0 +1,58 @@ |
| +// Copyright 2017 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_GFX_LINUX_NATIVE_PIXMAP_DMABUF_STUB_H_ |
| +#define UI_GFX_LINUX_NATIVE_PIXMAP_DMABUF_STUB_H_ |
| + |
| +#include <stdint.h> |
| + |
| +#include <memory> |
| + |
| +#include "base/files/scoped_file.h" |
| +#include "base/macros.h" |
| +#include "ui/gfx/client_native_pixmap.h" |
| +#include "ui/gfx/geometry/size.h" |
| +#include "ui/gfx/native_pixmap.h" |
| + |
| +namespace gfx { |
| + |
| +class GFX_EXPORT NativePixmapDmaBufStub : public gfx::NativePixmap { |
|
spang
2017/04/21 15:11:49
Why is it called stub?
It holds the actual dmabuf
Julien Isorce
2017/04/24 12:26:00
I agree the stub suffix is not valuable.
|
| + public: |
| + NativePixmapDmaBufStub(const gfx::Size& size, |
| + gfx::BufferFormat format, |
| + const gfx::NativePixmapHandle& handle); |
| + |
| + // NativePixmap: |
| + void* GetEGLClientBuffer() const override; |
| + bool AreDmaBufFdsValid() const override; |
| + size_t GetDmaBufFdCount() const override; |
| + int GetDmaBufFd(size_t plane) const override; |
| + int GetDmaBufPitch(size_t plane) const override; |
| + int GetDmaBufOffset(size_t plane) const override; |
| + uint64_t GetDmaBufModifier(size_t plane) const override; |
| + gfx::BufferFormat GetBufferFormat() const override; |
| + gfx::Size GetBufferSize() const 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 SetProcessingCallback( |
| + const ProcessingCallback& processing_callback) override; |
| + gfx::NativePixmapHandle ExportHandle() override; |
| + |
| + private: |
| + ~NativePixmapDmaBufStub() override; |
| + |
| + gfx::Size size_; |
| + gfx::BufferFormat format_; |
| + std::vector<base::ScopedFD> fds_; |
| + std::vector<gfx::NativePixmapPlane> planes_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(NativePixmapDmaBufStub); |
| +}; |
| + |
| +} // namespace gfx |
| + |
| +#endif // UI_GFX_LINUX_NATIVE_PIXMAP_DMABUF_STUB_H_ |