1 // Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 |
|
15 #ifndef EGLREMOTEFUNCTIONCALL_H_ |
|
16 #define EGLREMOTEFUNCTIONCALL_H_ |
|
17 |
|
18 #include "remotefunctioncall.h" |
|
19 |
|
20 #ifdef __SYMBIAN32__ |
|
21 #include <e32const.h> |
|
22 #include <e32def.h> |
|
23 #include <EGL/egl.h> |
|
24 #else |
|
25 #include "EGL/egl.h" |
|
26 #include "EGL/eglext.h" |
|
27 #endif |
|
28 |
|
29 |
|
30 enum TSelectionCriteria |
|
31 { |
|
32 EExact, |
|
33 EAtLeast, |
|
34 EMask, |
|
35 ESpecial //This essentially means, don't compare |
|
36 }; |
|
37 |
|
38 //For adding a sync value to the egl calls |
|
39 const TInt KSyncReadSurface = 2; |
|
40 const TInt KSyncDrawSurface = 4; |
|
41 |
|
42 //This is the maximum number of configs that can be processed |
|
43 //when the client asks for sg-compatible or sg-incompatible configs |
|
44 const TInt KConfigsMaxCnt = 200; |
|
45 |
|
46 enum TMetaGetConfigsMode |
|
47 { |
|
48 EMetaGetConfigsAll, //get all the configs available |
|
49 EMetaGetConfigsSg, //get configs supporting sg images |
|
50 EMetaGetConfigsNonSg, //get configs not supporting sg images |
|
51 }; |
|
52 |
|
53 NONSHARABLE_CLASS(EglRFC): public RemoteFunctionCall |
|
54 { |
|
55 public: |
|
56 // EGL operation code |
|
57 enum TOperationCode |
|
58 { |
|
59 // EGL 1.4 |
|
60 EeglGetError, // 0 |
|
61 EeglGetDisplay, |
|
62 EeglInitialize, |
|
63 EeglTerminate, |
|
64 EeglQueryString, // not used |
|
65 EeglGetConfigs, |
|
66 EeglChooseConfig, |
|
67 EeglGetConfigAttrib, |
|
68 EeglCreateWindowSurface, |
|
69 EeglCreatePbufferSurface, |
|
70 EeglCreatePixmapSurface, // 10 |
|
71 EeglDestroySurface, |
|
72 EeglQuerySurface, |
|
73 EeglBindAPI, |
|
74 EeglQueryAPI, |
|
75 EeglWaitClient, |
|
76 EeglReleaseThread, |
|
77 EeglCreatePbufferFromClientBuffer, |
|
78 EeglSurfaceAttrib, |
|
79 EeglBindTexImage, |
|
80 EeglReleaseTexImage, // 20 |
|
81 EeglSwapInterval, |
|
82 EeglCreateContext, |
|
83 EeglDestroyContext, |
|
84 EeglMakeCurrent, |
|
85 EeglGetCurrentContext, |
|
86 EeglGetCurrentSurface, |
|
87 EeglGetCurrentDisplay, |
|
88 EeglQueryContext, |
|
89 EeglWaitGL, |
|
90 EeglWaitNative, // 30 |
|
91 EeglSwapBuffers, |
|
92 EeglCopyBuffers, |
|
93 EeglSimulatorSetSurfaceParams, |
|
94 EeglSimulatorCopyImageData, |
|
95 EeglPixmapSurfaceSizeChanged, |
|
96 EeglMakeCurrentSg, //sgImage support |
|
97 EeglCreatePixmapSurfaceSg, |
|
98 EeglMetaGetConfigs, |
|
99 EeglMetaSgGetHandles |
|
100 }; |
|
101 |
|
102 //Parameter data type |
|
103 enum TParamType |
|
104 { |
|
105 EEGLBoolean, |
|
106 EEGLint, |
|
107 EEGLenum, |
|
108 EEGLDisplay, |
|
109 EEGLConfig, |
|
110 EEGLSurface, |
|
111 EEGLContext, |
|
112 EEGLClientBuffer, |
|
113 EEGLImageKHR, |
|
114 EEGLNativeDisplayType, |
|
115 EEGLNativeWindowType, |
|
116 EEGLNativePixmapType, |
|
117 EEGLVoid, |
|
118 ETUint64 |
|
119 }; |
|
120 |
|
121 EglRFC( RemoteFunctionCallData& aData ); |
|
122 |
|
123 inline void AppendTUint64( const TUint64& aParam, RemoteFunctionCallData::TParamDirection aDir = RemoteFunctionCallData::EIn ); |
|
124 inline void AppendEGLBoolean( const EGLBoolean& aParam, RemoteFunctionCallData::TParamDirection aDir = RemoteFunctionCallData::EIn ); |
|
125 inline void AppendEGLint( const EGLint& aParam, RemoteFunctionCallData::TParamDirection aDir = RemoteFunctionCallData::EIn ); |
|
126 inline void AppendEGLenum( const EGLenum& aParam, RemoteFunctionCallData::TParamDirection aDir = RemoteFunctionCallData::EIn ); |
|
127 inline void AppendEGLDisplay( const EGLDisplay& aParam, RemoteFunctionCallData::TParamDirection aDir = RemoteFunctionCallData::EIn ); |
|
128 inline void AppendEGLConfig( const EGLConfig& aParam, RemoteFunctionCallData::TParamDirection aDir = RemoteFunctionCallData::EIn ); |
|
129 inline void AppendEGLSurface( const EGLSurface& aParam, RemoteFunctionCallData::TParamDirection aDir = RemoteFunctionCallData::EIn ); |
|
130 inline void AppendEGLContext( const EGLContext& aParam, RemoteFunctionCallData::TParamDirection aDir = RemoteFunctionCallData::EIn ); |
|
131 inline void AppendEGLClientBuffer( const EGLClientBuffer& aParam, RemoteFunctionCallData::TParamDirection aDir = RemoteFunctionCallData::EIn ); |
|
132 inline void AppendEGLImageKHR( const EGLImageKHR& aParam, RemoteFunctionCallData::TParamDirection aDir = RemoteFunctionCallData::EIn ); |
|
133 inline void AppendEGLNativeDisplayType( const NativeDisplayType& aParam, RemoteFunctionCallData::TParamDirection aDir = RemoteFunctionCallData::EIn ); |
|
134 inline void AppendEGLNativeWindowType( const NativeWindowType& aParam, RemoteFunctionCallData::TParamDirection aDir = RemoteFunctionCallData::EIn ); |
|
135 inline void AppendEGLNativePixmapType( const NativePixmapType& aParam, RemoteFunctionCallData::TParamDirection aDir = RemoteFunctionCallData::EIn ); |
|
136 #ifdef __SYMBIAN32__ |
|
137 inline void AppendEGLSize( const TSize& aSize, RemoteFunctionCallData::TParamDirection aDir = RemoteFunctionCallData::EIn ); |
|
138 #endif |
|
139 |
|
140 //Gets a simple parameter value from parameter array |
|
141 inline void GetTUint64( TUint64& aParam, TInt aIndex ); |
|
142 inline void GetEGLBoolean( EGLBoolean& aParam, TInt aIndex ); |
|
143 inline void GetEGLint( EGLint& aParam, TInt aIndex ); |
|
144 inline void GetEGLenum( EGLenum& aParam, TInt aIndex ); |
|
145 inline void GetEGLDisplay( EGLDisplay& aParam, TInt aIndex ); |
|
146 inline void GetEGLConfig( EGLConfig& aParam, TInt aIndex ); |
|
147 inline void GetEGLSurface( EGLSurface& aParam, TInt aIndex ); |
|
148 inline void GetEGLContext( EGLContext& aParam, TInt aIndex ); |
|
149 inline void GetEGLClientBuffer( EGLClientBuffer& aParam, TInt aIndex ); |
|
150 inline void GetEGLImageKHR( EGLImageKHR& aParam, TInt aIndex ); |
|
151 inline void GetEGLNativeDisplayType( NativeDisplayType& aParam, TInt aIndex ); |
|
152 inline void GetEGLNativeWindowType( NativeWindowType& aParam, TInt aIndex ); |
|
153 inline void GetEGLNativePixmapType( NativePixmapType& aParam, TInt aIndex ); |
|
154 |
|
155 //Gets a pointer to an array parameter from parameter array |
|
156 inline void GetEGLintVectorData( EGLint* &aData, TInt& aSize, TInt aIndex ); |
|
157 inline void GetEGLConfigVectorData( EGLConfig* &aData, TInt& aSize, TInt aIndex ); |
|
158 inline void GetVectorData( void* &aData, TInt& aSize, TInt aIndex ); |
|
159 |
|
160 //Sets a pointer to the data of an array parameter |
|
161 inline void SetEGLintVectorData( const EGLint* aData, TInt aLength, TInt aIndex ); |
|
162 inline void SetEGLConfigVectorData( const EGLConfig* aData, TInt aLength, TInt aIndex ); |
|
163 inline void SetVectorData( const void* aData, TInt aLength, TInt aIndex ); |
|
164 |
|
165 //Appends an array parameter to the parameter array |
|
166 // Does not serialize any data |
|
167 inline void AppendEGLintVector( const EGLint* aData, TInt aLength, RemoteFunctionCallData::TParamDirection aDir = RemoteFunctionCallData::EIn ); |
|
168 inline void AppendEGLConfigVector( const EGLConfig* aData, TInt aLength, RemoteFunctionCallData::TParamDirection aDir = RemoteFunctionCallData::EIn ); |
|
169 inline void AppendVector( const void* aData, TInt aLength, RemoteFunctionCallData::TParamDirection iDir = RemoteFunctionCallData::EIn ); |
|
170 |
|
171 //Size of type aType |
|
172 virtual TInt GetTypeSize( TInt32 aParamType ) const; |
|
173 |
|
174 //Alignemnt of type aType |
|
175 virtual TInt GetTypeAlignment( TInt32 aParamType ) const; |
|
176 |
|
177 //Alignemnt of type aType |
|
178 virtual TUint32 GetAPIUid() const; |
|
179 |
|
180 static EGLint MetaGetConfigAttribute( int aIndex ); |
|
181 static EGLint MetaGetConfigAttributeSelCriteria( int aIndex ); |
|
182 static TInt MetaGetConfigAttributeCnt(); |
|
183 }; |
|
184 |
|
185 #include "eglrfc.inl" |
|
186 |
|
187 #endif |
|