summaryrefslogtreecommitdiff
path: root/chromium/ui/gfx/linux/gbm_device.h
blob: 50f7fe56b0b5f4773b8178fd3e1db7e4da1529a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef UI_GFX_LINUX_GBM_DEVICE_H_
#define UI_GFX_LINUX_GBM_DEVICE_H_

#include <gbm.h>
#include <memory>

#include "base/files/file.h"
#include "base/macros.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/native_pixmap_handle.h"

namespace ui {

class GbmBuffer;

class GbmDevice {
 public:
  virtual ~GbmDevice() {}

  virtual std::unique_ptr<GbmBuffer> CreateBuffer(uint32_t format,
                                                  const gfx::Size& size,
                                                  uint32_t flags) = 0;
  virtual std::unique_ptr<GbmBuffer> CreateBufferWithModifiers(
      uint32_t format,
      const gfx::Size& size,
      uint32_t flags,
      const std::vector<uint64_t>& modifiers) = 0;
  virtual std::unique_ptr<GbmBuffer> CreateBufferFromHandle(
      uint32_t format,
      const gfx::Size& size,
      gfx::NativePixmapHandle handle) = 0;
};

}  // namespace ui

#endif  // UI_GFX_LINUX_GBM_DEVICE_H_