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