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

Side by Side Diff: ui/ozone/platform/drm/gpu/gbm_buffer.h

Issue 2533163002: ozone: Create GbmBuffers from fourcc formats and gbm flags. (Closed)
Patch Set: Make ozone_unittests compile. Created 4 years 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_ 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_
6 #define UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_ 6 #define UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/files/scoped_file.h" 10 #include "base/files/scoped_file.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "ui/gfx/buffer_types.h" 12 #include "ui/gfx/buffer_types.h"
13 #include "ui/gfx/geometry/size.h" 13 #include "ui/gfx/geometry/size.h"
14 #include "ui/ozone/platform/drm/gpu/gbm_buffer_base.h" 14 #include "ui/ozone/platform/drm/gpu/gbm_buffer_base.h"
15 #include "ui/ozone/public/native_pixmap.h" 15 #include "ui/ozone/public/native_pixmap.h"
16 16
17 struct gbm_bo; 17 struct gbm_bo;
18 18
19 namespace ui { 19 namespace ui {
20 20
21 class GbmDevice; 21 class GbmDevice;
22 class GbmSurfaceFactory; 22 class GbmSurfaceFactory;
23 23
24 class GbmBuffer : public GbmBufferBase { 24 class GbmBuffer : public GbmBufferBase {
25 public: 25 public:
26 static scoped_refptr<GbmBuffer> CreateBuffer( 26 static scoped_refptr<GbmBuffer> CreateBuffer(
27 const scoped_refptr<GbmDevice>& gbm, 27 const scoped_refptr<GbmDevice>& gbm,
28 gfx::BufferFormat format, 28 uint32_t format,
29 const gfx::Size& size, 29 const gfx::Size& size,
30 gfx::BufferUsage usage); 30 uint32_t usage);
31 static scoped_refptr<GbmBuffer> CreateBufferFromFds( 31 static scoped_refptr<GbmBuffer> CreateBufferFromFds(
32 const scoped_refptr<GbmDevice>& gbm, 32 const scoped_refptr<GbmDevice>& gbm,
33 gfx::BufferFormat format, 33 uint32_t format,
34 const gfx::Size& size, 34 const gfx::Size& size,
35 std::vector<base::ScopedFD>&& fds, 35 std::vector<base::ScopedFD>&& fds,
36 const std::vector<gfx::NativePixmapPlane>& planes); 36 const std::vector<gfx::NativePixmapPlane>& planes);
37 gfx::BufferFormat GetFormat() const { return format_; } 37 uint32_t GetFormat() const { return format_; }
38 gfx::BufferUsage GetUsage() const { return usage_; } 38 uint32_t GetFlags() const { return flags_; }
39 bool AreFdsValid() const; 39 bool AreFdsValid() const;
40 size_t GetFdCount() const; 40 size_t GetFdCount() const;
41 int GetFd(size_t plane) const; 41 int GetFd(size_t plane) const;
42 int GetStride(size_t plane) const; 42 int GetStride(size_t plane) const;
43 int GetOffset(size_t plane) const; 43 int GetOffset(size_t plane) const;
44 size_t GetSize(size_t plane) const; 44 size_t GetSize(size_t plane) const;
45 uint64_t GetFormatModifier(size_t plane) const; 45 uint64_t GetFormatModifier(size_t plane) const;
46 gfx::Size GetSize() const override; 46 gfx::Size GetSize() const override;
47 47
48 private: 48 private:
49 GbmBuffer(const scoped_refptr<GbmDevice>& gbm, 49 GbmBuffer(const scoped_refptr<GbmDevice>& gbm,
50 gbm_bo* bo, 50 gbm_bo* bo,
51 gfx::BufferFormat format, 51 uint32_t format,
52 gfx::BufferUsage usage, 52 uint32_t flags,
53 std::vector<base::ScopedFD>&& fds, 53 std::vector<base::ScopedFD>&& fds,
54 const gfx::Size& size, 54 const gfx::Size& size,
55 const std::vector<gfx::NativePixmapPlane>&& planes); 55 const std::vector<gfx::NativePixmapPlane>&& planes);
56 ~GbmBuffer() override; 56 ~GbmBuffer() override;
57 57
58 gfx::BufferFormat format_; 58 uint32_t format_;
59 gfx::BufferUsage usage_; 59 uint32_t flags_;
60 std::vector<base::ScopedFD> fds_; 60 std::vector<base::ScopedFD> fds_;
61 gfx::Size size_; 61 gfx::Size size_;
62 62
63 std::vector<gfx::NativePixmapPlane> planes_; 63 std::vector<gfx::NativePixmapPlane> planes_;
64 64
65 DISALLOW_COPY_AND_ASSIGN(GbmBuffer); 65 DISALLOW_COPY_AND_ASSIGN(GbmBuffer);
66 }; 66 };
67 67
68 class GbmPixmap : public NativePixmap { 68 class GbmPixmap : public NativePixmap {
69 public: 69 public:
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // this Pixmap. This holds the processed buffer. 104 // this Pixmap. This holds the processed buffer.
105 scoped_refptr<GbmPixmap> processed_pixmap_; 105 scoped_refptr<GbmPixmap> processed_pixmap_;
106 ProcessingCallback processing_callback_; 106 ProcessingCallback processing_callback_;
107 107
108 DISALLOW_COPY_AND_ASSIGN(GbmPixmap); 108 DISALLOW_COPY_AND_ASSIGN(GbmPixmap);
109 }; 109 };
110 110
111 } // namespace ui 111 } // namespace ui
112 112
113 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_ 113 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698