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

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

Issue 1285183008: Ozone integration. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: add missing license header Created 5 years, 4 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 2014 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_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_
6 #define UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_
7
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/gfx/geometry/size.h"
11 #include "ui/ozone/platform/drm/gpu/gbm_buffer_base.h"
12 #include "ui/ozone/platform/drm/gpu/screen_manager.h"
13 #include "ui/ozone/public/native_pixmap.h"
14 #include "ui/ozone/public/surface_factory_ozone.h"
15
16 struct gbm_bo;
17
18 namespace ui {
19
20 class GbmDevice;
21
22 class GbmBuffer : public GbmBufferBase {
23 public:
24 static scoped_refptr<GbmBuffer> CreateBuffer(
25 const scoped_refptr<GbmDevice>& gbm,
26 SurfaceFactoryOzone::BufferFormat format,
27 const gfx::Size& size,
28 bool scanout);
29
30 private:
31 GbmBuffer(const scoped_refptr<GbmDevice>& gbm, gbm_bo* bo, bool scanout);
32 ~GbmBuffer() override;
33
34 DISALLOW_COPY_AND_ASSIGN(GbmBuffer);
35 };
36
37 class GbmPixmap : public NativePixmap {
38 public:
39 GbmPixmap(const scoped_refptr<GbmBuffer>& buffer,
40 ScreenManager* screen_manager);
41 bool Initialize();
42
43 // NativePixmap:
44 void* GetEGLClientBuffer() override;
45 int GetDmaBufFd() override;
46 int GetDmaBufPitch() override;
47 bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
48 int plane_z_order,
49 gfx::OverlayTransform plane_transform,
50 const gfx::Rect& display_bounds,
51 const gfx::RectF& crop_rect) override;
52
53 scoped_refptr<GbmBuffer> buffer() { return buffer_; }
54
55 private:
56 ~GbmPixmap() override;
57
58 scoped_refptr<GbmBuffer> buffer_;
59 int dma_buf_ = -1;
60
61 ScreenManager* screen_manager_; // Not owned.
62
63 DISALLOW_COPY_AND_ASSIGN(GbmPixmap);
64 };
65
66 } // namespace ui
67
68 #endif // UI_OZONE_PLATFORM_DRM_GPU_GBM_BUFFER_H_
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_window_unittest.cc ('k') | ui/ozone/platform/drm/gpu/gbm_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698