os/graphics/windowing/windowserver/test/tauto/tcrpanim.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/windowing/windowserver/test/tauto/tcrpanim.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,98 @@
     1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// TCrpAnim.H Defines class CTCrpAnim
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +/**
    1.22 + @file
    1.23 + @test
    1.24 + @internalComponent - Internal Symbian test code
    1.25 +*/
    1.26 +
    1.27 +#ifndef __TCRPANIM_H__
    1.28 +#define __TCRPANIM_H__
    1.29 +
    1.30 +#include "AUTO.H"
    1.31 +
    1.32 +_LIT(KTCrpAnimStep,"TCrpAnim");
    1.33 +
    1.34 +namespace	//anonymous local scope
    1.35 +	{
    1.36 +	class CCrpAnim;
    1.37 +	typedef  CCrpAnim CAnonAnimWindow;
    1.38 +	class CActiveWait;
    1.39 +	typedef  CActiveWait CAnonActiveWait;
    1.40 +	}
    1.41 +	
    1.42 +class CTCrpAnim : public CTWsGraphicsBase
    1.43 +	{
    1.44 +public:
    1.45 +	CTCrpAnim(CTestStep* aStep);
    1.46 +	~CTCrpAnim();
    1.47 +	void ConstructL();
    1.48 +protected:
    1.49 +	virtual void RunTestCaseL(TInt aCurTestCase);
    1.50 +private:
    1.51 +	// TAnimFrameResult is a struct designed to track the various frame results
    1.52 +	// as the animation progresses. Once the animation is complete, TAnimFrameResult
    1.53 +	// provides an easy to read indication as to the animation's performance
    1.54 +	struct TAnimFrameResult
    1.55 +		{
    1.56 +		TInt iFrameOK;
    1.57 +		TInt iFramePartial;
    1.58 +		TInt iFrameIdentical;
    1.59 +		TInt iFrameEmpty;
    1.60 +		TInt iFrameTearing;
    1.61 +		TInt iFrameSkipped;
    1.62 +		};
    1.63 +	void InvalidatePauseAndRedraw(const TRect &aRect,TTimeIntervalMicroSeconds32 aInterval);
    1.64 +	void RedrawAndCheckWindows(TBool aBlankIt=EFalse);
    1.65 +	void TestSpriteLoopL(TBool aAnimForeground,TBool aDrawForeground);
    1.66 +    void CheckAnimProgressedL(CAnonAnimWindow* aAnimWin, TInt aAdditionalFrameCount, TBool aCaptureFrameResult = ETrue);
    1.67 +	TInt DetermineApproxFrameNum(CFbsBitmap* aBitmap, TBool aCaptureFrameResult);
    1.68 +	void ResetFrameCounters();
    1.69 +	TInt LogResults();
    1.70 +// The tests
    1.71 +    void	TestSpriteInterruptsForegroundL();
    1.72 +    void	TestSpriteRestartInterruptsForegroundL();
    1.73 +	void	BasicCRPDemo();
    1.74 +	void	TestOverlappingWindowsL();
    1.75 +	void	TestClippingWindowsL();
    1.76 +	void	DemoClippingWindowsL();
    1.77 +	void	TestInvalidateL();
    1.78 +private:
    1.79 +	CAnonAnimWindow *iTestWin;
    1.80 +	CAnonAnimWindow *iOverWin;
    1.81 +	CAnonAnimWindow *iRedrawWin;
    1.82 +	CAnonAnimWindow *iBaseWin;
    1.83 +	TInt iPreviousFrameNum;				// identifies the last successfully drawn frame number calculated
    1.84 +	TInt iMinimumCalcRedLine;			// the calculated minimum length of the red line in the animation
    1.85 +	TAnimFrameResult iFrameStatus;		// tracker for the performance of each animated frame
    1.86 +	CActiveWait* iWaiter;				// active object with configurable timer
    1.87 +	CWsGraphicBitmapAnimation* iAnim; 	// ptr to server-side animation object
    1.88 +	CFbsBitmap* iScreenBitmap;			// bitmap holding screen snap-shot
    1.89 +	HBufC8* iScanlineBuf;				// buffer holding pixel data on a single vertical scan line
    1.90 +	};
    1.91 +
    1.92 +class CTCrpAnimStep : public CTGraphicsStep
    1.93 +	{
    1.94 +public:
    1.95 +	CTCrpAnimStep();
    1.96 +protected:
    1.97 +	//from CTGraphicsStep
    1.98 +	virtual CTGraphicsBase* CreateTestL();
    1.99 +	};
   1.100 +
   1.101 +#endif  //__TCRPANIM_H__