1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicsdeviceinterface/directgdi/test/tdirectgdiresource.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,108 @@
1.4 +// Copyright (c) 2007-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 +/**
1.20 + @file
1.21 + @internalComponent
1.22 + @test
1.23 +*/
1.24 +
1.25 +#ifndef TDIRECTGDIRESOURCE_H
1.26 +#define TDIRECTGDIRESOURCE_H
1.27 +
1.28 +
1.29 +#include "tdirectgdi_test_step_base.h"
1.30 +#include <bitmaptransforms.h>
1.31 +
1.32 +class RDirectGdiDrawableSource;
1.33 +
1.34 +_LIT(KBitmapRotatorSemaphore, "CTBitmapRotator_Sempaphore");
1.35 +
1.36 +/**
1.37 +This class contains all the test cases related to DirectGDI DrawResource() APIs.
1.38 +
1.39 +@internalComponent
1.40 +@test
1.41 +*/
1.42 +class CTDirectGdiResource : public CTDirectGdiStepBase, public CActive
1.43 + {
1.44 +public:
1.45 + CTDirectGdiResource();
1.46 + ~CTDirectGdiResource();
1.47 +
1.48 +protected:
1.49 + // From CActive
1.50 + void RunL();
1.51 + void DoCancel();
1.52 +
1.53 +private:
1.54 + void TestDrawResource_ImageAsDrawableL();
1.55 + void TestDrawResource_PosL();
1.56 + void TestDrawResource_DestRectL();
1.57 + void TestDrawResource_DestRectSrcRectL();
1.58 +
1.59 + void TestDrawResource_NullHandleL();
1.60 + void TestDrawResource_InvalidParameterL();
1.61 + void TestDrawResource_NonZeroOriginL();
1.62 +
1.63 + void TestDrawTargetAsSourceL();
1.64 + void TestShareEGLImageBetweenSourcesL();
1.65 + void TestDrawResourceSourceNotCreatedL();
1.66 +
1.67 + virtual TVerdict doTestStepPreambleL();
1.68 + virtual TVerdict doTestStepL();
1.69 + virtual TVerdict doTestStepPostambleL();
1.70 + // from CTDirectGdiStepBase
1.71 + void RunTestsL();
1.72 +
1.73 + void CreateCommonResourceL();
1.74 + void DestroyCommonResource();
1.75 + void SaveOutput(const TDesC& aName);
1.76 +
1.77 + void DrawTestPattern1(const TPoint&);
1.78 + void DrawTestPattern1(const TRect&, const TDrawableSourceAndEquivRotatedBmps&, const TDrawableSourceAndEquivRotatedBmps&);
1.79 + void DrawTestPattern2(const TRect&, const TDrawableSourceAndEquivRotatedBmps&, const TDrawableSourceAndEquivRotatedBmps&);
1.80 + void DrawTestPattern1(const TRect&, const TRect* = NULL);
1.81 + void DrawTestPattern2(const TRect&, const TRect* = NULL);
1.82 + void DrawTestPattern3(const TRect&, const TRect* = NULL);
1.83 +
1.84 + void DoDrawTestL();
1.85 + TBool SourceResourceHasAlpha() const;
1.86 + TBool OneTimeTestEnabled() const;
1.87 +
1.88 +private:
1.89 + TBool iUseWriteAlpha;
1.90 + TBool iEnableClipRegion;
1.91 + RRegion iClip;
1.92 + TDrawableSourceAndEquivRotatedBmps iImgSrc;
1.93 + TDrawableSourceAndEquivRotatedBmps iDwbSrc[2];
1.94 + TSize iImgSz;
1.95 + CBitmapRotator* iBitmapRotator;
1.96 +
1.97 + enum TActiveState
1.98 + {
1.99 + EStartup,
1.100 + ERotatingBitmap90,
1.101 + ERotatingBitmap180,
1.102 + ERotatingBitmap270,
1.103 + EDone
1.104 + };
1.105 +
1.106 + TActiveState iCurrentState;
1.107 + };
1.108 +
1.109 +_LIT(KTDirectGdiResourceStep,"TDirectGDIResource");
1.110 +
1.111 +#endif // TDIRECTGDIRESOURCE_H