|
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 |
|
67 protected: // Constructors |
|
68 |
|
69 CHgVgEGL(); |
|
70 |
|
71 void ConstructL (RWindow& aWindow); |
|
72 |
|
73 void InitEGL(RWindow& aWindow); |
|
74 |
|
75 void DestroyEGL(); |
|
76 |
|
77 void InitEGLWindowSurfaceL(RWindow& aWindow); |
|
78 |
|
79 private: // Data |
|
80 |
|
81 EGLDisplay iDisplay; // handle to egl display |
|
82 EGLSurface iSurface; // handle to egl surface, owns |
|
83 EGLContext iContextVg; // handle to vgl context, owns |
|
84 EGLConfig iChosenConfig; // current config used to create surface. |
|
85 |
|
86 }; |
|
87 |
|
88 #endif /* HGVGSKINRENDERER */ |