First public contribution.
2 // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
3 // All rights reserved.
4 // This component and the accompanying materials are made available
5 // under the terms of "Eclipse Public License v1.0"
6 // which accompanies this distribution, and is available
7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 // Initial Contributors:
10 // Nokia Corporation - initial contribution.
20 @internalComponent - Internal Symbian test code
23 #ifndef __TALPHAWIN_H__
24 #define __TALPHAWIN_H__
27 #include "TGraphicsHarness.h"
33 class CTAlphaWin : public CTWsGraphicsBase
36 CTAlphaWin(CTestStep* aStep);
40 void TestConditionL();
43 virtual void RunTestCaseL(TInt aCurTestCase);
45 void ConfigureDisplayModes(TDisplayMode aRequiredMode);
46 // The blending test works as follows:
47 // On the left, we have a window which draws using an opaque half-red colour
48 // On the right, we have a window which blends using a semi-transparent full-red colour
49 // The test compares left and right
50 void TestSemiTransparentDrawingL();
51 void TestTransparentDrawingL();
53 // The transparent window tests work as follows:
54 // On the left, we have transparent windows, on which we perform various various operations
55 // On the right, we have a reference window, in which we draw what we think the windows on the left should look like
56 // The test compares the right and the left
57 void TestInitialConfiguration();
62 void TestAntiAliasedTextTransparentL();
63 void CheckRectL(const TRect& rect1, const TRect& rect2, TSize aSize, TDisplayMode aRequiredMode, TInt aTolerance, const TDesC& aErrorMsg);
66 TFixedArray<CTAlphaWindow*,5> iTestWin;
67 CTAlphaRefWin* iRefWin;
70 class CTDrawOpWin : public CTWin
73 static CTDrawOpWin* NewL(CTAlphaWin* aTest, CTWinBase* aParent, TPoint aPos, TSize aSize, TRgb aDrawColour);
74 CTDrawOpWin(CTAlphaWin* aTest, TRgb aDrawColour);
76 //Virtual Function from CTBaseWin
79 void SetDrawOp(TInt aDrawOp);
87 class CTAlphaWindow : public CTWin
89 friend class CTAlphaRefWin;
91 inline CTAlphaWindow(CTAlphaWin* aTest) : iTest(aTest) {}
93 static CTAlphaWindow* NewL(CTAlphaWin* aTest, CTWinBase* aParent, TPoint aPos, TSize aSize, TInt aDrawState);
95 //Virtual Function from CTBaseWin
98 void SetDrawState(TInt aDrawState);
101 void SetVisible(TBool aVisible);
102 void CreateChildrenL(TInt aDepth);
103 void DestroyChildren();
107 CTAlphaWindow* iChild1;
108 CTAlphaWindow* iChild2;
111 class CTAlphaRefWin : public CTWin
113 // This class is used to draw what we think things should look like, for comparison with what they actually look like
115 inline CTAlphaRefWin(TFixedArray<CTAlphaWindow*,5>& aAlphaWin);
116 static CTAlphaRefWin* NewL(CTWinBase* aParent, TPoint aPos, TSize aSize, TFixedArray<CTAlphaWindow*,5>& aAlphaWin);
119 void DrawWindow(CTAlphaWindow* aWindow, TPoint aOffset);
121 TFixedArray<CTAlphaWindow*,5>& iAlphaWin;
124 class CTAlphaWinStep : public CTGraphicsStep
129 //from CTGraphicsStep
130 virtual CTGraphicsBase* CreateTestL();
133 _LIT(KTAlphaWinStep,"TAlphaWin");