os/graphics/egl/egltest/inc/egltest_stress_sgimage.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 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 /**
    17  @file
    18  @test
    19 */
    20 
    21 #ifndef __EGLTEST_STRESS_SGIMAGE_H__
    22 #define __EGLTEST_STRESS_SGIMAGE_H__
    23 
    24 #include <VG/openvg.h>
    25 #include <test/egltestcommonstep.h>
    26 #include "egltest_stress_common_sgimage.h"
    27 
    28 //Test step names
    29 _LIT(KStressPixmapSurface, "StressPixmapSurface");
    30 _LIT(KStressVGImage, "StressVGImage");
    31 _LIT(KStressReadOnly, "StressReadOnly");
    32 _LIT(KEStressReadWriteSingleImage, "StressReadWriteSingleImage");
    33 _LIT(KStressReadWriteMultiImage, "StressReadWriteMultiImage");
    34 
    35 //ini file parameters
    36 _LIT(KPixelFormat, "PixelFormat");
    37 _LIT(KNumberRSgImages, "NumberRSgImages");
    38 _LIT(KNumberChildProcesses, "NumberChildProcesses");
    39 _LIT(KNumberMainImages, "NumberMainImages");
    40 _LIT(KRSgImageWidth, "RSgImageWidth");
    41 _LIT(KRSgImageHeight, "RSgImageHeight");
    42 
    43 //default section for sim load app ini file
    44 _LIT(KDefaultSectionName,"default");
    45 
    46 //supported pixel formats for these test cases
    47 _LIT(KUidPixelFormatARGB_8888, "PixelFormatARGB_8888");
    48 _LIT(KUidPixelFormatARGB_8888_PRE, "PixelFormatARGB_8888_PRE");
    49 _LIT(KUidPixelFormatRGB_565, "PixelFormatRGB_565");
    50 
    51 //Child application
    52 _LIT(KStressTestClientApp, "z:\\sys\\bin\\eglteststressprocesssgimage.exe");
    53 
    54 //Panic string
    55 _LIT(KStressTestMainAppPanic, "Stress Test Main App");
    56 
    57 _LIT(KStress, "Stress");
    58 NONSHARABLE_CLASS(CEglTest_Stress) : public CEglTestStep
    59     {
    60 public:
    61     ~CEglTest_Stress();
    62     TVerdict doTestStepL();
    63 
    64 private:
    65     void PaintSurfaceL(EGLDisplay aDisplay, EGLSurface aSurface, EGLContext aContext);
    66     void CreateChildProcessL(TInt aProcessNumber,  TTestType aTestType, TSgDrawableId aDrawableId);
    67     void CreateChildProcessesL();
    68     void ClearDownArraysL(EGLDisplay aDisplay);
    69     void CreateSimLoadAppL();
    70     void CreateSimLoadProcessL(const TDesC& aApp);
    71     void DestroySimLoadProcess();
    72     void ReadIniValueL(const TDesC& aSectName, const TDesC& aKeyName, TInt& aResult);
    73     void ReadIniValuesL();
    74     void PrintConfigDataL();
    75     void DeleteConfigData();
    76 
    77 private:
    78     TPtrC iPixelFormat;
    79     TInt iNumberRSgImages;
    80     TInt iNumberChildProcesses;
    81     TInt iNumberMainImages;
    82     TInt iRSgImageWidth;
    83     TInt iRSgImageHeight;
    84     TInt iSimLoadValue;
    85     TInt iByteSize;
    86     TUidPixelFormat iFormat;
    87     VGImageFormat iVgFormat;
    88     TBool iAlphaPre;
    89     TTestType iTestType;
    90     RArray<RSgImage> iSgImageArray;
    91     RArray<VGImage> iVGImageArray;
    92     RArray<EGLSurface> iSurfaceArray;
    93     RArray<RProcess> iProcessArray;
    94     RArray<RProcess> iProcessList;
    95     RFs iFs;
    96 };
    97 
    98 class CTReadWriteMain : public CTReadWrite
    99     {
   100 public:
   101     static CTReadWriteMain* NewL(EGLDisplay aDisplay, EGLSurface aSurface, EGLContext aContext, TInt aWidth, TInt aHeight, TInt aByteSize, VGImageFormat aFormat, TBool& aTestPass, TInt& aFinishedCounter, const TTestType& aTestType, VGImage aVGImage = 0);
   102 
   103 private:
   104     CTReadWriteMain(EGLDisplay aDisplay, EGLSurface aSurface, EGLContext aContext, TInt aWidth, TInt aHeight, TInt aByteSize, VGImageFormat aFormat, TBool& aTestPass, TInt& aFinishedCounter, const TTestType& aTestType);
   105     void ConstructL(VGImage aVGImage);
   106     void ReadImageFuncL();
   107     void ReadFuncL();
   108     void WriteImageFuncL();
   109     void VgImageFuncL();
   110     void MakeCurrentL() const;
   111     TBool IsFinished();
   112     void PixmapSurfaceFuncL();
   113 
   114 private:
   115     EGLDisplay iDisplay;
   116     EGLSurface iSurface;
   117     EGLContext iContext;
   118     TInt& iFinishedCounter;
   119     VGImage iVGImage;
   120     };
   121 
   122 #endif //__EGLTEST_STRESS_SGIMAGE_H__