sl@0
|
1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// textendedbitmap.h
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
/**
|
sl@0
|
19 |
@file
|
sl@0
|
20 |
@test
|
sl@0
|
21 |
@internalComponent - Internal Symbian test code
|
sl@0
|
22 |
*/
|
sl@0
|
23 |
|
sl@0
|
24 |
#ifndef TEXTENDEDBITMAPGC_H
|
sl@0
|
25 |
#define TEXTENDEDBITMAPGC_H
|
sl@0
|
26 |
|
sl@0
|
27 |
#include <test/testexecutestepbase.h>
|
sl@0
|
28 |
#include <test/testharnesscallback.h>
|
sl@0
|
29 |
#include <w32std.h>
|
sl@0
|
30 |
|
sl@0
|
31 |
/** Test class for testing the operation of extended bitmaps with different graphics
|
sl@0
|
32 |
contexts. Creators of this test class must provide a pointer to a MTestHarnessCallBack object
|
sl@0
|
33 |
and a CBitmapContext. The MTestHarnessCallBack callback object allows CTExtendedBitmapGc to
|
sl@0
|
34 |
pass logging and test status operations back to the creator. All drawing operations that this
|
sl@0
|
35 |
test class performs are drawn to the supplied CBitmapContext object.
|
sl@0
|
36 |
*/
|
sl@0
|
37 |
class CTExtendedBitmapGc : public CBase
|
sl@0
|
38 |
{
|
sl@0
|
39 |
public:
|
sl@0
|
40 |
/** Stripe styles that are supported by the example bitmap example rasterizer, note that only
|
sl@0
|
41 |
vertical and horizontal stripes are supported
|
sl@0
|
42 |
*/
|
sl@0
|
43 |
enum TStripeStyle
|
sl@0
|
44 |
{
|
sl@0
|
45 |
EVerticalStripe = 0,
|
sl@0
|
46 |
EHorizontalStripe = 1
|
sl@0
|
47 |
};
|
sl@0
|
48 |
|
sl@0
|
49 |
/** Defines whether this class should draw extended bitmaps as flags, or as plain white
|
sl@0
|
50 |
rectangles. EDrawFlag should be used when testing with BitGdi where the example rasterizer
|
sl@0
|
51 |
is available, or when testing with WServ where the example extended bitmap render stage is
|
sl@0
|
52 |
available. Otherwise EDrawWhite should be used. It is up to the creator of CTExtendedBitmapGc
|
sl@0
|
53 |
to decide which draw mode should be used.
|
sl@0
|
54 |
*/
|
sl@0
|
55 |
enum TDrawMode
|
sl@0
|
56 |
{
|
sl@0
|
57 |
EDrawFlag,
|
sl@0
|
58 |
EDrawWhite
|
sl@0
|
59 |
};
|
sl@0
|
60 |
|
sl@0
|
61 |
public:
|
sl@0
|
62 |
IMPORT_C static CTExtendedBitmapGc* NewL(MTestHarnessCallBack* aCallBack, CBitmapContext& aGc, TDrawMode aDrawMode, TDisplayMode aDisplayMode);
|
sl@0
|
63 |
IMPORT_C ~CTExtendedBitmapGc();
|
sl@0
|
64 |
IMPORT_C void RunTestCaseL(TInt aCurTestCase);
|
sl@0
|
65 |
|
sl@0
|
66 |
// Helper functions
|
sl@0
|
67 |
IMPORT_C static void WriteExtendedBitmapInfoL(TUint8* aData,
|
sl@0
|
68 |
TInt& aDataSize,
|
sl@0
|
69 |
const TRgb* aColorArray,
|
sl@0
|
70 |
TStripeStyle aStripeStyle);
|
sl@0
|
71 |
|
sl@0
|
72 |
private:
|
sl@0
|
73 |
// Construction
|
sl@0
|
74 |
CTExtendedBitmapGc(MTestHarnessCallBack* aCallBack, CBitmapContext& aGc, TDrawMode aDrawMode);
|
sl@0
|
75 |
void ConstructL(TDisplayMode aDisplayMode);
|
sl@0
|
76 |
|
sl@0
|
77 |
// Test cases
|
sl@0
|
78 |
void TestBitmapDrawingL(TBool aTestRegionOfInterest, TStripeStyle aStripeStyle, TInt aCaseNumber);
|
sl@0
|
79 |
void TestBrushPatternL(TInt aCaseNumber);
|
sl@0
|
80 |
|
sl@0
|
81 |
// Helper functions
|
sl@0
|
82 |
void CreateTestBitmapLC(CFbsBitmap*& aBmpRet,
|
sl@0
|
83 |
const TSize& aSize,
|
sl@0
|
84 |
TDisplayMode aDisplayMode,
|
sl@0
|
85 |
const TRgb& aColor1,
|
sl@0
|
86 |
const TRgb& aColor2,
|
sl@0
|
87 |
const TRgb& aColor3,
|
sl@0
|
88 |
TStripeStyle aStripeStyle);
|
sl@0
|
89 |
|
sl@0
|
90 |
CTestExecuteLogger& Logger() {return iCallBack->Logger();}
|
sl@0
|
91 |
|
sl@0
|
92 |
private:
|
sl@0
|
93 |
MTestHarnessCallBack* iCallBack;
|
sl@0
|
94 |
TDrawMode iDrawMode;
|
sl@0
|
95 |
TDisplayMode iDisplayMode;
|
sl@0
|
96 |
CBitmapContext& iGc;
|
sl@0
|
97 |
TBool iIsFbs;
|
sl@0
|
98 |
CFont* iFont;
|
sl@0
|
99 |
};
|
sl@0
|
100 |
|
sl@0
|
101 |
#endif // TEXTENDEDBITMAPGC_H
|