os/graphics/graphicsdeviceinterface/directgdiadaptation/hwsrc/confighelper.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#ifndef CONFIGHELPER_H_
sl@0
    17
#define CONFIGHELPER_H_
sl@0
    18
sl@0
    19
#include <e32def.h>
sl@0
    20
#include <EGL/egl.h>
sl@0
    21
sl@0
    22
class CFbsBitmap;
sl@0
    23
sl@0
    24
/**
sl@0
    25
Utility class to help in choosing an EGL config.
sl@0
    26
sl@0
    27
@internalComponent Reference implementation.
sl@0
    28
*/
sl@0
    29
NONSHARABLE_CLASS(TConfigHelper)
sl@0
    30
	{
sl@0
    31
	/**
sl@0
    32
	Enumeration of EGL Config Config Attribute indices into KSurfaceAttribs.
sl@0
    33
	*/
sl@0
    34
	enum 
sl@0
    35
		{
sl@0
    36
		EEglBufferSize = 0,
sl@0
    37
		EEglBufferType = 2,
sl@0
    38
		EEglRedSize = 4,
sl@0
    39
		EEglGreenSize = 6,
sl@0
    40
		EEglBlueSize = 8,
sl@0
    41
		EEglAlphaSize = 10,
sl@0
    42
		EEglLuminanceSize = 12,
sl@0
    43
		EEglSurfaceType = 14,
sl@0
    44
		EEglRenderableType = 16,
sl@0
    45
		ELast,
sl@0
    46
		};
sl@0
    47
	
sl@0
    48
	/**
sl@0
    49
	 Enumeration of EGL Config indices into KSurfaceAttribs.
sl@0
    50
	 */
sl@0
    51
	enum
sl@0
    52
		{ 
sl@0
    53
		EPixmapAttribsColor64K,
sl@0
    54
		EPixmapAttribsColor16MAP,
sl@0
    55
		EPixmapAttribsColor16MU,
sl@0
    56
		EPixmapAttribsColor16MA,
sl@0
    57
		EPixmapAttribsLuminance8L,
sl@0
    58
		EPixmapAttribsLuminance1L      
sl@0
    59
		};
sl@0
    60
	
sl@0
    61
public:
sl@0
    62
	static TInt GetSuitablePixmapConfigIndex(EGLDisplay aDisplay, EGLConfig *aConfigs, TInt aNumConfigs, TInt aColorAttrib);
sl@0
    63
	static TInt MatchPixelType(TInt aPixelType);
sl@0
    64
	static TInt GetConfig(TInt aAttributeArrayIndex, EGLConfig& aResult);
sl@0
    65
	static TInt GetConfigForFbsBitmap(const CFbsBitmap& aBitmap, EGLConfig& aResult);
sl@0
    66
	
sl@0
    67
#ifdef _DEBUG
sl@0
    68
	static void SupportedSurfacePixelFormatsL();
sl@0
    69
#endif
sl@0
    70
sl@0
    71
private:
sl@0
    72
	static TBool EglAttributeMatches(EGLint aAttribute, TInt aExpected, TInt aActual);
sl@0
    73
	
sl@0
    74
public:
sl@0
    75
	static const EGLint KSurfaceAttribs[][19];
sl@0
    76
	};
sl@0
    77
sl@0
    78
#endif /*CONFIGHELPER_H_*/