42 #include <GLES/eglplatform.h> 49 #define WSEGL_UNUSED(x) (void)x; 53 #if !defined(PVR2D_REV_MAJOR) 54 #define WSEGL_CAP_WINDOWS_USE_HW_SYNC WSEGL_CAP_WINDOWS_USE_MBX_SYNC 55 #define WSEGL_CAP_PIXMAPS_USE_HW_SYNC WSEGL_CAP_PIXMAPS_USE_MBX_SYNC 67 {WSEGL_DRAWABLE_WINDOW, WSEGL_PIXELFORMAT_565, WSEGL_FALSE,
68 0, 0, 0, WSEGL_OPAQUE, 0},
69 {WSEGL_DRAWABLE_PIXMAP, WSEGL_PIXELFORMAT_565, WSEGL_FALSE,
70 0, 0, 0, WSEGL_OPAQUE, 0},
71 {WSEGL_NO_DRAWABLE, 0, 0, 0, 0, 0, 0, 0}
78 if (nativeDisplay == WSEGL_DEFAULT_DISPLAY)
81 return WSEGL_BAD_NATIVE_DISPLAY;
87 const WSEGLCaps **caps, WSEGLConfig **configs)
89 WSEGLPixelFormat pixelFormat;
92 if (nativeDisplay != WSEGL_DEFAULT_DISPLAY)
93 return WSEGL_CANNOT_INITIALISE;
97 return WSEGL_CANNOT_INITIALISE;
102 pixelFormat = WSEGL_PIXELFORMAT_565;
106 pixelFormat = WSEGL_PIXELFORMAT_4444;
110 pixelFormat = WSEGL_PIXELFORMAT_8888;
115 return WSEGL_CANNOT_INITIALISE;
124 return WSEGL_SUCCESS;
132 return WSEGL_SUCCESS;
138 case 90:
return WSEGL_ROTATE_90;
139 case 180:
return WSEGL_ROTATE_180;
140 case 270:
return WSEGL_ROTATE_270;
141 default:
return WSEGL_ROTATE_0;
147 (WSEGLDisplayHandle display, WSEGLConfig *config,
148 WSEGLDrawableHandle *drawable, NativeWindowType
nativeWindow,
149 WSEGLRotationAngle *rotationAngle)
157 if (nativeWindow >= (NativeWindowType)0 &&
161 return WSEGL_OUT_OF_MEMORY;
162 *drawable = (WSEGLDrawableHandle)screen;
164 return WSEGL_OUT_OF_MEMORY;
166 return WSEGL_SUCCESS;
172 return WSEGL_BAD_DRAWABLE;
175 *drawable = (WSEGLDrawableHandle)draw;
178 return WSEGL_OUT_OF_MEMORY;
179 return WSEGL_SUCCESS;
184 (WSEGLDisplayHandle display, WSEGLConfig *config,
185 WSEGLDrawableHandle *drawable, NativePixmapType
nativePixmap,
186 WSEGLRotationAngle *rotationAngle)
191 return WSEGL_BAD_NATIVE_PIXMAP;
193 return WSEGL_OUT_OF_MEMORY;
194 *drawable = (WSEGLDrawableHandle)nativePixmap;
195 *rotationAngle = WSEGL_ROTATE_0;
196 return WSEGL_SUCCESS;
204 return WSEGL_SUCCESS;
209 return WSEGL_SUCCESS;
214 (WSEGLDrawableHandle _drawable,
unsigned long data)
219 return WSEGL_BAD_DRAWABLE;
221 return WSEGL_SUCCESS;
226 (WSEGLDrawableHandle drawable,
unsigned long interval)
230 PVR2DSetPresentFlipProperties
232 PVR2D_PRESENT_PROPERTY_INTERVAL, 0, 0, 0, NULL, interval);
234 return WSEGL_SUCCESS;
239 (WSEGLDrawableHandle drawable,
unsigned long engine)
242 if (engine == WSEGL_DEFAULT_NATIVE_ENGINE)
243 return WSEGL_SUCCESS;
245 return WSEGL_BAD_NATIVE_ENGINE;
250 (WSEGLDrawableHandle _drawable, NativePixmapType nativePixmap)
257 return WSEGL_BAD_NATIVE_WINDOW;
259 return WSEGL_BAD_NATIVE_PIXMAP;
261 memset(&blit, 0,
sizeof(blit));
263 blit.CopyCode = PVR2DROPcopy;
264 blit.BlitFlags = PVR2D_BLIT_DISABLE_ALL;
283 PVR2DQueryBlitsComplete
286 return WSEGL_SUCCESS;
291 (
void *address,
unsigned long width,
unsigned long height,
292 unsigned long stride, WSEGLPixelFormat
format,
293 NativePixmapType nativePixmap)
296 PVR2DFORMAT pixelFormat;
299 return WSEGL_BAD_NATIVE_PIXMAP;
303 case WSEGL_PIXELFORMAT_565:
304 pixelFormat = PVR2D_RGB565;
break;
305 case WSEGL_PIXELFORMAT_4444:
306 pixelFormat = PVR2D_ARGB4444;
break;
307 case WSEGL_PIXELFORMAT_8888:
308 pixelFormat = PVR2D_ARGB8888;
break;
310 return WSEGL_BAD_CONFIG;
312 if (width > (
unsigned long)(pixmap->
rect.
width) ||
313 height > (
unsigned long)(pixmap->
rect.
height) ||
315 return WSEGL_BAD_CONFIG;
322 char *srcaddr = (
char *)address;
326 srcaddr += height * stride;
328 srcaddr -= (int)stride;
329 memcpy(dstaddr, srcaddr, srcwidth);
330 dstaddr += dststride;
333 return WSEGL_SUCCESS;
338 (WSEGLDrawableHandle _drawable, WSEGLDrawableParams *sourceParams,
339 WSEGLDrawableParams *renderParams)
342 PVR2DMEMINFO *source, *render;
343 WSEGLPixelFormat pixelFormat;
346 return WSEGL_BAD_DRAWABLE;
351 pixelFormat = WSEGL_PIXELFORMAT_565;
355 pixelFormat = WSEGL_PIXELFORMAT_4444;
359 pixelFormat = WSEGL_PIXELFORMAT_8888;
363 sourceParams->ui32Width = drawable->
rect.
width;
364 sourceParams->ui32Height = drawable->
rect.
height;
366 sourceParams->ePixelFormat = pixelFormat;
367 sourceParams->pvLinearAddress = source->pBase;
368 sourceParams->ui32HWAddress = source->ui32DevAddr;
369 sourceParams->hPrivateData = source->hPrivateData;
371 renderParams->ui32Width = drawable->
rect.
width;
372 renderParams->ui32Height = drawable->
rect.
height;
374 renderParams->ePixelFormat = pixelFormat;
375 renderParams->pvLinearAddress = render->pBase;
376 renderParams->ui32HWAddress = render->ui32DevAddr;
377 renderParams->hPrivateData = render->hPrivateData;
379 return WSEGL_SUCCESS;
PVR2DMEMINFO * backBuffers[PVRQWS_MAX_BACK_BUFFERS]
#define WSEGL_CAP_PIXMAPS_USE_HW_SYNC
int pvrQwsAllocBuffers(PvrQwsDrawable *drawable)
static WSEGLError wseglCopyFromDrawable(WSEGLDrawableHandle _drawable, NativePixmapType nativePixmap)
PvrQwsDrawable * pvrQwsFetchWindow(long winId)
PVR2DFLIPCHAINHANDLE flipChain
PVR2DCONTEXTHANDLE context
static WSEGLError wseglCopyFromPBuffer(void *address, unsigned long width, unsigned long height, unsigned long stride, WSEGLPixelFormat format, NativePixmapType nativePixmap)
void pvrQwsFreeBuffers(PvrQwsDrawable *drawable)
PvrQwsDisplay pvrQwsDisplay
static WSEGLError wseglCloseDisplay(WSEGLDisplayHandle display)
int pvrQwsGetBuffers(PvrQwsDrawable *drawable, PVR2DMEMINFO **source, PVR2DMEMINFO **render)
int pvrQwsDisplayOpen(void)
static WSEGLError wseglIsDisplayValid(NativeDisplayType nativeDisplay)
Q_GUI_EXPORT EGLNativePixmapType nativePixmap(QPixmap *)
#define PVRQWS_MAX_SCREENS
static WSEGLRotationAngle wseglRotationValue(int degrees)
static WSEGLError wseglSwapDrawable(WSEGLDrawableHandle _drawable, unsigned long data)
static WSEGLError wseglCreateWindowDrawable(WSEGLDisplayHandle display, WSEGLConfig *config, WSEGLDrawableHandle *drawable, NativeWindowType nativeWindow, WSEGLRotationAngle *rotationAngle)
static WSEGLError wseglSwapControlInterval(WSEGLDrawableHandle drawable, unsigned long interval)
static WSEGLConfig wseglDisplayConfigs[]
Q_GUI_EXPORT EGLDisplay display()
int pvrQwsReleaseWindow(PvrQwsDrawable *drawable)
static WSEGLError wseglDeleteDrawable(WSEGLDrawableHandle _drawable)
static const char * data(const QByteArray &arr)
const WSEGL_FunctionTable * WSEGL_GetFunctionTablePointer(void)
static WSEGLError wseglWaitNative(WSEGLDrawableHandle drawable, unsigned long engine)
static WSEGLError wseglGetDrawableParameters(WSEGLDrawableHandle _drawable, WSEGLDrawableParams *sourceParams, WSEGLDrawableParams *renderParams)
Q_GUI_EXPORT EGLNativeDisplayType nativeDisplay()
unsigned long numFlipBuffers
#define WSEGL_CAP_WINDOWS_USE_HW_SYNC
static WSEGLCaps const wseglDisplayCaps[]
int pvrQwsSwapBuffers(PvrQwsDrawable *drawable, int repaintOnly)
static WSEGLError wseglInitializeDisplay(NativeDisplayType nativeDisplay, WSEGLDisplayHandle *display, const WSEGLCaps **caps, WSEGLConfig **configs)
PvrQwsDrawable * pvrQwsScreenWindow(int screen)
PvrQwsScreenInfo screens[PVRQWS_MAX_SCREENS]
void pvrQwsDestroyDrawable(PvrQwsDrawable *drawable)
Q_GUI_EXPORT EGLNativeWindowType nativeWindow(QWidget *)
void pvrQwsDisplayClose(void)
static WSEGL_FunctionTable const wseglFunctions
static WSEGLError wseglCreatePixmapDrawable(WSEGLDisplayHandle display, WSEGLConfig *config, WSEGLDrawableHandle *drawable, NativePixmapType nativePixmap, WSEGLRotationAngle *rotationAngle)