sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // TCrpAnim.H Defines class CTCrpAnim sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @test sl@0: @internalComponent - Internal Symbian test code sl@0: */ sl@0: sl@0: #ifndef __TCRPANIM_H__ sl@0: #define __TCRPANIM_H__ sl@0: sl@0: #include "AUTO.H" sl@0: sl@0: _LIT(KTCrpAnimStep,"TCrpAnim"); sl@0: sl@0: namespace //anonymous local scope sl@0: { sl@0: class CCrpAnim; sl@0: typedef CCrpAnim CAnonAnimWindow; sl@0: class CActiveWait; sl@0: typedef CActiveWait CAnonActiveWait; sl@0: } sl@0: sl@0: class CTCrpAnim : public CTWsGraphicsBase sl@0: { sl@0: public: sl@0: CTCrpAnim(CTestStep* aStep); sl@0: ~CTCrpAnim(); sl@0: void ConstructL(); sl@0: protected: sl@0: virtual void RunTestCaseL(TInt aCurTestCase); sl@0: private: sl@0: // TAnimFrameResult is a struct designed to track the various frame results sl@0: // as the animation progresses. Once the animation is complete, TAnimFrameResult sl@0: // provides an easy to read indication as to the animation's performance sl@0: struct TAnimFrameResult sl@0: { sl@0: TInt iFrameOK; sl@0: TInt iFramePartial; sl@0: TInt iFrameIdentical; sl@0: TInt iFrameEmpty; sl@0: TInt iFrameTearing; sl@0: TInt iFrameSkipped; sl@0: }; sl@0: void InvalidatePauseAndRedraw(const TRect &aRect,TTimeIntervalMicroSeconds32 aInterval); sl@0: void RedrawAndCheckWindows(TBool aBlankIt=EFalse); sl@0: void TestSpriteLoopL(TBool aAnimForeground,TBool aDrawForeground); sl@0: void CheckAnimProgressedL(CAnonAnimWindow* aAnimWin, TInt aAdditionalFrameCount, TBool aCaptureFrameResult = ETrue); sl@0: TInt DetermineApproxFrameNum(CFbsBitmap* aBitmap, TBool aCaptureFrameResult); sl@0: void ResetFrameCounters(); sl@0: TInt LogResults(); sl@0: // The tests sl@0: void TestSpriteInterruptsForegroundL(); sl@0: void TestSpriteRestartInterruptsForegroundL(); sl@0: void BasicCRPDemo(); sl@0: void TestOverlappingWindowsL(); sl@0: void TestClippingWindowsL(); sl@0: void DemoClippingWindowsL(); sl@0: void TestInvalidateL(); sl@0: private: sl@0: CAnonAnimWindow *iTestWin; sl@0: CAnonAnimWindow *iOverWin; sl@0: CAnonAnimWindow *iRedrawWin; sl@0: CAnonAnimWindow *iBaseWin; sl@0: TInt iPreviousFrameNum; // identifies the last successfully drawn frame number calculated sl@0: TInt iMinimumCalcRedLine; // the calculated minimum length of the red line in the animation sl@0: TAnimFrameResult iFrameStatus; // tracker for the performance of each animated frame sl@0: CActiveWait* iWaiter; // active object with configurable timer sl@0: CWsGraphicBitmapAnimation* iAnim; // ptr to server-side animation object sl@0: CFbsBitmap* iScreenBitmap; // bitmap holding screen snap-shot sl@0: HBufC8* iScanlineBuf; // buffer holding pixel data on a single vertical scan line sl@0: }; sl@0: sl@0: class CTCrpAnimStep : public CTGraphicsStep sl@0: { sl@0: public: sl@0: CTCrpAnimStep(); sl@0: protected: sl@0: //from CTGraphicsStep sl@0: virtual CTGraphicsBase* CreateTestL(); sl@0: }; sl@0: sl@0: #endif //__TCRPANIM_H__