os/graphics/egl/egltest/inc/egltest_surfacescaling.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2010 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
/**
sl@0
    17
 @file
sl@0
    18
 @test
sl@0
    19
*/
sl@0
    20
sl@0
    21
#ifndef EGLTEST_SURFACESCALING_H
sl@0
    22
#define EGLTEST_SURFACESCALING_H
sl@0
    23
sl@0
    24
#include "eglteststep.h"
sl@0
    25
#include <test/egltestcommonsession.h>
sl@0
    26
#include <test/graphicsscreencomparison.h>
sl@0
    27
sl@0
    28
enum TEglTestScalingConfig
sl@0
    29
	{ 
sl@0
    30
	EWindowAttribs_NoScaling,
sl@0
    31
	EWindowAttribsColor16MU_Scaling 
sl@0
    32
	};
sl@0
    33
sl@0
    34
static const EGLint KScalingConfigAttribs[2][17] =
sl@0
    35
	{
sl@0
    36
		{
sl@0
    37
		//Window - Scaling not supported
sl@0
    38
		EGL_BUFFER_SIZE,    	 0,
sl@0
    39
		EGL_RED_SIZE,			 0,
sl@0
    40
		EGL_GREEN_SIZE, 		 0,
sl@0
    41
		EGL_BLUE_SIZE,			 0,
sl@0
    42
		EGL_ALPHA_SIZE, 		 0,
sl@0
    43
		EGL_RENDERABLE_TYPE,	 EGL_OPENVG_BIT,
sl@0
    44
		EGL_SURFACE_TYPE,		 EGL_WINDOW_BIT,
sl@0
    45
		EGL_SURFACE_SCALING_NOK, EGL_FALSE,
sl@0
    46
		EGL_NONE
sl@0
    47
		},
sl@0
    48
		{
sl@0
    49
		//EColor16MU - Window - Scaling supported
sl@0
    50
		EGL_BUFFER_SIZE,    	 24,
sl@0
    51
		EGL_RED_SIZE,			 8,
sl@0
    52
		EGL_GREEN_SIZE, 		 8,
sl@0
    53
		EGL_BLUE_SIZE,			 8,
sl@0
    54
		EGL_ALPHA_SIZE,     	 0,
sl@0
    55
		EGL_RENDERABLE_TYPE,	 EGL_OPENVG_BIT,
sl@0
    56
		EGL_SURFACE_TYPE,		 EGL_WINDOW_BIT,
sl@0
    57
		EGL_SURFACE_SCALING_NOK, EGL_TRUE,
sl@0
    58
		EGL_NONE
sl@0
    59
		},
sl@0
    60
	};
sl@0
    61
sl@0
    62
//base class for all surface scaling test cases
sl@0
    63
//all common functionality should go here
sl@0
    64
