First public contribution.
1 // Copyright (c) 2007-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.
14 // TCrpAnim.H Defines class CTCrpAnim
21 @internalComponent - Internal Symbian test code
24 #ifndef __TCRPANIM_H__
25 #define __TCRPANIM_H__
29 _LIT(KTCrpAnimStep,"TCrpAnim");
31 namespace //anonymous local scope
34 typedef CCrpAnim CAnonAnimWindow;
36 typedef CActiveWait CAnonActiveWait;
39 class CTCrpAnim : public CTWsGraphicsBase
42 CTCrpAnim(CTestStep* aStep);
46 virtual void RunTestCaseL(TInt aCurTestCase);
48 // TAnimFrameResult is a struct designed to track the various frame results
49 // as the animation progresses. Once the animation is complete, TAnimFrameResult
50 // provides an easy to read indication as to the animation's performance
51 struct TAnimFrameResult
60 void InvalidatePauseAndRedraw(const TRect &aRect,TTimeIntervalMicroSeconds32 aInterval);
61 void RedrawAndCheckWindows(TBool aBlankIt=EFalse);
62 void TestSpriteLoopL(TBool aAnimForeground,TBool aDrawForeground);
63 void CheckAnimProgressedL(CAnonAnimWindow* aAnimWin, TInt aAdditionalFrameCount, TBool aCaptureFrameResult = ETrue);
64 TInt DetermineApproxFrameNum(CFbsBitmap* aBitmap, TBool aCaptureFrameResult);
65 void ResetFrameCounters();
68 void TestSpriteInterruptsForegroundL();
69 void TestSpriteRestartInterruptsForegroundL();
71 void TestOverlappingWindowsL();
72 void TestClippingWindowsL();
73 void DemoClippingWindowsL();
74 void TestInvalidateL();
76 CAnonAnimWindow *iTestWin;
77 CAnonAnimWindow *iOverWin;
78 CAnonAnimWindow *iRedrawWin;
79 CAnonAnimWindow *iBaseWin;
80 TInt iPreviousFrameNum; // identifies the last successfully drawn frame number calculated
81 TInt iMinimumCalcRedLine; // the calculated minimum length of the red line in the animation
82 TAnimFrameResult iFrameStatus; // tracker for the performance of each animated frame
83 CActiveWait* iWaiter; // active object with configurable timer
84 CWsGraphicBitmapAnimation* iAnim; // ptr to server-side animation object
85 CFbsBitmap* iScreenBitmap; // bitmap holding screen snap-shot
86 HBufC8* iScanlineBuf; // buffer holding pixel data on a single vertical scan line
89 class CTCrpAnimStep : public CTGraphicsStep
95 virtual CTGraphicsBase* CreateTestL();
98 #endif //__TCRPANIM_H__