Update contrib.
1 // Copyright (c) 2010 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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
21 #ifndef EGLTEST_SURFACESCALING_H
22 #define EGLTEST_SURFACESCALING_H
24 #include "eglteststep.h"
25 #include <test/egltestcommonsession.h>
26 #include <test/graphicsscreencomparison.h>
28 enum TEglTestScalingConfig
30 EWindowAttribs_NoScaling,
31 EWindowAttribsColor16MU_Scaling
34 static const EGLint KScalingConfigAttribs[2][17] =
37 //Window - Scaling not supported
43 EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT,
44 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
45 EGL_SURFACE_SCALING_NOK, EGL_FALSE,
49 //EColor16MU - Window - Scaling supported
55 EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT,
56 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
57 EGL_SURFACE_SCALING_NOK, EGL_TRUE,
62 //base class for all surface scaling test cases
63 //all common functionality should go here
64 NONSHARABLE_CLASS(CEglTest_SurfaceScalingBase) : public CEglTestStep
67 ~CEglTest_SurfaceScalingBase();
71 TVerdict doTestStepPreambleL();
72 TVerdict doTestStepPostambleL();
75 void CheckBorderColorL(EGLint aExpectedRedChannelColor, EGLint aExpectedBlueChannelColor, EGLint aExpectedGreenChannelColor);
76 void CheckScalingAttributesL(EGLint aExpectedSurfaceWidth, EGLint aExpectedSurfaceHeight, EGLint aExpectedExtentWidth, EGLint aExpectedExtentHeight, EGLint aExpectedOffsetX, EGLint aExpectedOffsetY);
77 CFbsBitmap* CreateBitmapLC(const TSize& aSize, TInt aBorderTop, TInt aBorderBottom, TInt aBorderLeft, TInt aBorderRight, const TRgb& aBorderColor);
78 void WritePixelsToSurfaceL(const CFbsBitmap& aBitmap);
79 void CreateAndActivateWindowL(const TSize& aWindowSize);
83 CWsScreenDevice* iScreenDevice;
85 // surface scaling extension functions
86 TFPtrEglQuerySurfaceScalingCapabilityNok iPfnEglQuerySurfaceScalingCapabilityNOK;
87 TFPtrEglSetSurfaceScalingNok iPfnEglSetSurfaceScalingNOK;
88 // surface scaling attributes
98 // surface scaling related attributes for reference bitmap
104 CTGraphicsScreenComparison* iImageComparison;
105 // properties of the particular surface scaling implementation under testing
111 // EGL Surface Scaling tests
112 _LIT(KSurfaceScaling_Positive, "SurfaceScaling_Positive");
113 NONSHARABLE_CLASS(CEglTest_SurfaceScaling_Positive) : public CEglTest_SurfaceScalingBase
116 TVerdict doTestStepL();
117 TVerdict doTestPartialStepL();
120 _LIT(KSurfaceScaling_WindowResize, "SurfaceScaling_WindowResize");
121 NONSHARABLE_CLASS(CEglTest_SurfaceScaling_WindowResize) : public CEglTest_SurfaceScalingBase
124 TVerdict doTestStepL();
125 TVerdict doTestPartialStepL();
128 _LIT(KSurfaceScaling_ExtentPositionChange, "SurfaceScaling_ExtentPositionChange");
129 NONSHARABLE_CLASS(CEglTest_SurfaceScaling_ExtentPositionChange) : public CEglTest_SurfaceScalingBase
132 TVerdict doTestStepL();
133 TVerdict doTestPartialStepL(const CFbsBitmap& aRefBitmap);
135 TInt iRefBitmapOffset;
138 _LIT(KSurfaceScaling_ExtentSizeChange, "SurfaceScaling_ExtentSizeChange");
139 NONSHARABLE_CLASS(CEglTest_SurfaceScaling_ExtentSizeChange) : public CEglTest_SurfaceScalingBase
142 TVerdict doTestStepL();
143 TVerdict doTestPartialStepL();
146 _LIT(KSurfaceScaling_SwapBuffers, "SurfaceScaling_SwapBuffers");
147 NONSHARABLE_CLASS(CEglTest_SurfaceScaling_SwapBuffers) : public CEglTest_SurfaceScalingBase
150 TVerdict doTestStepL();
151 TVerdict doTestPartialStepL();
154 _LIT(KSurfaceScaling_WindowSurface_Check, "SurfaceScaling_WindowSurface_Check");
155 NONSHARABLE_CLASS(CEglTest_SurfaceScaling_WindowSurface_Check) : public CEglTest_SurfaceScalingBase
158 TVerdict doTestStepL();
161 _LIT(KSurfaceScaling_Negative_CreateWindowSurface, "SurfaceScaling_Negative_CreateWindowSurface");
162 NONSHARABLE_CLASS(CEglTest_SurfaceScaling_Negative_CreateWindowSurface) : public CEglTest_SurfaceScalingBase
165 TVerdict doTestStepL();
168 _LIT(KSurfaceScaling_Negative_FixedSize_NonWindowSurface, "SurfaceScaling_Negative_FixedSize_NonWindowSurface");
169 NONSHARABLE_CLASS(CEglTest_SurfaceScaling_Negative_FixedSize_NonWindowSurface) : public CEglTest_SurfaceScalingBase
172 TVerdict doTestStepL();
175 _LIT(KSurfaceScalingDefaultBorderColor, "SurfaceScalingDefaultBorderColor");
176 NONSHARABLE_CLASS(CEglTest_SurfaceScalingDefaultBorderColor) : public CEglTest_SurfaceScalingBase
179 TVerdict doTestStepL();
182 _LIT(KSurfaceScalingModifyingBorderColor, "SurfaceScalingModifyingBorderColor");
183 NONSHARABLE_CLASS(CEglTest_SurfaceScalingModifyingBorderColor) : public CEglTest_SurfaceScalingBase
186 TVerdict doTestStepL();
189 _LIT(KSurfaceScalingModifyingBorderColorNonFixed, "SurfaceScalingModifyingBorderColorNonFixed");
190 NONSHARABLE_CLASS(CEglTest_SurfaceScalingModifyingBorderColorNonFixed) : public CEglTest_SurfaceScalingBase
193 TVerdict doTestStepL();
196 _LIT(KSurfaceScalingModifyingInvalidBorderColor, "SurfaceScalingModifyingInvalidBorderColor");
197 NONSHARABLE_CLASS(CEglTest_SurfaceScalingModifyingInvalidBorderColor) : public CEglTest_SurfaceScalingBase
200 TVerdict doTestStepL();
203 _LIT(KSurfaceScalingModifyingExtent, "SurfaceScalingModifyingExtent");
204 NONSHARABLE_CLASS(CEglTest_SurfaceScalingModifyingExtent) : public CEglTest_SurfaceScalingBase
207 TVerdict doTestStepL();
210 _LIT(KSurfaceScalingModifyingExtentNonFixed, "SurfaceScalingModifyingExtentNonFixed");
211 NONSHARABLE_CLASS(CEglTest_SurfaceScalingModifyingExtentNonFixed) : public CEglTest_SurfaceScalingBase
214 TVerdict doTestStepL();
217 _LIT(KSurfaceScalingQuerySurface, "SurfaceScalingQuerySurface");
218 NONSHARABLE_CLASS(CEglTest_SurfaceScalingQuerySurface) : public CEglTest_SurfaceScalingBase
221 TVerdict doTestStepL();
224 _LIT(KSurfaceScalingQuerySurfaceNonFixed, "SurfaceScalingQuerySurfaceNonFixed");
225 NONSHARABLE_CLASS(CEglTest_SurfaceScalingQuerySurfaceNonFixed) : public CEglTest_SurfaceScalingBase
228 TVerdict doTestStepL();
231 _LIT(KSurfaceScalingCapability, "SurfaceScalingCapability");
232 NONSHARABLE_CLASS(CEglTest_SurfaceScalingCapability) : public CEglTest_SurfaceScalingBase
235 TVerdict doTestStepL();
238 _LIT(KSurfaceScalingSet, "SurfaceScalingSet");
239 NONSHARABLE_CLASS(CEglTest_SurfaceScalingSet) : public CEglTest_SurfaceScalingBase
242 TVerdict doTestStepL();
245 _LIT(KSurfaceScalingSetNonFixed, "SurfaceScalingSetNonFixed");
246 NONSHARABLE_CLASS(CEglTest_SurfaceScalingSetNonFixed) : public CEglTest_SurfaceScalingBase
249 TVerdict doTestStepL();
252 _LIT(KSurfaceScalingSetInvalidAttributes, "SurfaceScalingSetInvalidAttributes");
253 NONSHARABLE_CLASS(CEglTest_SurfaceScalingSetInvalidAttributes) : public CEglTest_SurfaceScalingBase
256 TVerdict doTestStepL();
259 _LIT(KSurfaceScalingNotInitialized, "SurfaceScalingNotInitialized");
260 NONSHARABLE_CLASS(CEglTest_SurfaceScalingNotInitialized) : public CEglTest_SurfaceScalingBase
263 TVerdict doTestStepL();
266 #endif // EGLTEST_SURFACESCALING_H