1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/egl/egltest/endpointtestsuite/automated/inc/eglendpointwrap.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,85 @@
1.4 +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +
1.16 +
1.17 +/**
1.18 + @file
1.19 + @test
1.20 + @internalComponent - Internal Symbian test code
1.21 +*/
1.22 +
1.23 +
1.24 +#ifndef __EGLENDPOINTWRAP_H__
1.25 +#define __EGLENDPOINTWRAP_H__
1.26 +
1.27 +
1.28 +#include <e32base.h>
1.29 +#include <EGL/egl.h>
1.30 +#include <EGL/eglext.h>
1.31 +
1.32 +
1.33 +//generic function pointer
1.34 +typedef void (*TAnyFuncPtr)(...);
1.35 +
1.36 +
1.37 +/*
1.38 + * TEglEndpointWrap is a simple class that presents all of the EGL endpoint
1.39 + * extension functions without the user needing to perform an eglGetProcAddress()
1.40 + * to obtain the function pointer. Each endpoint member function takes the same
1.41 + * arguments as the EGL functions and returns the same types. After before first
1.42 + * use, you should check the Error() function to ensure that all function pointers
1.43 + * were resolved. Trying to use one of the endpoint functions in the event of a
1.44 + * construction error will result in a panic.
1.45 + */
1.46 +class TEglEndpointWrap
1.47 + {
1.48 +public:
1.49 + TEglEndpointWrap();
1.50 + TInt Error() const;
1.51 +
1.52 + //endpoint functions
1.53 + EGLEndpointNOK CreateEndpoint(EGLDisplay dpy, EGLenum type, EGLenum source_type, EGLEndpointSourceNOK source, const EGLint *attrib_list) const;
1.54 + EGLBoolean DestroyEndpoint(EGLDisplay dpy, EGLEndpointNOK endpoint) const;
1.55 + EGLint GetEndpointAttrib(EGLDisplay dpy, EGLEndpointNOK endpoint, EGLint attrib) const;
1.56 + EGLBoolean SetEndpointAttrib(EGLDisplay dpy, EGLEndpointNOK endpoint, EGLint attrib, EGLint value) const;
1.57 + EGLBoolean EndpointBeginStreaming(EGLDisplay dpy, EGLEndpointNOK endpoint) const;
1.58 + EGLBoolean EndpointEndStreaming(EGLDisplay dpy, EGLEndpointNOK endpoint) const;
1.59 + EGLImageKHR AcquireImage(EGLDisplay dpy, EGLEndpointNOK endpoint) const;
1.60 + EGLBoolean ReleaseImage(EGLDisplay dpy, EGLEndpointNOK endpoint, EGLImageKHR image, EGLenum api) const;
1.61 + EGLint GetEndpointDirtyArea(EGLDisplay dpy, EGLEndpointNOK endpoint, EGLint* rects, EGLint start_rect, EGLint max_rects, EGLBoolean collapse) const;
1.62 + EGLBoolean EndpointRequestNotification(EGLDisplay dpy, EGLEndpointNOK endpoint, EGLTRequestStatusNOK sync) const;
1.63 + EGLBoolean EndpointCancelNotification(EGLDisplay dpy, EGLEndpointNOK endpoint) const;
1.64 + EGLBoolean DestroyImage(EGLDisplay dpy, EGLImageKHR image) const;
1.65 +
1.66 +private:
1.67 + TAnyFuncPtr ProcAddressL(const char* aProcName) const;
1.68 +
1.69 +private:
1.70 + TInt iError;
1.71 +
1.72 + //enpoint function pointers
1.73 + PFNEGLCREATEENDPOINTNOKPROC ipfnEglCreateEndpointNOK;
1.74 + PFNEGLDESTROYENDPOINTNOKPROC ipfnEglDestroyEndpointNOK;
1.75 + PFNEGLGETENDPOINTATTRIBNOKPROC ipfnEglGetEndpointAttribNOK;
1.76 + PFNEGLSETENDPOINTATTRIBNOKPROC ipfnEglSetEndpointAttribNOK;
1.77 + PFNEGLENDPOINTBEGINSTREAMINGNOKPROC ipfnEglEndpointBeginStreamingNOK;
1.78 + PFNEGLENDPOINTENDSTREAMINGNOKPROC ipfnEglEndpointEndStreamingNOK;
1.79 + PFNEGLACQUIREIMAGENOKPROC ipfnEglAcquireImageNOK;
1.80 + PFNEGLRELEASEIMAGENOKPROC ipfnEglReleaseImageNOK;
1.81 + PFNEGLGETENDPOINTDIRTYAREANOKPROC ipfnEglGetEndpointDirtyAreaNOK;
1.82 + PFNEGLENDPOINTREQUESTNOTIFICATIONNOKPROC ipfnEglEndpointRequestNotificationNOK;
1.83 + PFNEGLENDPOINTCANCELNOTIFICATIONNOKPROC ipfnEglEndpointCancelNotificationNOK;
1.84 + PFNEGLDESTROYIMAGEKHRPROC ipfnEglDestroyImageKHR;
1.85 + };
1.86 +
1.87 +
1.88 +#endif