os/graphics/graphicstest/uibench/src/tfbsfonthandleperf.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2005-2010 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 DoAddAndRemoveFilesL(TBool aTestOpenFont, CFontStore* aFontStore);
    84 	void AddingOpenedFontFilesL(TBool aTestOpenFont);
    85 	void FontDrawTextGlyphCacheL(const TDesC& aFontName, const TDesC& aTestName, const TDesC& aOutputText);
    86 	void FontDrawStringWithoutGlyphCacheL(const TDesC& aFontName, const TDesC& aTestName, TInt aFontHeight,const TDesC& aOutputString);
    87 	void FindFontSizeL();
    88 	void NonAliasedFontCreationL();
    89 	void AliasedFontCreationL();
    90 	void FontCreationPerformanceL(CFbsTypefaceStore* aTs, const TDesC& aFontName, const TDesC& aTestDescription);
    91 
    92 	// From CStepStep
    93 	virtual TVerdict doTestStepPreambleL();
    94 	virtual TVerdict doTestStepL();
    95 
    96 private:
    97 	CBitmapDevice* iDevice;	
    98 	};
    99 	
   100 _LIT(KTFbsFontHandlePerfName,"tfbsfonthandleperf");
   101 
   102 #endif