|
24
|
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 |
|
|
|
16 |
#ifndef EGLAPIWRAPPER_H
|
|
|
17 |
#define EGLAPIWRAPPER_H
|
|
|
18 |
|
|
|
19 |
#ifndef PSU_PLATFORMTYPES_H
|
|
|
20 |
#include "platformtypes.h"
|
|
|
21 |
#endif
|
|
|
22 |
|
|
|
23 |
#include <map>
|
|
|
24 |
|
|
|
25 |
#include "eglrfc.h"
|
|
|
26 |
#include "apiwrapper.h"
|
|
|
27 |
#include "egltypes.h"
|
|
|
28 |
|
|
|
29 |
class KhronosAPIWrapper;
|
|
|
30 |
|
|
|
31 |
|
|
|
32 |
struct TSurfaceKey
|
|
|
33 |
{
|
|
|
34 |
public:
|
|
|
35 |
int iDpy;
|
|
|
36 |
int iSurfaceId;
|
|
|
37 |
TUint64 iProcId;
|
|
|
38 |
public:
|
|
|
39 |
TSurfaceKey( int aDpy, int aSurfaceId, TUint32 aProcId ) : iDpy( aDpy ), iSurfaceId( aSurfaceId ), iProcId( aProcId )
|
|
|
40 |
{
|
|
|
41 |
}
|
|
|
42 |
|
|
|
43 |
void set( int aDpy, int aSurfaceId, TUint32 aProcId )
|
|
|
44 |
{
|
|
|
45 |
iDpy = aDpy; iSurfaceId = aSurfaceId; iProcId = aProcId;
|
|
|
46 |
}
|
|
|
47 |
|
|
|
48 |
bool operator<(const TSurfaceKey& aOtherKey) const
|
|
|
49 |
{
|
|
|
50 |
if( iDpy != aOtherKey.iDpy ) { return iDpy < aOtherKey.iDpy; }
|
|
|
51 |
else if( iSurfaceId != aOtherKey.iSurfaceId ) { return iSurfaceId < aOtherKey.iSurfaceId; }
|
|
|
52 |
else if( iProcId!= aOtherKey.iProcId ) { return iProcId < aOtherKey.iProcId; }
|
|
|
53 |
else {return false; }
|
|
|
54 |
}
|
|
|
55 |
};
|
|
|
56 |
|
|
|
57 |
struct TSurfaceData
|
|
|
58 |
{
|
|
|
59 |
public:
|
|
|
60 |
SymbianWindow* iWindow;
|
|
|
61 |
//sgImage-related data here later on
|
|
|
62 |
public:
|
|
|
63 |
TSurfaceData( SymbianWindow* aWindow ) : iWindow( aWindow )
|
|
|
64 |
{
|
|
|
65 |
}
|
|
|
66 |
};
|
|
|
67 |
/**
|
|
|
68 |
* This maps surfaces to their native symbian windows, and other metadata
|
|
|
69 |
*
|
|
|
70 |
*/
|
|
|
71 |
typedef std::map< TSurfaceKey, TSurfaceData > TSurfaceMap;
|
|
|
72 |
|
|
|
73 |
class MGraphicsVHWCallback;
|
|
|
74 |
|
|
|
75 |
class EGLAPIWrapper: public APIWrapper
|
|
|
76 |
{
|
|
|
77 |
public:
|
|
|
78 |
|
|
|
79 |
EGLAPIWrapper( RemoteFunctionCallData& currentFunctionCallData, APIWrapperStack* stack,
|
|
|
80 |
void* result,
|
|
|
81 |
MGraphicsVHWCallback* serviceIf,
|
|
|
82 |
void* framebuffer, KhronosAPIWrapper* aAPIWrapper );
|
|
|
83 |
|
|
|
84 |
int WriteReply();
|
|
|
85 |
int DispatchRequest( unsigned long aCode );
|
|
|
86 |
void SetProcessInformation( TUint32 aProcess, TUint32 aThread );
|
|
|
87 |
void Cleanup( TUint32 aProcess, TUint32 aThread );
|
|
|
88 |
|
|
|
89 |
private:
|
|
|
90 |
|
|
|
91 |
int eglGetError();
|
|
|
92 |
int eglGetDisplay();
|
|
|
93 |
int eglInitialize();
|
|
|
94 |
int eglTerminate();
|
|
|
95 |
int eglQueryString();
|
|
|
96 |
int eglGetConfigs();
|
|
|
97 |
int eglChooseConfig();
|
|
|
98 |
int eglGetConfigAttrib();
|
|
|
99 |
int eglCreateWindowSurface();
|
|
|
100 |
int eglCreatePbufferSurface();
|
|
|
101 |
int eglCreatePixmapSurface();
|
|
|
102 |
int eglDestroySurface();
|
|
|
103 |
int eglQuerySurface();
|
|
|
104 |
int eglBindAPI();
|
|
|
105 |
int eglQueryAPI();
|
|
|
106 |
int eglWaitClient();
|
|
|
107 |
int eglReleaseThread();
|
|
|
108 |
int eglCreatePbufferFromClientBuffer();
|
|
|
109 |
int eglSurfaceAttrib();
|
|
|
110 |
int eglBindTexImage();
|
|
|
111 |
int eglReleaseTexImage();
|
|
|
112 |
int eglSwapInterval();
|
|
|
113 |
int eglCreateContext();
|
|
|
114 |
int eglDestroyContext();
|
|
|
115 |
int eglMakeCurrent();
|
|
|
116 |
int eglGetCurrentContext();
|
|
|
117 |
int eglGetCurrentSurface();
|
|
|
118 |
int eglGetCurrentDisplay();
|
|
|
119 |
int eglQueryContext();
|
|
|
120 |
int eglWaitGL();
|
|
|
121 |
int eglWaitNative();
|
|
|
122 |
int eglSwapBuffers();
|
|
|
123 |
int eglCopyBuffers();
|
|
|
124 |
int eglPlatsimSetSurfaceParams();
|
|
|
125 |
int eglPlatsimCopyImageData();
|
|
|
126 |
int eglPixmapSurfaceSizeChanged();
|
|
|
127 |
|
|
|
128 |
private://Meta calls
|
|
|
129 |
int eglMetaGetConfigs();
|
|
|
130 |
|
|
|
131 |
private:
|
|
|
132 |
int m_lastEglError;
|
|
|
133 |
EglRFC m_currentFunctionCall;
|
|
|
134 |
void* m_frameBuffer;
|
|
|
135 |
TSurfaceMap m_windowMap;
|
|
|
136 |
KhronosAPIWrapper* m_APIWrapper;
|
|
|
137 |
};
|
|
|
138 |
#endif
|