sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @internalComponent sl@0: @test sl@0: */ sl@0: sl@0: #ifndef TDIRECTGDIRESOURCE_H sl@0: #define TDIRECTGDIRESOURCE_H sl@0: sl@0: sl@0: #include "tdirectgdi_test_step_base.h" sl@0: #include sl@0: sl@0: class RDirectGdiDrawableSource; sl@0: sl@0: _LIT(KBitmapRotatorSemaphore, "CTBitmapRotator_Sempaphore"); sl@0: sl@0: /** sl@0: This class contains all the test cases related to DirectGDI DrawResource() APIs. sl@0: sl@0: @internalComponent sl@0: @test sl@0: */ sl@0: class CTDirectGdiResource : public CTDirectGdiStepBase, public CActive sl@0: { sl@0: public: sl@0: CTDirectGdiResource(); sl@0: ~CTDirectGdiResource(); sl@0: sl@0: protected: sl@0: // From CActive sl@0: void RunL(); sl@0: void DoCancel(); sl@0: sl@0: private: sl@0: void TestDrawResource_ImageAsDrawableL(); sl@0: void TestDrawResource_PosL(); sl@0: void TestDrawResource_DestRectL(); sl@0: void TestDrawResource_DestRectSrcRectL(); sl@0: sl@0: void TestDrawResource_NullHandleL(); sl@0: void TestDrawResource_InvalidParameterL(); sl@0: void TestDrawResource_NonZeroOriginL(); sl@0: sl@0: void TestDrawTargetAsSourceL(); sl@0: void TestShareEGLImageBetweenSourcesL(); sl@0: void TestDrawResourceSourceNotCreatedL(); sl@0: sl@0: virtual TVerdict doTestStepPreambleL(); sl@0: virtual TVerdict doTestStepL(); sl@0: virtual TVerdict doTestStepPostambleL(); sl@0: // from CTDirectGdiStepBase sl@0: void RunTestsL(); sl@0: sl@0: void CreateCommonResourceL(); sl@0: void DestroyCommonResource(); sl@0: void SaveOutput(const TDesC& aName); sl@0: sl@0: void DrawTestPattern1(const TPoint&); sl@0: void DrawTestPattern1(const TRect&, const TDrawableSourceAndEquivRotatedBmps&, const TDrawableSourceAndEquivRotatedBmps&); sl@0: void DrawTestPattern2(const TRect&, const TDrawableSourceAndEquivRotatedBmps&, const TDrawableSourceAndEquivRotatedBmps&); sl@0: void DrawTestPattern1(const TRect&, const TRect* = NULL); sl@0: void DrawTestPattern2(const TRect&, const TRect* = NULL); sl@0: void DrawTestPattern3(const TRect&, const TRect* = NULL); sl@0: sl@0: void DoDrawTestL(); sl@0: TBool SourceResourceHasAlpha() const; sl@0: TBool OneTimeTestEnabled() const; sl@0: sl@0: private: sl@0: TBool iUseWriteAlpha; sl@0: TBool iEnableClipRegion; sl@0: RRegion iClip; sl@0: TDrawableSourceAndEquivRotatedBmps iImgSrc; sl@0: TDrawableSourceAndEquivRotatedBmps iDwbSrc[2]; sl@0: TSize iImgSz; sl@0: CBitmapRotator* iBitmapRotator; sl@0: sl@0: enum TActiveState sl@0: { sl@0: EStartup, sl@0: ERotatingBitmap90, sl@0: ERotatingBitmap180, sl@0: ERotatingBitmap270, sl@0: EDone sl@0: }; sl@0: sl@0: TActiveState iCurrentState; sl@0: }; sl@0: sl@0: _LIT(KTDirectGdiResourceStep,"TDirectGDIResource"); sl@0: sl@0: #endif // TDIRECTGDIRESOURCE_H