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