os/graphics/egl/egltest/inc/egltest_oom_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-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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 /**
    17  @file
    18  @test
    19 */
    20 #ifndef __EGLTEST_OOM_SGIMAGE_H__
    21 #define __EGLTEST_OOM_SGIMAGE_H__
    22 
    23 #include "eglteststep.h"
    24 
    25 
    26 NONSHARABLE_CLASS(CEglTest_OOM_Base) : public CEglTestStep
    27     {
    28 public:
    29     ~CEglTest_OOM_Base();
    30 
    31 protected:
    32     void CleanGraphicsResources();
    33     void CheckDeviation();
    34     void RetrieveExtensionDataL();
    35     void SendIndexToMainProcessL(TInt aIndex);
    36     // from CTestStep
    37     TVerdict doTestStepPreambleL();
    38     TVerdict doTestStepPostambleL();
    39     //from CEglTestStep
    40     virtual void ReceiveMessageFromClient(RMsgQueue<TEglStepMessageBuffer>& aMessageQueueClientProcParam);
    41     
    42 private:
    43     TInt Deviation(const RArray<TInt>& aArray) const;
    44     void GetMinMax(const RArray<TInt>& aArray, TInt& aMin, TInt& aMax) const;
    45     void PrintEglResourceProfilingInfoL(); // if NOK_resource_profiling2 extension is 
    46                                           //available it outputs to the log file GPU memory usage
    47 
    48 protected:
    49     TInt iNumIterations;
    50     TSize iImageSize;
    51     TUidPixelFormat iPixelFormat;
    52     RArray<EGLSurface> iSurfaces;
    53     RArray<EGLImageKHR> iEglImages;
    54     RArray<VGImage> iVgImages;
    55     RArray<RSgImage> iSgImages;
    56     
    57     TInt iLastIterationNumber;
    58 private:
    59     RArray<TInt> iGPUUsedMemory;
    60     RArray<TInt> iLastIterations;
    61     
    62     //Deviation in percentage between max and min of GPU memory 
    63     //retrieved at the end of each attempt through NOK_resource_profiling2 egl extension inteface
    64     TInt iThresholdGPUUsedMemory;
    65 
    66     //Deviation in percentage between max and min of successful iteration number 
    67     //retrieved at the end of each attempt 
    68     TInt iThresholdLastIteration;
    69     
    70 #ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
    71 #ifdef EGL_PROF_MEMORY_USAGE_THRESHOLD_NOK    
    72     PFNEGLQUERYPROFILINGDATANOKPROC iPFnEglQueryProfilingDataNOK;
    73 #endif    
    74 #endif    
    75     };
    76 
    77 _LIT(KOOM_CloseVGImageWithTermination, "OOM_CloseVGImageWithTermination");
    78 NONSHARABLE_CLASS(CEglTest_OOM_CloseVGImageWithTermination) : public CEglTest_OOM_Base
    79     {
    80 public:
    81     // from CTestStep
    82     TVerdict doTestStepL();
    83     
    84 protected:
    85     // from CEglTestStep
    86     void doProcessFunctionL(TInt aIdx);
    87    };
    88 
    89 _LIT(KOOM_CloseVGImage, "OOM_CloseVGImage");
    90 NONSHARABLE_CLASS(CEglTest_OOM_CloseVGImage) : public CEglTest_OOM_Base
    91     {
    92 public:
    93     // from CTestStep
    94     TVerdict doTestStepL();
    95     
    96 protected:
    97     // from CEglTestStep
    98     void doProcessFunctionL(TInt aIdx);
    99    };
   100 
   101 _LIT(KOOM_ClosePixmapSurfaceWithTermination, "OOM_ClosePixmapSurfaceWithTermination");
   102 NONSHARABLE_CLASS(CEglTest_OOM_ClosePixmapSurfaceWithTermination) : public CEglTest_OOM_Base
   103     {
   104 public:
   105     // from CTestStep
   106     TVerdict doTestStepL();
   107     
   108 protected:
   109     // from CEglTestStep
   110     void doProcessFunctionL(TInt aIdx);
   111    };
   112 
   113 _LIT(KOOM_ClosePixmapSurface, "OOM_ClosePixmapSurface");
   114 NONSHARABLE_CLASS(CEglTest_OOM_ClosePixmapSurface) : public CEglTest_OOM_Base
   115     {
   116 public:
   117     // from CTestStep
   118     TVerdict doTestStepL();
   119     
   120 protected:
   121     // from CEglTestStep
   122     void doProcessFunctionL(TInt aIdx);
   123    };
   124 
   125 _LIT(KOOM_CloseSgImageDifferentProcess, "OOM_CloseSgImageDifferentProcess");
   126 NONSHARABLE_CLASS(CEglTest_OOM_CloseSgImageDifferentProcess) : public CEglTest_OOM_Base
   127     {
   128 public:
   129     // from CTestStep
   130     TVerdict doTestStepL();
   131     
   132 protected:
   133     // from CEglTestStep
   134     void doProcessFunctionL(TInt aIdx);
   135    };
   136 
   137 _LIT(KOOM_CloseSgImageSameThread, "OOM_CloseSgImageSameThread");
   138 NONSHARABLE_CLASS(CEglTest_OOM_CloseSgImageSameThread) : public CEglTest_OOM_Base
   139     {
   140 public:
   141     // from CTestStep
   142     TVerdict doTestStepL();
   143     };
   144 
   145 #endif // __EGLTEST_OOM_SGIMAGE_H__