sl@0
|
1 |
// Copyright (c) 2009-2010 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 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
/**
|
sl@0
|
17 |
@file
|
sl@0
|
18 |
@test
|
sl@0
|
19 |
@internalComponent - Internal Symbian test code
|
sl@0
|
20 |
*/
|
sl@0
|
21 |
|
sl@0
|
22 |
#ifndef TFBSGLYPHDATA_H
|
sl@0
|
23 |
#define TFBSGLYPHDATA_H
|
sl@0
|
24 |
|
sl@0
|
25 |
#include <fbs.h>
|
sl@0
|
26 |
#include <sgresource/sgresource.h>
|
sl@0
|
27 |
#include "te_graphicsperformanceSuiteStepBase.h"
|
sl@0
|
28 |
class CCharCodeConverter;
|
sl@0
|
29 |
|
sl@0
|
30 |
/**
|
sl@0
|
31 |
Enumeration of languages that are supported for testing in this framework.
|
sl@0
|
32 |
*/
|
sl@0
|
33 |
enum TTestLanguage
|
sl@0
|
34 |
{
|
sl@0
|
35 |
ETestLanguageLatin,
|
sl@0
|
36 |
ETestLanguageHindi
|
sl@0
|
37 |
};
|
sl@0
|
38 |
|
sl@0
|
39 |
/**
|
sl@0
|
40 |
Test case to test the performance of RFbsGlyphDataIterator and RFbsGlyphMetricsArray.
|
sl@0
|
41 |
*/
|
sl@0
|
42 |
class CTFbsGlyphData : public CTe_graphicsperformanceSuiteStepBase
|
sl@0
|
43 |
{
|
sl@0
|
44 |
public:
|
sl@0
|
45 |
CTFbsGlyphData();
|
sl@0
|
46 |
~CTFbsGlyphData();
|
sl@0
|
47 |
|
sl@0
|
48 |
// From CTe_graphicsperformanceSuiteStepBase
|
sl@0
|
49 |
virtual TVerdict doTestStepPreambleL();
|
sl@0
|
50 |
virtual TVerdict doTestStepPostambleL();
|
sl@0
|
51 |
virtual TVerdict doTestStepL();
|
sl@0
|
52 |
virtual CFbsBitmap* GetTargetAsBitmapL();
|
sl@0
|
53 |
|
sl@0
|
54 |
private:
|
sl@0
|
55 |
// Tests
|
sl@0
|
56 |
void GlyphMetricsArrayL(TTestLanguage aLanguage, TBool aLongData, TInt aReps);
|
sl@0
|
57 |
void GlyphMetricsQuerySingleGlyphL();
|
sl@0
|
58 |
void GlyphDataIteratorOpenL(TTestLanguage aLanguage, TBool aLongData, TInt aReps);
|
sl@0
|
59 |
void GlyphDataIteratorOpenSingleFontL();
|
sl@0
|
60 |
void GlyphMetricsQueryUnrasterizedL();
|
sl@0
|
61 |
void GlyphMetricsQueryPreRasterizedL();
|
sl@0
|
62 |
void GlyphRenderingL();
|
sl@0
|
63 |
|
sl@0
|
64 |
// Utility methods
|
sl@0
|
65 |
void LoadConfigSampleDataL(CFbsFont* aFont, TTestLanguage aLanguage, TBool aLongData, TUint*& aGlyphCodes, TInt& aNumGlyphCodes);
|
sl@0
|
66 |
static TBufC<32> ConfigKeyNameL(TTestLanguage aLanguage, TBool aLongData);
|
sl@0
|
67 |
|
sl@0
|
68 |
private:
|
sl@0
|
69 |
RFbsSession iFbs;
|
sl@0
|
70 |
RSgDriver iSgDriver;
|
sl@0
|
71 |
CCharCodeConverter* iCharCodeConverter;
|
sl@0
|
72 |
};
|
sl@0
|
73 |
|
sl@0
|
74 |
_LIT(KTFbsGlyphData,"tfbsglyphdata");
|
sl@0
|
75 |
|
sl@0
|
76 |
/**
|
sl@0
|
77 |
Utility class. Provides the tests with a number of different fonts to use.
|
sl@0
|
78 |
Manages their creation and destruction.
|
sl@0
|
79 |
*/
|
sl@0
|
80 |
class CTFontFactory : public CBase
|
sl@0
|
81 |
{
|
sl@0
|
82 |
public:
|
sl@0
|
83 |
static CTFontFactory* NewLC();
|
sl@0
|
84 |
~CTFontFactory();
|
sl@0
|
85 |
|
sl@0
|
86 |
void CreateFontsL(TTestLanguage aLanguageMask, TInt aNumFonts, TInt aStartSizeInPixels = 5);
|
sl@0
|
87 |
TInt NumFonts() const;
|
sl@0
|
88 |
CFbsFont* NextFont();
|
sl@0
|
89 |
void ReleaseFonts();
|
sl@0
|
90 |
private:
|
sl@0
|
91 |
CTFontFactory();
|
sl@0
|
92 |
private:
|
sl@0
|
93 |
CFbsFont** iFont;
|
sl@0
|
94 |
TInt iNumFonts;
|
sl@0
|
95 |
TInt iCurFont;
|
sl@0
|
96 |
CFbsTypefaceStore* iTs;
|
sl@0
|
97 |
};
|
sl@0
|
98 |
|
sl@0
|
99 |
|
sl@0
|
100 |
#endif /* TFBSGLYPHDATA_H */
|