NONSHARABLE_CLASS(CEglTest_SurfaceScalingBase) : public CEglTestStep
sl@0
    65
    {
sl@0
    66
public:
sl@0
    67
    ~CEglTest_SurfaceScalingBase();
sl@0
    68
sl@0
    69
protected:
sl@0
    70
    // from CTestStep
sl@0
    71
    TVerdict doTestStepPreambleL();
sl@0
    72
    TVerdict doTestStepPostambleL();
sl@0
    73
sl@0
    74
    // helper methods
sl@0
    75
    void CheckBorderColorL(EGLint aExpectedRedChannelColor, EGLint aExpectedBlueChannelColor, EGLint aExpectedGreenChannelColor);
sl@0
    76
    void CheckScalingAttributesL(EGLint aExpectedSurfaceWidth, EGLint aExpectedSurfaceHeight, EGLint aExpectedExtentWidth, EGLint aExpectedExtentHeight, EGLint aExpectedOffsetX, EGLint aExpectedOffsetY);
sl@0
    77
    CFbsBitmap* CreateBitmapLC(const TSize& aSize, TInt aBorderTop, TInt aBorderBottom, TInt aBorderLeft, TInt aBorderRight, const TRgb& aBorderColor);
sl@0
    78
    void WritePixelsToSurfaceL(const CFbsBitmap& aBitmap);
sl@0
    79
    void CreateAndActivateWindowL(const TSize& aWindowSize);
sl@0
    80
    void CloseWindow();
sl@0
    81
sl@0
    82
protected:
sl@0
    83
    CWsScreenDevice* iScreenDevice;
sl@0
    84
    RWindow iWindow;
sl@0
    85
    // surface scaling extension functions
sl@0
    86
    TFPtrEglQuerySurfaceScalingCapabilityNok iPfnEglQuerySurfaceScalingCapabilityNOK;
sl@0
    87
    TFPtrEglSetSurfaceScalingNok iPfnEglSetSurfaceScalingNOK;
sl@0
    88
    // surface scaling attributes
sl@0
    89
    TInt iWindowWidth;
sl@0
    90
    TInt iWindowHeight;
sl@0
    91
    TInt iSurfaceWidth;
sl@0
    92
    TInt iSurfaceHeight;
sl@0
    93
    TInt iExtentWidth;
sl@0
    94
    TInt iExtentHeight;
sl@0
    95
    TInt iOffsetX;
sl@0
    96
    TInt iOffsetY;
sl@0
    97
    TRgb iBorderColor;
sl@0
    98
    // surface scaling related attributes for reference bitmap
sl@0
    99
    TInt iBorderTop;
sl@0
   100
    TInt iBorderBottom;
sl@0
   101
    TInt iBorderLeft;
sl@0
   102
    TInt iBorderRight;
sl@0
   103
    // image comparison
sl@0
   104
    CTGraphicsScreenComparison* iImageComparison;
sl@0
   105
    // properties of the particular surface scaling implementation under testing
sl@0
   106
    TBool iAllScalable;
sl@0
   107
    TSize iScreenSize;
sl@0
   108
    };
sl@0
   109
sl@0
   110
sl@0
   111
// EGL Surface Scaling tests
sl@0
   112
_LIT(KSurfaceScaling_Positive, "SurfaceScaling_Positive");
sl@0
   113
NONSHARABLE_CLASS(CEglTest_SurfaceScaling_Positive) : public CEglTest_SurfaceScalingBase
sl@0
   114
    {
sl@0
   115
public:
sl@0
   116
    TVerdict doTestStepL();
sl@0
   117
    TVerdict doTestPartialStepL();
sl@0
   118
    };
sl@0
   119
sl@0
   120
_LIT(KSurfaceScaling_WindowResize, "SurfaceScaling_WindowResize");
sl@0
   121
NONSHARABLE_CLASS(CEglTest_SurfaceScaling_WindowResize) : public CEglTest_SurfaceScalingBase
sl@0
   122
    {
sl@0
   123
public:
sl@0
   124
    TVerdict doTestStepL();
sl@0
   125
    TVerdict doTestPartialStepL();
sl@0
   126
    };
sl@0
   127
sl@0
   128
_LIT(KSurfaceScaling_ExtentPositionChange, "SurfaceScaling_ExtentPositionChange");
sl@0
   129
NONSHARABLE_CLASS(CEglTest_SurfaceScaling_ExtentPositionChange) : public CEglTest_SurfaceScalingBase
sl@0
   130
    {
sl@0
   131
public:
sl@0
   132
    TVerdict doTestStepL();
sl@0
   133
    TVerdict doTestPartialStepL(const CFbsBitmap& aRefBitmap);
sl@0
   134
private:
sl@0
   135
    TInt iRefBitmapOffset;
sl@0
   136
    };
sl@0
   137
sl@0
   138
_LIT(KSurfaceScaling_ExtentSizeChange, "SurfaceScaling_ExtentSizeChange");
sl@0
   139
NONSHARABLE_CLASS(CEglTest_SurfaceScaling_ExtentSizeChange) : public CEglTest_SurfaceScalingBase
sl@0
   140
    {
sl@0
   141
public:
sl@0
   142
    TVerdict doTestStepL();
sl@0
   143
    TVerdict doTestPartialStepL();
sl@0
   144
    };
