|
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __TALPHABLEND_H__ |
|
17 #define __TALPHABLEND_H__ |
|
18 |
|
19 #include <bitdev.h> |
|
20 #include "TGraphicsHarness.h" |
|
21 |
|
22 |
|
23 class CTAlphaBlending : public CTGraphicsBase |
|
24 { |
|
25 public: |
|
26 CTAlphaBlending(CTestStep* aStep); |
|
27 ~CTAlphaBlending(); |
|
28 |
|
29 protected: |
|
30 //from CTGraphicsStep |
|
31 virtual void RunTestCaseL(TInt aCurTestCase); |
|
32 |
|
33 private: |
|
34 TInt CreateScreenDevice(TDisplayMode aDisplayMode, CFbsBitGc::TGraphicsOrientation aOrientation=CFbsBitGc::EGraphicsOrientationNormal); |
|
35 void DeleteScreenDevice(); |
|
36 void DeleteGraphicsContext(); |
|
37 |
|
38 void TestAlphaBlendingL(); |
|
39 void DoAlphaBlendingTestsL(const TPoint& aOrigin, |
|
40 const TPoint& aDestPt, |
|
41 const TRect& aSrcRc1, |
|
42 const TPoint& aScrPt2, |
|
43 const TPoint& aAlphaPt); |
|
44 void DoAlphaBlendingTestL(CFbsBitmap* aScreenBmp, |
|
45 const CFbsBitmap* aSrcBmp, |
|
46 const CFbsBitmap* aAlphaBmp, |
|
47 const TPoint& aDestPt, |
|
48 const TRect& aSrcRc1, |
|
49 const TPoint& aSrcPt2, |
|
50 const TPoint& aAlphaPt); |
|
51 |
|
52 void CreateAlphaBlendingBitmapsLC(CFbsBitmap*& aScreenBmp, |
|
53 CFbsBitmap*& aSrcBmp, |
|
54 CFbsBitmap*& aAlphaBmp, |
|
55 TDisplayMode aMode); |
|
56 void DestroyAlphaBlendingBitmaps(CFbsBitmap*& aScreenBmp, |
|
57 CFbsBitmap*& aSrcBmp, |
|
58 CFbsBitmap*& aAlphaBmp); |
|
59 |
|
60 void DoDrawBitmapTestL(TDisplayMode aTestDisplayMode); |
|
61 void DoDrawBitmapTestsL(); |
|
62 void TestAlphaBlending2L(); |
|
63 |
|
64 void TestAlphaBlendCorrect(TDisplayMode aScreenMode, TDisplayMode aBitmapMode); |
|
65 void TestAlphaBlendingPlotL(); |
|
66 TUint32 GetRawPixel(CFbsBitmap* aBitmap, TPoint aPos); |
|
67 |
|
68 private: |
|
69 CFbsScreenDevice* iDevice; |
|
70 CFbsBitGc* iGc; |
|
71 }; |
|
72 |
|
73 |
|
74 |
|
75 class CTAlphaBlendingStep : public CTGraphicsStep |
|
76 { |
|
77 public: |
|
78 CTAlphaBlendingStep(); |
|
79 protected: |
|
80 //from CTGraphicsStep |
|
81 virtual CTGraphicsBase* CreateTestL(); |
|
82 virtual void TestSetupL(); |
|
83 }; |
|
84 |
|
85 _LIT(KTAlphaBlendingStep,"TAlphaBlending"); |
|
86 |
|
87 |
|
88 #endif |