1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicsdeviceinterface/bitgdi/tbit/TClip.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,182 @@
1.4 +// Copyright (c) 2003-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 +//
1.18 +
1.19 +#ifndef __TCLIP_H__
1.20 +#define __TCLIP_H__
1.21 +
1.22 +#include "TGraphicsHarness.h"
1.23 +
1.24 +#define testtext _L("Test text")
1.25 +#define largetesttext _L("W")
1.26 +
1.27 +class CTClipStep;
1.28 +
1.29 +class CTClip : public CTGraphicsBase
1.30 + {
1.31 +public:
1.32 + enum TGraphicsOps
1.33 + {
1.34 + EFirstGop,
1.35 + EPlot,
1.36 + EDrawLine,
1.37 + EDottedLine,
1.38 + EDashedLine,
1.39 + EWideLine,
1.40 + EDrawArc,
1.41 + EDottedArc,
1.42 + EDrawRect,
1.43 + EVerticalHatchRect,
1.44 + EForwardDiagonalHatchRect,
1.45 + EHorizontalHatchRect,
1.46 + ERearwardDiagonalHatchRect,
1.47 + ESquareCrossHatchRect,
1.48 + EDiamondCrossHatchRect,
1.49 + EVerticalHatchEllipse,
1.50 + EForwardDiagonalHatchEllipse,
1.51 + EHorizontalHatchEllipse,
1.52 + ERearwardDiagonalHatchEllipse,
1.53 + ESquareCrossHatchEllipse,
1.54 + EDiamondCrossHatchEllipse,
1.55 + EDottedRect,
1.56 + ECopyRect,
1.57 + EDrawEllipse,
1.58 + EDottedEllipse,
1.59 + EDrawRoundRect,
1.60 + EDottedRoundRect,
1.61 + EDrawPie,
1.62 + EDottedPie,
1.63 + EDrawPolygon,
1.64 + EDrawText,
1.65 + EBoxText,
1.66 + EDrawTextVertical,
1.67 + ELargeText,
1.68 + ELargeBoxText,
1.69 + ELargeTextVertical,
1.70 + EPaintRect,
1.71 + EBitBltContext,
1.72 + EBitBltBitmap,
1.73 + EBitBltMasked,
1.74 + EDrawBitmap,
1.75 + EBitmapLarge,
1.76 + EBitmapSmall,
1.77 + EBitBltMaskedBinary,
1.78 + EBitBltMaskedBinary64K,
1.79 + EBitBltMaskedBinary16MU,
1.80 + EBitBltMaskedAlpha,
1.81 + EBitBltMaskedAlpha64K,
1.82 + EBitBltMaskedAlpha16MU,
1.83 + EBitBltMaskedAlpha16MA,
1.84 + EBitBltMaskedBinary16MA,
1.85 + EGraphicsOps,
1.86 + ETerminator
1.87 + };
1.88 + enum TTestConsts
1.89 + {
1.90 + ERegions=10
1.91 + };
1.92 + enum TColors
1.93 + {
1.94 + EForeground=0,
1.95 + EBackground=0xff
1.96 + };
1.97 +public:
1.98 + CTClip(CTestStep* aStep,
1.99 + TInt aTestAppNo,
1.100 + CFbsScreenDevice* aDev,
1.101 + CFbsBitGc* aCon,
1.102 + CFbsBitmap* aBmp,
1.103 + CFbsFont* aFont,
1.104 + CFbsFont* aLargeFont);
1.105 + ~CTClip();
1.106 + void TestRectRgn();
1.107 + void TestHoriRgn();
1.108 + void TestVertRgn();
1.109 + void TestSimpleRgn();
1.110 + void TestComplexRgn();
1.111 + void ScanArea(TInt,TInt,TInt,TInt);
1.112 + void CheckInside(const TRect&,const TRect&);
1.113 + void Clear();
1.114 +protected:
1.115 +//from CTGraphicsStep
1.116 + virtual void RunTestCaseL(TInt aCurTestCase);
1.117 + void ConstructL();
1.118 +private:
1.119 + void DrawToScreen(TRegion& aClipReg,TRect aRect);
1.120 + void DrawToScreen(const TRect& aClipRect,TRect aRect);
1.121 + void DoDraw(TRect aRect,TBool aClipped);
1.122 + void Message(const TDesC& aMessage);
1.123 + TBool SetUpTest(TInt &aTestMode);
1.124 + inline CTClipStep* Step();
1.125 +private:
1.126 + TInt iTestAppNo;
1.127 + CFbsScreenDevice* iDev;
1.128 + CFbsBitGc* iCon;
1.129 + TRect iClientRect;
1.130 + TInt iGopNum;
1.131 + TRect* iClipList;
1.132 + TInt iTestSection;
1.133 + CFbsBitmap* iBitmap;
1.134 + CFbsBitmap* iBitmap64K;
1.135 + CFbsBitmap* iBitmap16MU;
1.136 + CFbsBitmap* iBitmap16MA;
1.137 + CFbsBitmap* iBitmapMask;
1.138 + CFbsBitmap* iBitmapAlpha;
1.139 + CFbsFont* iFont;
1.140 + CFbsFont* iLargeFont;
1.141 + TSize iBmpSize;
1.142 + };
1.143 +
1.144 +GLREF_C void CreateTestEnvironment(CFbsScreenDevice*& aDev, CFbsBitGc*& aGc,
1.145 + CFbsFont*& aFont, CFbsFont*& aLargeFont);
1.146 +GLREF_C void DestroyTestEnvironment(CFbsScreenDevice* aDev, CFbsBitGc* aGc,
1.147 + CFbsFont* aFont, CFbsFont* aLargeFont);
1.148 +
1.149 +
1.150 +class CTClipStep : public CTGraphicsStep
1.151 + {
1.152 +public:
1.153 + CTClipStep();
1.154 + ~CTClipStep();
1.155 + inline TBool IgnoreDiffs();
1.156 +protected:
1.157 + //from CTGraphicsStep
1.158 + virtual CTGraphicsBase* CreateTestL();
1.159 + virtual void TestSetupL();
1.160 + virtual void TestClose();
1.161 +private:
1.162 + TInt CreateScreenDevice(TDisplayMode aMode);
1.163 + void CreateTestEnvironment();
1.164 + void DestroyTestEnvironment();
1.165 +protected:
1.166 + TInt iTestAppNo;
1.167 +private:
1.168 + CFbsScreenDevice* iDev;
1.169 + CFbsBitGc* iGc;
1.170 + CFbsFont* iFont;
1.171 + CFbsFont* iLargeFont;
1.172 + CFbsBitmap* iBmp;
1.173 + TBool iIgnoreDiffs;
1.174 + };
1.175 +
1.176 +class CTClip2Step : public CTClipStep
1.177 + {
1.178 +public:
1.179 + CTClip2Step();
1.180 + };
1.181 +
1.182 +_LIT(KTClipStep,"TClip");
1.183 +_LIT(KTClip2Step,"TClip2");
1.184 +
1.185 +#endif//__TCLIP_H_