sl@0
   145
sl@0
   146
_LIT(KSurfaceScaling_SwapBuffers, "SurfaceScaling_SwapBuffers");
sl@0
   147
NONSHARABLE_CLASS(CEglTest_SurfaceScaling_SwapBuffers) : public CEglTest_SurfaceScalingBase
sl@0
   148
    {
sl@0
   149
public:
sl@0
   150
    TVerdict doTestStepL();
sl@0
   151
    TVerdict doTestPartialStepL();
sl@0
   152
    };
sl@0
   153
sl@0
   154
_LIT(KSurfaceScaling_WindowSurface_Check, "SurfaceScaling_WindowSurface_Check");
sl@0
   155
NONSHARABLE_CLASS(CEglTest_SurfaceScaling_WindowSurface_Check) : public CEglTest_SurfaceScalingBase
sl@0
   156
    {
sl@0
   157
public:
sl@0
   158
    TVerdict doTestStepL();
sl@0
   159
    };
sl@0
   160
sl@0
   161
_LIT(KSurfaceScaling_Negative_CreateWindowSurface, "SurfaceScaling_Negative_CreateWindowSurface");
sl@0
   162
NONSHARABLE_CLASS(CEglTest_SurfaceScaling_Negative_CreateWindowSurface) : public CEglTest_SurfaceScalingBase
sl@0
   163
    {
sl@0
   164
public:
sl@0
   165
    TVerdict doTestStepL();
sl@0
   166
    };
sl@0
   167
sl@0
   168
_LIT(KSurfaceScaling_Negative_FixedSize_NonWindowSurface, "SurfaceScaling_Negative_FixedSize_NonWindowSurface");
sl@0
   169
NONSHARABLE_CLASS(CEglTest_SurfaceScaling_Negative_FixedSize_NonWindowSurface) : public CEglTest_SurfaceScalingBase
sl@0
   170
    {
sl@0
   171
public:
sl@0
   172
    TVerdict doTestStepL();
sl@0
   173
    };
sl@0
   174
sl@0
   175
_LIT(KSurfaceScalingDefaultBorderColor, "SurfaceScalingDefaultBorderColor");
sl@0
   176
NONSHARABLE_CLASS(CEglTest_SurfaceScalingDefaultBorderColor) : public CEglTest_SurfaceScalingBase
sl@0
   177
    {
sl@0
   178
public:
sl@0
   179
    TVerdict doTestStepL();
sl@0
   180
    };
sl@0
   181
sl@0
   182
_LIT(KSurfaceScalingModifyingBorderColor, "SurfaceScalingModifyingBorderColor");
sl@0
   183
NONSHARABLE_CLASS(CEglTest_SurfaceScalingModifyingBorderColor) : public CEglTest_SurfaceScalingBase
sl@0
   184
    {
sl@0
   185
public:
sl@0
   186
    TVerdict doTestStepL();
sl@0
   187
    };
sl@0
   188
sl@0
   189
_LIT(KSurfaceScalingModifyingBorderColorNonFixed, "SurfaceScalingModifyingBorderColorNonFixed");
sl@0
   190
NONSHARABLE_CLASS(CEglTest_SurfaceScalingModifyingBorderColorNonFixed) : public CEglTest_SurfaceScalingBase
sl@0
   191
    {
sl@0
   192
public:
sl@0
   193
	TVerdict doTestStepL();
sl@0
   194
    };
sl@0
   195
sl@0
   196
_LIT(KSurfaceScalingModifyingInvalidBorderColor, "SurfaceScalingModifyingInvalidBorderColor");
sl@0
   197
NONSHARABLE_CLASS(CEglTest_SurfaceScalingModifyingInvalidBorderColor) : public CEglTest_SurfaceScalingBase
sl@0
   198
    {
sl@0
   199
public:
sl@0
   200
    TVerdict doTestStepL();
sl@0
   201
    };
sl@0
   202
sl@0
   203
