Update contrib.
1 // Copyright (c) 2006-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 @internalComponent - Internal Symbian test code
22 #ifndef __GRAPHICSPERFORMANCE_REDRAWING_H__
23 #define __GRAPHICSPERFORMANCE_REDRAWING_H__
25 #include "te_graphicsperformanceSuiteStepBase.h"
27 #include <test/ttmsgraphicsstep.h>
33 // List of test cases implemented
34 // -*-* To add new test case add new enum to bottom of list
37 ETwoWindowBitblt, // Test two windows with alpha bitblited images
38 ETwoWindowBitbltMasked, // Test two windows with alpha bitblt masked images
39 ETwoWindowManyBitmapsBitblt, // Test many small bitmaps in window with invaldate small area
43 This class is an active object that receives redraw events from the windows server
45 class CWsRedrawer : public CActive
49 void ConstructL(CWsClient* aClient);
62 Window base abstract class. Derive from this class to introduce new types of windows
64 class CWindow : public CBase
67 CWindow(CWsClient* aClient, TRedrawTestCase aTestCase);
68 void ConstructL (const TRect& aRect, CWindow* aParent=0);
73 CWindowGc& SystemGc();
75 virtual void Draw(const TRect& aRect) = 0;
78 RWindow iWindow; // window server window
79 TRect iRect; // rectangle re owning window
80 CWsClient* iClient; // client including session and group
81 TRedrawTestCase iTestCase;
85 Main window used to draw background
87 class CMainWindow : public CWindow
90 CMainWindow (CWsClient* aClient, TRedrawTestCase aTestCase);
92 void ConstructL(const TRect& aRect, CWindow* aParent=0);
93 void Draw (const TRect& aRect);
96 CFbsBitmap* iBitmapImage;
100 Test window for use in test cases
102 class CTestWindow : public CWindow
105 CTestWindow(CWsClient* aClient, TRedrawTestCase aTestCase);
106 void ConstructL (const TRect& aRect, CWindow* aParent=0);
108 void Draw(const TRect& aRect);
109 void AppInitiatedDraw();
112 TBool iBitmapFlag; // Flag to indicate which image to bitblt
113 CFbsBitmap* iBitmap12bit;
114 CFbsBitmap* iAlpha8bitMask;
115 CFbsBitmap* iBitmapImage;
116 CFbsBitmap* i16x16Icon;
117 CFbsBitmap* i16x16IconMonochrome;
121 The windows server client is an active object to run the redraw test cases
123 class CWsClient : public CActive
126 CWsClient(CRedrawingTest& iTestSuite, TRedrawTestCase aTestCase);
129 CRedrawingTest& TestSuite() { return iTestSuite; }
130 RWsSession& WsSession() { return iWs; }
131 CWindowGc& Gc() { return *iGc; }
132 RWindowGroup& WindowGroup() { return iGroup; }
135 void ConstructMainWindowL();
142 // Nested class to handle test case in separate active object
143 class CRedrawingTestActive : public CActive
146 CRedrawingTestActive(CWsClient& aClient);
147 ~CRedrawingTestActive();
156 void RequestComplete();
159 void TestTwoWindowsBitBlt();
160 void TestInvalidateSmallArea();
165 TInt iIterationCount;
167 // End nested class CRedrawingTestActive
173 CWsScreenDevice* iScreen;
176 CWsRedrawer* iRedrawer;
177 CRedrawingTestActive* iTestActive;
178 TRedrawTestCase iTestCase;
179 CMainWindow* iMainWindow;
180 CTestWindow* iTestWindow;
181 CTestWindow* iTestWindow2;
182 CRedrawingTest& iTestSuite;
186 This the the test case derived from CTe_graphicsperformanceSuiteStepBase
187 It will construct the rest of the framework
189 class CRedrawingTest : public CTe_graphicsperformanceSuiteStepBase
194 inline CTProfiler& Profiler() const;
197 virtual TVerdict doTestStepPreambleL();
198 virtual TVerdict doTestStepL();
200 void RunRedrawWindowTestCaseL(const TDesC& aTestName, TRedrawTestCase aTestCase);
203 CWsClient* iWsClient;
206 _LIT(KRedrawingTest,"TRedrawing");
208 #endif //__GRAPHICSPERFORMANCE_REDRAWING_H__