os/graphics/windowing/windowserver/test/tauto/tcrpanim.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200 (2012-06-15)
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// TCrpAnim.H Defines class CTCrpAnim
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
/**
sl@0
    19
 @file
sl@0
    20
 @test
sl@0
    21
 @internalComponent - Internal Symbian test code
sl@0
    22
*/
sl@0
    23
sl@0
    24
#ifndef __TCRPANIM_H__
sl@0
    25
#define __TCRPANIM_H__
sl@0
    26
sl@0
    27
#include "AUTO.H"
sl@0
    28
sl@0
    29
_LIT(KTCrpAnimStep,"TCrpAnim");
sl@0
    30
sl@0
    31
namespace	//anonymous local scope
sl@0
    32
	{
sl@0
    33
	class CCrpAnim;
sl@0
    34
	typedef  CCrpAnim CAnonAnimWindow;
sl@0
    35
	class CActiveWait;
sl@0
    36
	typedef  CActiveWait CAnonActiveWait;
sl@0
    37
	}
sl@0
    38
	
sl@0
    39
class CTCrpAnim : public CTWsGraphicsBase
sl@0
    40
	{
sl@0
    41
public:
sl@0
    42
	CTCrpAnim(CTestStep* aStep);
sl@0
    43
	~CTCrpAnim();
sl@0
    44
	void ConstructL();
sl@0
    45
protected:
sl@0
    46
	virtual void RunTestCaseL(TInt aCurTestCase);
sl@0
    47
private:
sl@0
    48
	// TAnimFrameResult is a struct designed to track the various frame results
sl@0
    49
	// as the animation progresses. Once the animation is complete, TAnimFrameResult
sl@0
    50
	// provides an easy to read indication as to the animation's performance
sl@0
    51
	struct TAnimFrameResult
sl@0
    52
		{
sl@0
    53
		TInt iFrameOK;
sl@0
    54
		TInt iFramePartial;
sl@0
    55
		TInt iFrameIdentical;
sl@0
    56
		TInt iFrameEmpty;
sl@0
    57
		TInt iFrameTearing;
sl@0
    58
		TInt iFrameSkipped;
sl@0
    59
		};
sl@0
    60
	void InvalidatePauseAndRedraw(const TRect &aRect,TTimeIntervalMicroSeconds32 aInterval);
sl@0
    61
	void RedrawAndCheckWindows(TBool aBlankIt=EFalse);
sl@0
    62
	void TestSpriteLoopL(TBool aAnimForeground,TBool aDrawForeground);
sl@0
    63
    void CheckAnimProgressedL(CAnonAnimWindow* aAnimWin, TInt aAdditionalFrameCount, TBool aCaptureFrameResult = ETrue);
sl@0
    64
	TInt DetermineApproxFrameNum(CFbsBitmap* aBitmap, TBool aCaptureFrameResult);
sl@0
    65
	void ResetFrameCounters();
sl@0
    66
	TInt LogResults();
sl@0
    67
// The tests
sl@0
    68
    void	TestSpriteInterruptsForegroundL();
sl@0
    69
    void	TestSpriteRestartInterruptsForegroundL();
sl@0
    70
	void	BasicCRPDemo();
sl@0
    71
	void	TestOverlappingWindowsL();
sl@0
    72
	void	TestClippingWindowsL();
sl@0
    73
	void	DemoClippingWindowsL();
sl@0
    74
	void	TestInvalidateL();
sl@0
    75
private:
sl@0
    76
	CAnonAnimWindow *iTestWin;
sl@0
    77
	CAnonAnimWindow *iOverWin;
sl@0
    78
	CAnonAnimWindow *iRedrawWin;
sl@0
    79
	CAnonAnimWindow *iBaseWin;
sl@0
    80
	TInt iPreviousFrameNum;				// identifies the last successfully drawn frame number calculated
sl@0
    81
	TInt iMinimumCalcRedLine;			// the calculated minimum length of the red line in the animation
sl@0
    82
	TAnimFrameResult iFrameStatus;		// tracker for the performance of each animated frame
sl@0
    83
	CActiveWait* iWaiter;				// active object with configurable timer
sl@0
    84
	CWsGraphicBitmapAnimation* iAnim; 	// ptr to server-side animation object
sl@0
    85
	CFbsBitmap* iScreenBitmap;			// bitmap holding screen snap-shot
sl@0
    86
	HBufC8* iScanlineBuf;				// buffer holding pixel data on a single vertical scan line
sl@0
    87
	};
sl@0
    88
sl@0
    89
class CTCrpAnimStep : public CTGraphicsStep
sl@0
    90
	{
sl@0
    91
public:
sl@0
    92
	CTCrpAnimStep();
sl@0
    93
protected:
sl@0
    94
	//from CTGraphicsStep
sl@0
    95
	virtual CTGraphicsBase* CreateTestL();
sl@0
    96
	};
sl@0
    97
sl@0
    98
#endif  //__TCRPANIM_H__