~saviq/qtubuntu/revert-occlude-lp1620297

« back to all changes in this revision

Viewing changes to src/ubuntumirclient/glcontext.h

  • Committer: Bileto Bot
  • Author(s): Gerry Boland
  • Date: 2016-08-09 23:00:16 UTC
  • mfrom: (328.3.4 eglconvenience-retry)
  • Revision ID: ci-train-bot@canonical.com-20160809230016-nutnvedrejhvzrdc
Reapply rev 324 plus fix: EGL convenience, plus workaround for hybris not supporting GLESv3. (LP: #1507817, #1594198)

Approved by: Daniel d'Andrada, Unity8 CI Bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#define UBUNTU_OPENGL_CONTEXT_H
19
19
 
20
20
#include <qpa/qplatformopenglcontext.h>
 
21
#include <private/qeglplatformcontext_p.h>
21
22
 
22
23
#include <EGL/egl.h>
23
24
 
24
 
class UbuntuOpenGLContext : public QPlatformOpenGLContext
 
25
class UbuntuOpenGLContext : public QEGLPlatformContext
25
26
{
26
27
public:
27
 
    UbuntuOpenGLContext(const QSurfaceFormat &surfaceFormat, UbuntuOpenGLContext *share,
28
 
                        EGLDisplay display, EGLConfig config);
29
 
    virtual ~UbuntuOpenGLContext();
30
 
 
31
 
    // QPlatformOpenGLContext methods.
32
 
    QSurfaceFormat format() const override { return mSurfaceFormat; }
33
 
    void swapBuffers(QPlatformSurface *surface) override;
34
 
    bool makeCurrent(QPlatformSurface *surface) override;
35
 
    void doneCurrent() override;
36
 
    bool isValid() const override { return mEglContext != EGL_NO_CONTEXT; }
37
 
    void (*getProcAddress(const QByteArray& procName)) () override;
38
 
 
39
 
    EGLContext eglContext() const { return mEglContext; }
40
 
 
41
 
private:
42
 
    const QSurfaceFormat mSurfaceFormat;
43
 
    EGLContext mEglContext;
44
 
    EGLDisplay mEglDisplay;
 
28
    UbuntuOpenGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share,
 
29
                        EGLDisplay display);
 
30
 
 
31
    // QEGLPlatformContext methods.
 
32
    void swapBuffers(QPlatformSurface *surface) final;
 
33
    bool makeCurrent(QPlatformSurface *surface) final;
 
34
 
 
35
protected:
 
36
    EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) final;
45
37
};
46
38
 
47
39
#endif // UBUNTU_OPENGL_CONTEXT_H