summaryrefslogtreecommitdiffstats
path: root/src/core/ozone/gl_surface_qt.h
blob: f9d18a0aef06b307e2ef5ff1bebdb96808e80bcb (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
41
42
43
44
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef GL_SURFACE_QT_H_
#define GL_SURFACE_QT_H_

#include <string>

#include "ui/gfx/geometry/size.h"
#include "ui/gl/gl_surface.h"

namespace gl {

class GLSurfaceQt: public GLSurface {
public:
    explicit GLSurfaceQt(const gfx::Size& size);

    static bool HasEGLExtension(const char* name);

    // Implement GLSurface.
    GLDisplay *GetGLDisplay() override;
    void *GetConfig() override;
    bool IsOffscreen() override;
    gfx::SwapResult SwapBuffers(PresentationCallback callback) override;
    gfx::Size GetSize() override;
    GLSurfaceFormat GetFormat() override;

protected:
    GLSurfaceQt();
    virtual ~GLSurfaceQt();

    gfx::Size m_size;
    GLSurfaceFormat m_format;

public:
    static void* g_config;
    static GLDisplay *g_display;
    static std::string g_extensions;
    static std::string g_client_extensions;
};

} // namespace gl

#endif // GL_SURFACE_QT_H_