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

Side by Side Diff: ui/gfx/linux/native_pixmap_dmabuf_stub.h

Issue 2705213005: Add NativePixmapDmabufStub to finalize glCreateImageCHROMIUM on Linux. (Closed)
Patch Set: Rebase and addressed remarks Created 3 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_GFX_LINUX_NATIVE_PIXMAP_DMABUF_STUB_H_
6 #define UI_GFX_LINUX_NATIVE_PIXMAP_DMABUF_STUB_H_
7
8 #include <stdint.h>
9
10 #include <memory>
11
12 #include "base/files/scoped_file.h"
13 #include "base/macros.h"
14 #include "ui/gfx/client_native_pixmap.h"
15 #include "ui/gfx/geometry/size.h"
16 #include "ui/gfx/native_pixmap.h"
17
18 namespace gfx {
19
20 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.
21 public:
22 NativePixmapDmaBufStub(const gfx::Size& size,
23 gfx::BufferFormat format,
24 const gfx::NativePixmapHandle& handle);
25
26 // NativePixmap:
27 void* GetEGLClientBuffer() const override;
28 bool AreDmaBufFdsValid() const override;
29 size_t GetDmaBufFdCount() const override;
30 int GetDmaBufFd(size_t plane) const override;
31 int GetDmaBufPitch(size_t plane) const override;
32 int GetDmaBufOffset(size_t plane) const override;
33 uint64_t GetDmaBufModifier(size_t plane) const override;
34 gfx::BufferFormat GetBufferFormat() const override;
35 gfx::Size GetBufferSize() const override;
36 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
37 int plane_z_order,
38 gfx::OverlayTransform plane_transform,
39 const gfx::Rect& display_bounds,
40 const gfx::RectF& crop_rect) override;
41 void SetProcessingCallback(
42 const ProcessingCallback& processing_callback) override;
43 gfx::NativePixmapHandle ExportHandle() override;
44
45 private:
46 ~NativePixmapDmaBufStub() override;
47
48 gfx::Size size_;
49 gfx::BufferFormat format_;
50 std::vector<base::ScopedFD> fds_;
51 std::vector<gfx::NativePixmapPlane> planes_;
52
53 DISALLOW_COPY_AND_ASSIGN(NativePixmapDmaBufStub);
54 };
55
56 } // namespace gfx
57
58 #endif // UI_GFX_LINUX_NATIVE_PIXMAP_DMABUF_STUB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698