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