|
1 // Copyright (c) 2008-2009 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 CONFIGHELPER_H_ |
|
17 #define CONFIGHELPER_H_ |
|
18 |
|
19 #include <e32def.h> |
|
20 #include <EGL/egl.h> |
|
21 |
|
22 class CFbsBitmap; |
|
23 |
|
24 /** |
|
25 Utility class to help in choosing an EGL config. |
|
26 |
|
27 @internalComponent Reference implementation. |
|
28 */ |
|
29 NONSHARABLE_CLASS(TConfigHelper) |
|
30 { |
|
31 /** |
|
32 Enumeration of EGL Config Config Attribute indices into KSurfaceAttribs. |
|
33 */ |
|
34 enum |
|
35 { |
|
36 EEglBufferSize = 0, |
|
37 EEglBufferType = 2, |
|
38 EEglRedSize = 4, |
|
39 EEglGreenSize = 6, |
|
40 EEglBlueSize = 8, |
|
41 EEglAlphaSize = 10, |
|
42 EEglLuminanceSize = 12, |
|
43 EEglSurfaceType = 14, |
|
44 EEglRenderableType = 16, |
|
45 ELast, |
|
46 }; |
|
47 |
|
48 /** |
|
49 Enumeration of EGL Config indices into KSurfaceAttribs. |
|
50 */ |
|
51 enum |
|
52 { |
|
53 EPixmapAttribsColor64K, |
|
54 EPixmapAttribsColor16MAP, |
|
55 EPixmapAttribsColor16MU, |
|
56 EPixmapAttribsColor16MA, |
|
57 EPixmapAttribsLuminance8L, |
|
58 EPixmapAttribsLuminance1L |
|
59 }; |
|
60 |
|
61 public: |
|
62 static TInt GetSuitablePixmapConfigIndex(EGLDisplay aDisplay, EGLConfig *aConfigs, TInt aNumConfigs, TInt aColorAttrib); |
|
63 static TInt MatchPixelType(TInt aPixelType); |
|
64 static TInt GetConfig(TInt aAttributeArrayIndex, EGLConfig& aResult); |
|
65 static TInt GetConfigForFbsBitmap(const CFbsBitmap& aBitmap, EGLConfig& aResult); |
|
66 |
|
67 #ifdef _DEBUG |
|
68 static void SupportedSurfacePixelFormatsL(); |
|
69 #endif |
|
70 |
|
71 private: |
|
72 static TBool EglAttributeMatches(EGLint aAttribute, TInt aExpected, TInt aActual); |
|
73 |
|
74 public: |
|
75 static const EGLint KSurfaceAttribs[][19]; |
|
76 }; |
|
77 |
|
78 #endif /*CONFIGHELPER_H_*/ |