summaryrefslogtreecommitdiff
path: root/chromium/ui/gl/glx_util.h
blob: 9a15e723f6a6e18794084778418b6985b56f84fc (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
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef UI_GL_GLX_UTIL_H_
#define UI_GL_GLX_UTIL_H_

#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/glx.h"
#include "ui/gl/gl_export.h"

using GLXFBConfig = struct __GLXFBConfigRec*;

namespace gfx {
class NativePixmapDmaBuf;
enum class BufferFormat;
}  // namespace gfx

namespace gl {

GL_EXPORT GLXFBConfig GetFbConfigForWindow(x11::Connection* connection,
                                           x11::Window window);

GL_EXPORT GLXFBConfig
GetGlxFbConfigForXProtoFbConfig(x11::Connection* connection,
                                x11::Glx::FbConfig xproto_config);

GL_EXPORT x11::Pixmap XPixmapFromNativePixmap(
    const gfx::NativePixmapDmaBuf& native_pixmap,
    gfx::BufferFormat buffer_format);

}  // namespace gl

#endif  // UI_GL_GLX_UTIL_H_