|
1 // Copyright (c) 2005-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 // fbsfonthandleperf.h |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @test |
|
21 @internalComponent - Internal Symbian test code |
|
22 */ |
|
23 |
|
24 #ifndef __TFBSFONTHANDLEPERF_H__ |
|
25 #define __TFBSFONTHANDLEPERF_H__ |
|
26 |
|
27 #include "te_graphicsperformanceSuiteStepBase.h" |
|
28 #include <test/ttmsgraphicsstep.h> |
|
29 #include <graphics/openfontrasterizer.h> |
|
30 |
|
31 //******** CDummyFontFile **********// |
|
32 |
|
33 class CDummyFontFile: public COpenFontFile |
|
34 { |
|
35 public: |
|
36 static CDummyFontFile* NewL(TInt aUid,const TDesC& aFileName); |
|
37 private: |
|
38 CDummyFontFile(TInt aUid,const TDesC& aFileName); |
|
39 ~CDummyFontFile(); |
|
40 void ConstructL(); |
|
41 void GetNearestFontInPixelsL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList, |
|
42 const TOpenFontSpec& aDesiredFontSpec,TInt aPixelWidth,TInt aPixelHeight, |
|
43 COpenFont*& aFont,TOpenFontSpec& aActualFontSpec); |
|
44 TBool HasUnicodeCharacterL(TInt /*aFaceIndex*/,TInt /*aCode*/) const; |
|
45 private: |
|
46 RFs iFs; |
|
47 RFile iFile; |
|
48 }; |
|
49 |
|
50 //********** CDummyRasterizer **********// |
|
51 |
|
52 class CDummyRasterizer: public COpenFontRasterizer |
|
53 { |
|
54 public: |
|
55 static CDummyRasterizer* NewL(); |
|
56 // virtual function from COpenFontRasterizer |
|
57 COpenFontFile* NewFontFileL(TInt aUid,const TDesC& aFileName,RFs& aFileSession); |
|
58 }; |
|
59 |
|
60 //*********** CDummy Font **********************// |
|
61 class CDummyFont: public COpenFont |
|
62 { |
|
63 public: |
|
64 static CDummyFont* NewL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,CDummyFontFile* aFontFile,TInt aSizeInPixels); |
|
65 private: |
|
66 CDummyFont(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,CDummyFontFile* aFontFile,TInt aSizeInPixels); |
|
67 // From COpenFont |
|
68 virtual void RasterizeL(TInt aCode,TOpenFontGlyphData* aGlyphData); |
|
69 inline void operator delete (TAny *){} //to avoid warning |
|
70 inline void operator delete (TAny *, TAny* ){} //to avoid warning |
|
71 }; |
|
72 |
|
73 |
|
74 class CTFbsFontHandlePerf : public CTe_graphicsperformanceSuiteStepBase |
|
75 { |
|
76 public: |
|
77 CTFbsFontHandlePerf(); |
|
78 |
|
79 private: |
|
80 void FontDuplicateL(); |
|
81 void FontGetNearestFontToDesignHeightInPixelsL(const TDesC& aFontName, const TDesC& aTestName); |
|
82 void AddAndRemoveFilesL(TBool aTestOpenFont); |
|
83 void AddingOpenedFontFilesL(TBool aTestOpenFont); |
|
84 void FontDrawTextGlyphCacheL(const TDesC& aFontName, const TDesC& aTestName, const TDesC& aOutputText); |
|
85 void FontDrawStringWithoutGlyphCacheL(const TDesC& aFontName, const TDesC& aTestName, TInt aFontHeight,const TDesC& aOutputString); |
|
86 void FindFontSizeL(); |
|
87 void NonAliasedFontCreationL(); |
|
88 void AliasedFontCreationL(); |
|
89 void FontCreationPerformanceL(CFbsTypefaceStore* aTs, const TDesC& aFontName, const TDesC& aTestDescription); |
|
90 |
|
91 // From CStepStep |
|
92 virtual TVerdict doTestStepPreambleL(); |
|
93 virtual TVerdict doTestStepL(); |
|
94 |
|
95 private: |
|
96 CBitmapDevice* iDevice; |
|
97 }; |
|
98 |
|
99 _LIT(KTFbsFontHandlePerfName,"tfbsfonthandleperf"); |
|
100 |
|
101 #endif |