os/graphics/graphicstest/graphicstestharness/textendedbitmapgc/textendedbitmapgc.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2008-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 // textendedbitmap.h
    15 // 
    16 //
    17 
    18 /**
    19  @file
    20  @test
    21  @internalComponent - Internal Symbian test code
    22 */
    23 
    24 #ifndef TEXTENDEDBITMAPGC_H
    25 #define TEXTENDEDBITMAPGC_H
    26 
    27 #include <test/testexecutestepbase.h>
    28 #include <test/testharnesscallback.h>
    29 #include <w32std.h>
    30 
    31 /** Test class for testing the operation of extended bitmaps with different graphics
    32 contexts. Creators of this test class must provide a pointer to a MTestHarnessCallBack object
    33 and a CBitmapContext. The MTestHarnessCallBack callback object allows CTExtendedBitmapGc to 
    34 pass logging and test status operations back to the creator. All drawing operations that this
    35 test class performs are drawn to the supplied CBitmapContext object.
    36  */
    37 class CTExtendedBitmapGc : public CBase
    38 	{
    39 public:
    40 	/** Stripe styles that are supported by the example bitmap example rasterizer, note that only
    41 	vertical and horizontal stripes are supported
    42 	*/
    43 	enum TStripeStyle
    44 		{
    45 		EVerticalStripe = 0,
    46 		EHorizontalStripe = 1
    47 		};
    48 	
    49 	/** Defines whether this class should draw extended bitmaps as flags, or as plain white
    50 	rectangles. EDrawFlag should be used when testing with BitGdi where the example rasterizer
    51 	is available, or when testing with WServ where the example extended bitmap render stage is
    52 	available. Otherwise EDrawWhite should be used. It is up to the creator of CTExtendedBitmapGc
    53 	to decide which draw mode should be used.
    54 	 */
    55 	enum TDrawMode
    56 		{
    57 		EDrawFlag,
    58 		EDrawWhite
    59 		};
    60 
    61 public:
    62 	IMPORT_C static CTExtendedBitmapGc* NewL(MTestHarnessCallBack* aCallBack, CBitmapContext& aGc, TDrawMode aDrawMode, TDisplayMode aDisplayMode);	
    63 	IMPORT_C ~CTExtendedBitmapGc();
    64 	IMPORT_C void RunTestCaseL(TInt aCurTestCase);
    65 
    66 	// Helper functions
    67 	IMPORT_C static void WriteExtendedBitmapInfoL(TUint8* aData,
    68 										   TInt& aDataSize,
    69 										   const TRgb* aColorArray, 
    70 										   TStripeStyle aStripeStyle);
    71 
    72 private:	
    73 	// Construction
    74 	CTExtendedBitmapGc(MTestHarnessCallBack* aCallBack, CBitmapContext& aGc, TDrawMode aDrawMode);
    75 	void ConstructL(TDisplayMode aDisplayMode);
    76 	
    77 	// Test cases
    78 	void TestBitmapDrawingL(TBool aTestRegionOfInterest, TStripeStyle aStripeStyle, TInt aCaseNumber);
    79 	void TestBrushPatternL(TInt aCaseNumber);
    80 	
    81 	// Helper functions	
    82 	void CreateTestBitmapLC(CFbsBitmap*& aBmpRet,
    83 						const TSize& aSize,
    84 						TDisplayMode aDisplayMode, 
    85 						const TRgb& aColor1, 
    86 						const TRgb& aColor2, 
    87 						const TRgb& aColor3,
    88 						TStripeStyle aStripeStyle);
    89 
    90 	CTestExecuteLogger&	Logger() {return iCallBack->Logger();}
    91 	
    92 private:
    93 	MTestHarnessCallBack* iCallBack;
    94 	TDrawMode iDrawMode;
    95 	TDisplayMode iDisplayMode;
    96 	CBitmapContext& iGc;
    97 	TBool iIsFbs;
    98 	CFont* iFont;
    99 	};
   100 
   101 #endif // TEXTENDEDBITMAPGC_H