author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 15 Sep 2010 12:29:17 +0300 | |
branch | RCL_3 |
changeset 64 | 85902f042028 |
parent 59 | 978afdc0236f |
child 72 | a5e7a4f63858 |
permissions | -rw-r--r-- |
56 | 1 |
/* |
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef HGVGEGL_H_ |
|
19 |
#define HGVGEGL_H_ |
|
20 |
||
21 |
// INCLUDES |
|
22 |
#include <e32base.h> |
|
23 |
#include <EGL/egl.h> |
|
24 |
#include <VG/openvg.h> |
|
25 |
||
26 |
class RWindow; |
|
27 |
class CFbsBitmap; |
|
28 |
||
29 |
/** |
|
30 |
* Wrapper for EGL |
|
31 |
*/ |
|
32 |
NONSHARABLE_CLASS(CHgVgEGL) : CBase |
|
33 |
{ |
|
34 |
public: |
|
35 |
||
36 |
/** |
|
37 |
* Creates new CHgVgEGL |
|
38 |
* |
|
39 |
* @param aRect window rectangle. |
|
40 |
* @return HgVgSkinRenderer-object. |
|
41 |
*/ |
|
42 |
static CHgVgEGL* NewL (RWindow& aWindow); |
|
43 |
||
44 |
// Destructor. |
|
45 |
virtual ~CHgVgEGL(); |
|
46 |
||
47 |
public: // Methods |
|
48 |
||
49 |
void InitWindowSurfaceL(RWindow& aWindow); |
|
50 |
||
51 |
void FreeWindowSurface(); |
|
52 |
||
53 |
TBool ReadyToRender() const; |
|
54 |
||
55 |
void SwapBuffers(); |
|
56 |
||
57 |
EGLDisplay Display() const; |
|
58 |
||
59 |
EGLSurface Surface() const; |
|
60 |
||
61 |
EGLContext Context() const; |
|
62 |
||
63 |
EGLConfig CurrentConfig() const; |
|
64 |
||
65 |
CFbsBitmap* GetSurfaceToBitmap(const TRect& aRect, TBool aLandscape = EFalse) const; |
|
66 |
||
59
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
67 |
static TBool EglInitialized(); |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
68 |
|
56 | 69 |
protected: // Constructors |
70 |
||
71 |
CHgVgEGL(); |
|
72 |
||
73 |
void ConstructL (RWindow& aWindow); |
|
74 |
||
75 |
void InitEGL(RWindow& aWindow); |
|
76 |
||
77 |
void DestroyEGL(); |
|
78 |
||
79 |
void InitEGLWindowSurfaceL(RWindow& aWindow); |
|
80 |
||
81 |
private: // Data |
|
82 |
||
83 |
EGLDisplay iDisplay; // handle to egl display |
|
84 |
EGLSurface iSurface; // handle to egl surface, owns |
|
85 |
EGLContext iContextVg; // handle to vgl context, owns |
|
86 |
EGLConfig iChosenConfig; // current config used to create surface. |
|
87 |
||
88 |
}; |
|
89 |
||
90 |
#endif /* HGVGSKINRENDERER */ |