First public contribution.
1 // Copyright (c) 2007-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
22 #ifndef TDIRECTGDIRESOURCE_H
23 #define TDIRECTGDIRESOURCE_H
26 #include "tdirectgdi_test_step_base.h"
27 #include <bitmaptransforms.h>
29 class RDirectGdiDrawableSource;
31 _LIT(KBitmapRotatorSemaphore, "CTBitmapRotator_Sempaphore");
34 This class contains all the test cases related to DirectGDI DrawResource() APIs.
39 class CTDirectGdiResource : public CTDirectGdiStepBase, public CActive
42 CTDirectGdiResource();
43 ~CTDirectGdiResource();
51 void TestDrawResource_ImageAsDrawableL();
52 void TestDrawResource_PosL();
53 void TestDrawResource_DestRectL();
54 void TestDrawResource_DestRectSrcRectL();
56 void TestDrawResource_NullHandleL();
57 void TestDrawResource_InvalidParameterL();
58 void TestDrawResource_NonZeroOriginL();
60 void TestDrawTargetAsSourceL();
61 void TestShareEGLImageBetweenSourcesL();
62 void TestDrawResourceSourceNotCreatedL();
64 virtual TVerdict doTestStepPreambleL();
65 virtual TVerdict doTestStepL();
66 virtual TVerdict doTestStepPostambleL();
67 // from CTDirectGdiStepBase
70 void CreateCommonResourceL();
71 void DestroyCommonResource();
72 void SaveOutput(const TDesC& aName);
74 void DrawTestPattern1(const TPoint&);
75 void DrawTestPattern1(const TRect&, const TDrawableSourceAndEquivRotatedBmps&, const TDrawableSourceAndEquivRotatedBmps&);
76 void DrawTestPattern2(const TRect&, const TDrawableSourceAndEquivRotatedBmps&, const TDrawableSourceAndEquivRotatedBmps&);
77 void DrawTestPattern1(const TRect&, const TRect* = NULL);
78 void DrawTestPattern2(const TRect&, const TRect* = NULL);
79 void DrawTestPattern3(const TRect&, const TRect* = NULL);
82 TBool SourceResourceHasAlpha() const;
83 TBool OneTimeTestEnabled() const;
87 TBool iEnableClipRegion;
89 TDrawableSourceAndEquivRotatedBmps iImgSrc;
90 TDrawableSourceAndEquivRotatedBmps iDwbSrc[2];
92 CBitmapRotator* iBitmapRotator;
103 TActiveState iCurrentState;
106 _LIT(KTDirectGdiResourceStep,"TDirectGDIResource");
108 #endif // TDIRECTGDIRESOURCE_H