graphicsdeviceinterface/bitgdi/tbit/TClip.h
author Faisal Memon <faisal.memon@nokia.com>
Fri, 14 May 2010 15:41:33 +0100
branchNewGraphicsArchitecture
changeset 64 5c983aa672ea
parent 0 5d03bc08d59c
permissions -rw-r--r--
Merge 1. Pull in cpp files in the performance enhanced Khronos RI OVG files which are newly added. I've ignored platform-specific cpp files for linux, macosx, and null operating systems because this local solution has its own platform glue (i.e. facility to target Bitmaps but no full windowing support). I've ignored sfEGLInterface.cpp because this is used as a bridge to go from EGL to Nokia's Platsim which offers an EGL service. That's not relevant to this implementation because this is ARM side code, not Intel side. I just left a comment to sfEGLInterface.cpp in case we need to pick up this later on. The current code compiles on winscw. Prior to this fix, the code works on winscw, and can launch the SVG tiger (tiger.exe). That takes about 20 seconds to render. I hope to always be able to show this icon on each commit, and the plan is for the render time to reduce with this series of submissions. On this commit, the tiger renders ok in 20 seconds.

// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//

#ifndef __TCLIP_H__
#define __TCLIP_H__

#include "TGraphicsHarness.h"

#define testtext _L("Test text")
#define largetesttext _L("W")

class CTClipStep;

class CTClip : public CTGraphicsBase
	{
public:
	enum TGraphicsOps
		{
	EFirstGop,
		EPlot,
		EDrawLine,
		EDottedLine,
		EDashedLine,
		EWideLine,
		EDrawArc,
		EDottedArc,
		EDrawRect,
		EVerticalHatchRect,
		EForwardDiagonalHatchRect,
		EHorizontalHatchRect,
		ERearwardDiagonalHatchRect,
		ESquareCrossHatchRect,
		EDiamondCrossHatchRect,
		EVerticalHatchEllipse,
		EForwardDiagonalHatchEllipse,
		EHorizontalHatchEllipse,
		ERearwardDiagonalHatchEllipse,
		ESquareCrossHatchEllipse,
		EDiamondCrossHatchEllipse,
		EDottedRect,
		ECopyRect,
		EDrawEllipse,
		EDottedEllipse,
		EDrawRoundRect,
		EDottedRoundRect,
		EDrawPie,
		EDottedPie,
		EDrawPolygon,
		EDrawText,
		EBoxText,
		EDrawTextVertical,
		ELargeText,
		ELargeBoxText,
		ELargeTextVertical,
		EPaintRect,
		EBitBltContext,
		EBitBltBitmap,
		EBitBltMasked,
		EDrawBitmap,
		EBitmapLarge,
		EBitmapSmall,
		EBitBltMaskedBinary,
		EBitBltMaskedBinary64K,
		EBitBltMaskedBinary16MU,
		EBitBltMaskedAlpha,
		EBitBltMaskedAlpha64K,
		EBitBltMaskedAlpha16MU,
		EBitBltMaskedAlpha16MA,
		EBitBltMaskedBinary16MA,
	EGraphicsOps,
	ETerminator
		};
	enum TTestConsts
		{
		ERegions=10
		};
	enum TColors
		{
		EForeground=0,
		EBackground=0xff
		};
public:
	CTClip(CTestStep* aStep,
			TInt aTestAppNo,
			CFbsScreenDevice* aDev,
			CFbsBitGc* aCon,
			CFbsBitmap* aBmp,
			CFbsFont* aFont,
			CFbsFont* aLargeFont);
	~CTClip();
	void TestRectRgn();
	void TestHoriRgn();
	void TestVertRgn();
	void TestSimpleRgn();
	void TestComplexRgn();
	void ScanArea(TInt,TInt,TInt,TInt);
	void CheckInside(const TRect&,const TRect&);
	void Clear();
protected:
//from 	CTGraphicsStep
	virtual void RunTestCaseL(TInt aCurTestCase);
	void ConstructL();
private:
	void DrawToScreen(TRegion& aClipReg,TRect aRect);
	void DrawToScreen(const TRect& aClipRect,TRect aRect);
	void DoDraw(TRect aRect,TBool aClipped);
	void Message(const TDesC& aMessage);
	TBool SetUpTest(TInt &aTestMode);
	inline CTClipStep* Step();
private:
	TInt iTestAppNo;
	CFbsScreenDevice* iDev;
	CFbsBitGc* iCon;
	TRect iClientRect;
	TInt iGopNum;
	TRect* iClipList;
	TInt iTestSection;
	CFbsBitmap* iBitmap;
	CFbsBitmap* iBitmap64K;
	CFbsBitmap* iBitmap16MU;
	CFbsBitmap* iBitmap16MA;
	CFbsBitmap* iBitmapMask;
	CFbsBitmap* iBitmapAlpha;
	CFbsFont* iFont;
	CFbsFont* iLargeFont;
	TSize iBmpSize;
	};

GLREF_C	void CreateTestEnvironment(CFbsScreenDevice*& aDev, CFbsBitGc*& aGc, 
								   CFbsFont*& aFont, CFbsFont*& aLargeFont);
GLREF_C	void DestroyTestEnvironment(CFbsScreenDevice* aDev, CFbsBitGc* aGc, 
								   CFbsFont* aFont, CFbsFont* aLargeFont);


class CTClipStep : public CTGraphicsStep
	{
public:
	CTClipStep();
	~CTClipStep();
	inline TBool IgnoreDiffs();
protected:	
	//from CTGraphicsStep
	virtual CTGraphicsBase* CreateTestL();
	virtual void TestSetupL();
	virtual void TestClose();
private:
	TInt CreateScreenDevice(TDisplayMode aMode);
	void CreateTestEnvironment();
	void DestroyTestEnvironment();
protected:
	TInt iTestAppNo;
private:
	CFbsScreenDevice* iDev;
	CFbsBitGc* iGc;
	CFbsFont* iFont;
	CFbsFont* iLargeFont;
	CFbsBitmap* iBmp;
	TBool iIgnoreDiffs;
	};

class CTClip2Step : public CTClipStep
	{
public:
	CTClip2Step();
	};

_LIT(KTClipStep,"TClip");
_LIT(KTClip2Step,"TClip2");

#endif//__TCLIP_H_