os/graphics/graphicstest/graphicstestharness/textendedbitmapgc/textendedbitmapgc.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicstest/graphicstestharness/textendedbitmapgc/textendedbitmapgc.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,101 @@
1.4 +// Copyright (c) 2008-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 +// textendedbitmap.h
1.18 +//
1.19 +//
1.20 +
1.21 +/**
1.22 + @file
1.23 + @test
1.24 + @internalComponent - Internal Symbian test code
1.25 +*/
1.26 +
1.27 +#ifndef TEXTENDEDBITMAPGC_H
1.28 +#define TEXTENDEDBITMAPGC_H
1.29 +
1.30 +#include <test/testexecutestepbase.h>
1.31 +#include <test/testharnesscallback.h>
1.32 +#include <w32std.h>
1.33 +
1.34 +/** Test class for testing the operation of extended bitmaps with different graphics
1.35 +contexts. Creators of this test class must provide a pointer to a MTestHarnessCallBack object
1.36 +and a CBitmapContext. The MTestHarnessCallBack callback object allows CTExtendedBitmapGc to
1.37 +pass logging and test status operations back to the creator. All drawing operations that this
1.38 +test class performs are drawn to the supplied CBitmapContext object.
1.39 + */
1.40 +class CTExtendedBitmapGc : public CBase
1.41 + {
1.42 +public:
1.43 + /** Stripe styles that are supported by the example bitmap example rasterizer, note that only
1.44 + vertical and horizontal stripes are supported
1.45 + */
1.46 + enum TStripeStyle
1.47 + {
1.48 + EVerticalStripe = 0,
1.49 + EHorizontalStripe = 1
1.50 + };
1.51 +
1.52 + /** Defines whether this class should draw extended bitmaps as flags, or as plain white
1.53 + rectangles. EDrawFlag should be used when testing with BitGdi where the example rasterizer
1.54 + is available, or when testing with WServ where the example extended bitmap render stage is
1.55 + available. Otherwise EDrawWhite should be used. It is up to the creator of CTExtendedBitmapGc
1.56 + to decide which draw mode should be used.
1.57 + */
1.58 + enum TDrawMode
1.59 + {
1.60 + EDrawFlag,
1.61 + EDrawWhite
1.62 + };
1.63 +
1.64 +public:
1.65 + IMPORT_C static CTExtendedBitmapGc* NewL(MTestHarnessCallBack* aCallBack, CBitmapContext& aGc, TDrawMode aDrawMode, TDisplayMode aDisplayMode);
1.66 + IMPORT_C ~CTExtendedBitmapGc();
1.67 + IMPORT_C void RunTestCaseL(TInt aCurTestCase);
1.68 +
1.69 + // Helper functions
1.70 + IMPORT_C static void WriteExtendedBitmapInfoL(TUint8* aData,
1.71 + TInt& aDataSize,
1.72 + const TRgb* aColorArray,
1.73 + TStripeStyle aStripeStyle);
1.74 +
1.75 +private:
1.76 + // Construction
1.77 + CTExtendedBitmapGc(MTestHarnessCallBack* aCallBack, CBitmapContext& aGc, TDrawMode aDrawMode);
1.78 + void ConstructL(TDisplayMode aDisplayMode);
1.79 +
1.80 + // Test cases
1.81 + void TestBitmapDrawingL(TBool aTestRegionOfInterest, TStripeStyle aStripeStyle, TInt aCaseNumber);
1.82 + void TestBrushPatternL(TInt aCaseNumber);
1.83 +
1.84 + // Helper functions
1.85 + void CreateTestBitmapLC(CFbsBitmap*& aBmpRet,
1.86 + const TSize& aSize,
1.87 + TDisplayMode aDisplayMode,
1.88 + const TRgb& aColor1,
1.89 + const TRgb& aColor2,
1.90 + const TRgb& aColor3,
1.91 + TStripeStyle aStripeStyle);
1.92 +
1.93 + CTestExecuteLogger& Logger() {return iCallBack->Logger();}
1.94 +
1.95 +private:
1.96 + MTestHarnessCallBack* iCallBack;
1.97 + TDrawMode iDrawMode;
1.98 + TDisplayMode iDisplayMode;
1.99 + CBitmapContext& iGc;
1.100 + TBool iIsFbs;
1.101 + CFont* iFont;
1.102 + };
1.103 +
1.104 +#endif // TEXTENDEDBITMAPGC_H