sl@0: // Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // fbsfonthandleperf.h sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @test sl@0: @internalComponent - Internal Symbian test code sl@0: */ sl@0: sl@0: #ifndef __TFBSFONTHANDLEPERF_H__ sl@0: #define __TFBSFONTHANDLEPERF_H__ sl@0: sl@0: #include "te_graphicsperformanceSuiteStepBase.h" sl@0: #include sl@0: #include sl@0: sl@0: //******** CDummyFontFile **********// sl@0: sl@0: class CDummyFontFile: public COpenFontFile sl@0: { sl@0: public: sl@0: static CDummyFontFile* NewL(TInt aUid,const TDesC& aFileName); sl@0: private: sl@0: CDummyFontFile(TInt aUid,const TDesC& aFileName); sl@0: ~CDummyFontFile(); sl@0: void ConstructL(); sl@0: void GetNearestFontInPixelsL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList, sl@0: const TOpenFontSpec& aDesiredFontSpec,TInt aPixelWidth,TInt aPixelHeight, sl@0: COpenFont*& aFont,TOpenFontSpec& aActualFontSpec); sl@0: TBool HasUnicodeCharacterL(TInt /*aFaceIndex*/,TInt /*aCode*/) const; sl@0: private: sl@0: RFs iFs; sl@0: RFile iFile; sl@0: }; sl@0: sl@0: //********** CDummyRasterizer **********// sl@0: sl@0: class CDummyRasterizer: public COpenFontRasterizer sl@0: { sl@0: public: sl@0: static CDummyRasterizer* NewL(); sl@0: // virtual function from COpenFontRasterizer sl@0: COpenFontFile* NewFontFileL(TInt aUid,const TDesC& aFileName,RFs& aFileSession); sl@0: }; sl@0: sl@0: //*********** CDummy Font **********************// sl@0: class CDummyFont: public COpenFont sl@0: { sl@0: public: sl@0: static CDummyFont* NewL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,CDummyFontFile* aFontFile,TInt aSizeInPixels); sl@0: private: sl@0: CDummyFont(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,CDummyFontFile* aFontFile,TInt aSizeInPixels); sl@0: // From COpenFont sl@0: virtual void RasterizeL(TInt aCode,TOpenFontGlyphData* aGlyphData); sl@0: inline void operator delete (TAny *){} //to avoid warning sl@0: inline void operator delete (TAny *, TAny* ){} //to avoid warning sl@0: }; sl@0: sl@0: sl@0: class CTFbsFontHandlePerf : public CTe_graphicsperformanceSuiteStepBase sl@0: { sl@0: public: sl@0: CTFbsFontHandlePerf(); sl@0: sl@0: private: sl@0: void FontDuplicateL(); sl@0: void FontGetNearestFontToDesignHeightInPixelsL(const TDesC& aFontName, const TDesC& aTestName); sl@0: void AddAndRemoveFilesL(TBool aTestOpenFont); sl@0: void DoAddAndRemoveFilesL(TBool aTestOpenFont, CFontStore* aFontStore); sl@0: void AddingOpenedFontFilesL(TBool aTestOpenFont); sl@0: void FontDrawTextGlyphCacheL(const TDesC& aFontName, const TDesC& aTestName, const TDesC& aOutputText); sl@0: void FontDrawStringWithoutGlyphCacheL(const TDesC& aFontName, const TDesC& aTestName, TInt aFontHeight,const TDesC& aOutputString); sl@0: void FindFontSizeL(); sl@0: void NonAliasedFontCreationL(); sl@0: void AliasedFontCreationL(); sl@0: void FontCreationPerformanceL(CFbsTypefaceStore* aTs, const TDesC& aFontName, const TDesC& aTestDescription); sl@0: sl@0: // From CStepStep sl@0: virtual TVerdict doTestStepPreambleL(); sl@0: virtual TVerdict doTestStepL(); sl@0: sl@0: private: sl@0: CBitmapDevice* iDevice; sl@0: }; sl@0: sl@0: _LIT(KTFbsFontHandlePerfName,"tfbsfonthandleperf"); sl@0: sl@0: #endif