1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicstest/uibench/src/tfbsglyphdata.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,100 @@
1.4 +// Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @test
1.22 + @internalComponent - Internal Symbian test code
1.23 +*/
1.24 +
1.25 +#ifndef TFBSGLYPHDATA_H
1.26 +#define TFBSGLYPHDATA_H
1.27 +
1.28 +#include <fbs.h>
1.29 +#include <sgresource/sgresource.h>
1.30 +#include "te_graphicsperformanceSuiteStepBase.h"
1.31 +class CCharCodeConverter;
1.32 +
1.33 +/**
1.34 +Enumeration of languages that are supported for testing in this framework.
1.35 + */
1.36 +enum TTestLanguage
1.37 + {
1.38 + ETestLanguageLatin,
1.39 + ETestLanguageHindi
1.40 + };
1.41 +
1.42 +/**
1.43 +Test case to test the performance of RFbsGlyphDataIterator and RFbsGlyphMetricsArray.
1.44 +*/
1.45 +class CTFbsGlyphData : public CTe_graphicsperformanceSuiteStepBase
1.46 + {
1.47 +public:
1.48 + CTFbsGlyphData();
1.49 + ~CTFbsGlyphData();
1.50 +
1.51 + // From CTe_graphicsperformanceSuiteStepBase
1.52 + virtual TVerdict doTestStepPreambleL();
1.53 + virtual TVerdict doTestStepPostambleL();
1.54 + virtual TVerdict doTestStepL();
1.55 + virtual CFbsBitmap* GetTargetAsBitmapL();
1.56 +
1.57 +private:
1.58 + // Tests
1.59 + void GlyphMetricsArrayL(TTestLanguage aLanguage, TBool aLongData, TInt aReps);
1.60 + void GlyphMetricsQuerySingleGlyphL();
1.61 + void GlyphDataIteratorOpenL(TTestLanguage aLanguage, TBool aLongData, TInt aReps);
1.62 + void GlyphDataIteratorOpenSingleFontL();
1.63 + void GlyphMetricsQueryUnrasterizedL();
1.64 + void GlyphMetricsQueryPreRasterizedL();
1.65 + void GlyphRenderingL();
1.66 +
1.67 + // Utility methods
1.68 + void LoadConfigSampleDataL(CFbsFont* aFont, TTestLanguage aLanguage, TBool aLongData, TUint*& aGlyphCodes, TInt& aNumGlyphCodes);
1.69 + static TBufC<32> ConfigKeyNameL(TTestLanguage aLanguage, TBool aLongData);
1.70 +
1.71 +private:
1.72 + RFbsSession iFbs;
1.73 + RSgDriver iSgDriver;
1.74 + CCharCodeConverter* iCharCodeConverter;
1.75 + };
1.76 +
1.77 +_LIT(KTFbsGlyphData,"tfbsglyphdata");
1.78 +
1.79 +/**
1.80 +Utility class. Provides the tests with a number of different fonts to use.
1.81 +Manages their creation and destruction.
1.82 + */
1.83 +class CTFontFactory : public CBase
1.84 + {
1.85 +public:
1.86 + static CTFontFactory* NewLC();
1.87 + ~CTFontFactory();
1.88 +
1.89 + void CreateFontsL(TTestLanguage aLanguageMask, TInt aNumFonts, TInt aStartSizeInPixels = 5);
1.90 + TInt NumFonts() const;
1.91 + CFbsFont* NextFont();
1.92 + void ReleaseFonts();
1.93 +private:
1.94 + CTFontFactory();
1.95 +private:
1.96 + CFbsFont** iFont;
1.97 + TInt iNumFonts;
1.98 + TInt iCurFont;
1.99 + CFbsTypefaceStore* iTs;
1.100 + };
1.101 +
1.102 +
1.103 +#endif /* TFBSGLYPHDATA_H */