First public contribution.
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_STRESS_COMMON_SGIMAGE_H__
22 #define __EGLTEST_STRESS_COMMON_SGIMAGE_H__
24 #include <test/egltestcommonsgimageinfo.h>
25 #include <test/egltestcommonprocess.h>
27 #define EGL_LEAVE_ERROR(PASS) { if (!(PASS)) { User::Leave (eglGetError()); } }
28 #define EGL_LEAVE_NULL(RET, FUNC) { EGLint res = FUNC; if(!(res)){ User::Leave (eglGetError()); } else{RET = res;} }
30 _LIT(KTestType, "TestType");
31 _LIT(KEglStressTest, "EglStressTest Semaphore");
32 const TInt KTestStressUnexpectedPixelError = -911;
35 //Use to pass RSGImage ID to the child processes
36 const TInt KMultiProcessSlot = 1;
38 //Supported formats for these stress tests
39 const TUint32 KColourInitial32 = 0xFF80A0C0;
40 const TUint32 KColourFinal32 = 0xFFC0407F;
41 const TUint16 KColourInitial16 = 0x2408;
42 const TUint16 KColourFinal16 = 0x6144;
44 const TInt KNumberOfFrames = 100;
46 void ChooseConfigAndCreateContextL(EGLDisplay& aDisplay, EGLContext& aContext, EGLConfig& aConfig, const RSgImage& aSgImage, const TDesC& aPanicString, TBool aPreMultAlpha);
47 EGLSurface CreatePixmapSurfaceL(EGLDisplay aDisplay, EGLConfig aConfig, const RSgImage& aSgImage, TBool aAlphaPre);
48 void GenerateVgImageL(const EGLDisplay aDisplay, RSgImage* aImage, VGImage& aVgImage);
49 void VgLeaveIfErrorL();
51 typedef enum TTestType
54 EStressReadWriteSingleImage,
55 EStressReadWriteMultiImage,
60 struct TStressProcessInfo
68 class CTReadWrite : public CTimer
74 CTReadWrite(TInt aWidth, TInt aHeight, TInt aByteSize, VGImageFormat aFormat, const TTestType& aTestType, TBool& aTestPass);
78 void ReadWriteImageL();
79 void PixmapSurfaceL();
80 virtual void ReadImageFuncL() = 0;
81 virtual void ReadFuncL() = 0;
82 virtual void WriteImageFuncL() = 0;
83 virtual void VgImageFuncL() = 0;
84 virtual void MakeCurrentL() const = 0;
85 virtual TBool IsFinished() = 0;
86 virtual void PixmapSurfaceFuncL() = 0;
95 VGImageFormat iFormat;
98 TUint32 iInitialColour;
105 #endif //__EGLTEST_STRESS_COMMON_SGIMAGE_H__