ozone: fix HDPMLegacy - do the PF after overlays, also clear old overlays
[chromium-blink-merge.git] / ui / ozone / platform / dri / gbm_buffer.h
blob94fddd94197e33a4c2918953a4451f1a95dda0b3
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.
5 #ifndef UI_OZONE_PLATFORM_DRI_GBM_BUFFER_H_
6 #define UI_OZONE_PLATFORM_DRI_GBM_BUFFER_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/gfx/geometry/size.h"
11 #include "ui/ozone/platform/dri/gbm_buffer_base.h"
12 #include "ui/ozone/public/native_pixmap.h"
13 #include "ui/ozone/public/surface_factory_ozone.h"
15 struct gbm_bo;
17 namespace ui {
19 class GbmWrapper;
21 class GbmBuffer : public GbmBufferBase {
22 public:
23 static scoped_refptr<GbmBuffer> CreateBuffer(
24 GbmWrapper* gbm,
25 SurfaceFactoryOzone::BufferFormat format,
26 const gfx::Size& size,
27 bool scanout);
29 private:
30 GbmBuffer(GbmWrapper* gbm, gbm_bo* bo, bool scanout);
31 ~GbmBuffer() override;
33 DISALLOW_COPY_AND_ASSIGN(GbmBuffer);
36 class GbmPixmap : public NativePixmap {
37 public:
38 GbmPixmap(scoped_refptr<GbmBuffer> buffer);
39 bool Initialize(GbmWrapper* gbm);
41 // NativePixmap:
42 void* GetEGLClientBuffer() override;
43 int GetDmaBufFd() override;
44 int GetDmaBufPitch() override;
46 scoped_refptr<GbmBuffer> buffer() { return buffer_; }
48 private:
49 ~GbmPixmap() override;
51 scoped_refptr<GbmBuffer> buffer_;
52 int dma_buf_;
54 DISALLOW_COPY_AND_ASSIGN(GbmPixmap);
57 } // namespace ui
59 #endif // UI_OZONE_PLATFORM_DRI_GBM_BUFFER_H_