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