Qt 4.8
qmeegoextensions.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the plugins of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef MEXTENSIONS_H
43 #define MEXTENSIONS_H
44 
45 #include <private/qgl_p.h>
46 #include <private/qeglcontext_p.h>
47 #include <private/qpixmapdata_gl_p.h>
48 #include <EGL/egl.h>
49 #include <GLES2/gl2.h>
50 #include <GLES2/gl2ext.h>
51 
52 /* Extensions decls */
53 
54 #ifndef EGL_SHARED_IMAGE_NOK
55 #define EGL_SHARED_IMAGE_NOK 0x30DA
57 #endif
58 
59 #ifndef EGL_GL_TEXTURE_2D_KHR
60 #define EGL_GL_TEXTURE_2D_KHR 0x30B1
61 #endif
62 
63 #ifndef EGL_FIXED_WIDTH_NOK
64 #define EGL_FIXED_WIDTH_NOK 0x30DB
65 #define EGL_FIXED_HEIGHT_NOK 0x30DC
66 #endif
67 
68 #ifndef EGL_BITMAP_POINTER_KHR
69 #define EGL_BITMAP_POINTER_KHR 0x30C6
70 #define EGL_BITMAP_PITCH_KHR 0x30C7
71 #endif
72 
73 #ifndef EGL_MAP_PRESERVE_PIXELS_KHR
74 #define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4
75 #define EGL_LOCK_USAGE_HINT_KHR 0x30C5
76 #define EGL_READ_SURFACE_BIT_KHR 0x0001
77 #define EGL_WRITE_SURFACE_BIT_KHR 0x0002
78 #endif
79 
80 #ifndef EGL_SYNC_FENCE_KHR
81 #define EGL_SYNC_FENCE_KHR 0x30F9
82 #define EGL_SYNC_TYPE_KHR 0x30F7
83 #define EGL_SYNC_STATUS_KHR 0x30F1
84 #define EGL_SYNC_CONDITION_KHR 0x30F8
85 #define EGL_SIGNALED_KHR 0x30F2
86 #define EGL_UNSIGNALED_KHR 0x30F3
87 #define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0
88 #define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001
89 #define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull
90 #define EGL_TIMEOUT_EXPIRED_KHR 0x30F5
91 #define EGL_CONDITION_SATISFIED_KHR 0x30F6
92 #define EGL_NO_SYNC_KHR ((EGLSyncKHR)0)
93 typedef void* EGLSyncKHR;
94 typedef khronos_utime_nanoseconds_t EGLTimeKHR;
95 #endif
96 
97 /* Class */
98 
100 {
101 public:
102  static void ensureInitialized();
103 
104  static EGLNativeSharedImageTypeNOK eglCreateSharedImageNOK(EGLDisplay dpy, EGLImageKHR image, EGLint *props);
105  static bool eglQueryImageNOK(EGLDisplay dpy, EGLImageKHR image, EGLint prop, EGLint *v);
106  static bool eglDestroySharedImageNOK(EGLDisplay dpy, EGLNativeSharedImageTypeNOK img);
107  static bool eglSetSurfaceScalingNOK(EGLDisplay dpy, EGLSurface surface, int x, int y, int width, int height);
108  static bool eglLockSurfaceKHR(EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
109  static bool eglUnlockSurfaceKHR(EGLDisplay display, EGLSurface surface);
110  static EGLSyncKHR eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
111  static bool eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync);
112  static EGLint eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
113  static EGLBoolean eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
114 
115 private:
116  static void initialize();
117 
118  static bool initialized;
119  static bool hasImageShared;
120  static bool hasSurfaceScaling;
121  static bool hasLockSurface;
122  static bool hasFenceSync;
123 };
124 
125 #endif
static bool eglSetSurfaceScalingNOK(EGLDisplay dpy, EGLSurface surface, int x, int y, int width, int height)
static EGLBoolean eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value)
static bool hasImageShared
static void initialize()
int type
Definition: qmetatype.cpp:239
khronos_utime_nanoseconds_t EGLTimeKHR
static bool eglDestroySharedImageNOK(EGLDisplay dpy, EGLNativeSharedImageTypeNOK img)
static bool eglUnlockSurfaceKHR(EGLDisplay display, EGLSurface surface)
void * EGLNativeSharedImageTypeNOK
Q_GUI_EXPORT EGLDisplay display()
Definition: qegl.cpp:589
static bool initialized
static bool eglQueryImageNOK(EGLDisplay dpy, EGLImageKHR image, EGLint prop, EGLint *v)
static bool hasLockSurface
unsigned int EGLenum
Definition: qegl_p.h:69
static EGLSyncKHR eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list)
void * EGLImageKHR
Definition: qegl_p.h:165
static EGLint eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout)
static void ensureInitialized()
static bool eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync)
void * EGLSyncKHR
static bool hasSurfaceScaling
static bool eglLockSurfaceKHR(EGLDisplay display, EGLSurface surface, const EGLint *attrib_list)
static EGLNativeSharedImageTypeNOK eglCreateSharedImageNOK(EGLDisplay dpy, EGLImageKHR image, EGLint *props)
static bool hasFenceSync