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

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

Issue 1426993003: Ozone: Dont hardcode format to YUV when using Overlay Composition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review fixes Created 4 years, 11 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
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_buffer.cc ('k') | ui/ozone/platform/drm/gpu/gbm_buffer_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_BASE_H_ 5 #ifndef UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_BASE_H_
6 #define UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_BASE_H_ 6 #define UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_BASE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h" 11 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h"
12 12
13 struct gbm_bo; 13 struct gbm_bo;
14 14
15 namespace ui { 15 namespace ui {
16 16
17 class DrmDevice; 17 class GbmDevice;
18 18
19 // Wrapper for a GBM buffer. The base class provides common functionality 19 // Wrapper for a GBM buffer. The base class provides common functionality
20 // required to prepare the buffer for scanout. It does not provide any ownership 20 // required to prepare the buffer for scanout. It does not provide any ownership
21 // of the buffer. Implementations of this base class should deal with buffer 21 // of the buffer. Implementations of this base class should deal with buffer
22 // ownership. 22 // ownership.
23 class GbmBufferBase : public ScanoutBuffer { 23 class GbmBufferBase : public ScanoutBuffer {
24 public: 24 public:
25 gbm_bo* bo() const { return bo_; } 25 gbm_bo* bo() const { return bo_; }
26 const scoped_refptr<GbmDevice>& drm() const { return drm_; }
26 27
27 // ScanoutBuffer: 28 // ScanoutBuffer:
28 uint32_t GetFramebufferId() const override; 29 uint32_t GetFramebufferId() const override;
29 uint32_t GetHandle() const override; 30 uint32_t GetHandle() const override;
30 gfx::Size GetSize() const override; 31 gfx::Size GetSize() const override;
31 uint32_t GetFramebufferPixelFormat() const override; 32 uint32_t GetFramebufferPixelFormat() const override;
32 bool RequiresGlFinish() const override; 33 bool RequiresGlFinish() const override;
33 34
34 protected: 35 protected:
35 GbmBufferBase(const scoped_refptr<DrmDevice>& drm, 36 GbmBufferBase(const scoped_refptr<GbmDevice>& drm,
36 gbm_bo* bo, 37 gbm_bo* bo,
37 gfx::BufferFormat format, 38 gfx::BufferFormat format,
38 gfx::BufferUsage usage); 39 gfx::BufferUsage usage);
39 ~GbmBufferBase() override; 40 ~GbmBufferBase() override;
40 41
41 private: 42 private:
42 scoped_refptr<DrmDevice> drm_; 43 scoped_refptr<GbmDevice> drm_;
43 gbm_bo* bo_; 44 gbm_bo* bo_;
44 uint32_t framebuffer_ = 0; 45 uint32_t framebuffer_ = 0;
45 uint32_t framebuffer_pixel_format_ = 0; 46 uint32_t framebuffer_pixel_format_ = 0;
46 47
47 DISALLOW_COPY_AND_ASSIGN(GbmBufferBase); 48 DISALLOW_COPY_AND_ASSIGN(GbmBufferBase);
48 }; 49 };
49 50
50 } // namespace ui 51 } // namespace ui
51 52
52 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_BASE_H_ 53 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_BASE_H_
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_buffer.cc ('k') | ui/ozone/platform/drm/gpu/gbm_buffer_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698