_LIT(KSurfaceScalingModifyingExtent, "SurfaceScalingModifyingExtent");
sl@0
   204
NONSHARABLE_CLASS(CEglTest_SurfaceScalingModifyingExtent) : public CEglTest_SurfaceScalingBase
sl@0
   205
    {
sl@0
   206
public:
sl@0
   207
    TVerdict doTestStepL();
sl@0
   208
    };
sl@0
   209
sl@0
   210
_LIT(KSurfaceScalingModifyingExtentNonFixed, "SurfaceScalingModifyingExtentNonFixed");
sl@0
   211
NONSHARABLE_CLASS(CEglTest_SurfaceScalingModifyingExtentNonFixed) : public CEglTest_SurfaceScalingBase
sl@0
   212
    {
sl@0
   213
public:
sl@0
   214
    TVerdict doTestStepL();
sl@0
   215
    };
sl@0
   216
sl@0
   217
_LIT(KSurfaceScalingQuerySurface, "SurfaceScalingQuerySurface");
sl@0
   218
NONSHARABLE_CLASS(CEglTest_SurfaceScalingQuerySurface) : public CEglTest_SurfaceScalingBase
sl@0
   219
    {
sl@0
   220
public:
sl@0
   221
    TVerdict doTestStepL();
sl@0
   222
    };
sl@0
   223
sl@0
   224
_LIT(KSurfaceScalingQuerySurfaceNonFixed, "SurfaceScalingQuerySurfaceNonFixed");
sl@0
   225
NONSHARABLE_CLASS(CEglTest_SurfaceScalingQuerySurfaceNonFixed) : public CEglTest_SurfaceScalingBase
sl@0
   226
    {
sl@0
   227
public:
sl@0
   228
    TVerdict doTestStepL();
sl@0
   229
    };
sl@0
   230
sl@0
   231
_LIT(KSurfaceScalingCapability, "SurfaceScalingCapability");
sl@0
   232
NONSHARABLE_CLASS(CEglTest_SurfaceScalingCapability) : public CEglTest_SurfaceScalingBase
sl@0
   233
    {
sl@0
   234
public:
sl@0
   235
    TVerdict doTestStepL();
sl@0
   236
    };
sl@0
   237
sl@0
   238
_LIT(KSurfaceScalingSet, "SurfaceScalingSet");
sl@0
   239
NONSHARABLE_CLASS(CEglTest_SurfaceScalingSet) : public CEglTest_SurfaceScalingBase
sl@0
   240
    {
sl@0
   241
public:
sl@0
   242
    TVerdict doTestStepL();
sl@0
   243
    };
sl@0
   244
sl@0
   245
_LIT(KSurfaceScalingSetNonFixed, "SurfaceScalingSetNonFixed");
sl@0
   246
NONSHARABLE_CLASS(CEglTest_SurfaceScalingSetNonFixed) : public CEglTest_SurfaceScalingBase
sl@0
   247
    {
sl@0
   248
public:
sl@0
   249
    TVerdict doTestStepL();
sl@0
   250
    };
sl@0
   251
sl@0
   252
_LIT(KSurfaceScalingSetInvalidAttributes, "SurfaceScalingSetInvalidAttributes");
sl@0
   253
NONSHARABLE_CLASS(CEglTest_SurfaceScalingSetInvalidAttributes) : public CEglTest_SurfaceScalingBase
sl@0
   254
    {
sl@0
   255
public:
sl@0
   256
    TVerdict doTestStepL();
sl@0
   257
    };
sl@0
   258
sl@0
   259
_LIT(KSurfaceScalingNotInitialized, "SurfaceScalingNotInitialized");
sl@0
   260
NONSHARABLE_CLASS(CEglTest_SurfaceScalingNotInitialized) : public CEglTest_SurfaceScalingBase
sl@0
   261
    {
sl@0
   262
public:
sl@0
   263
    TVerdict doTestStepL();
sl@0
   264
    };
sl@0
   265
sl@0
   266
#endif // EGLTEST_SURFACESCALING_H