graphicstest/uibench/src/tfbsfontrasterizeperf.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 04 Oct 2010 02:31:51 +0300
changeset 194 18f84489a694
permissions -rw-r--r--
Revision: 201039 Kit: 201039

// Copyright (c)2010 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// tfbsfontrasterizeperf.h
// 
//

/**
 @file
 @test
 @internalComponent - Internal test code 
*/
 
#ifndef __TFBSFONTRASTERIZEPERF_H__
#define __TFBSFONTRASTERIZEPERF_H__

#include "te_graphicsperformanceSuiteStepBase.h"
#include <test/ttmsgraphicsstep.h>
#include <graphics/openfontrasterizer.h>

class CTFbsFontRasterizePerf : public CTe_graphicsperformanceSuiteStepBase
	{
public:
    CTFbsFontRasterizePerf();
	
private:
    class TCacheTestParam
        {
    public:
        enum TLang
            {
            ELatin,
            EChinese
            };
        static const TPtrC KLangText[];
        
        TInt iHeight;
        TGlyphBitmapType iGlyphBitmapType;
        TLang iLang;
        const TDesC& iText;
        TInt iFrom;
        TInt iTo;
        };
   
	void GlyphCacheNotFullL();
	void GlyphCacheFullLSessionCacheNotFullL();
	void GlyphCacheFullLSessionCacheFullL();
    void DoCacheTestL(CFbsTypefaceStore* aTs, const TCacheTestParam& aParam, const TDesC& aTestName);    
    void TestItypeRasterizeL();
    void DoTestItypeRasterizeL(RHeap* aHeap, const TCacheTestParam& aParam, TOpenFontGlyphData* aGlyphData);
    void TestLoadFontsAtStartupL();

    struct TMultiThreadPara
        {
        // Input parameters
        TFontSpec * iSpec;
        TPtrC       iFileName; 
        
        // WriteBack parameters
        TUint32     iTimeMax;
        TUint32     iTimeMin;
        TUint32     iMean;
        TUint32     iIters;
        };

    void FontGetCharacterDataMultiSessionL();
    void DoFontGetCharacterDataMultiSessionL(TFontSpec& aFontSpec);
    
    static TInt FontGetCharacterDataThread(TAny *);
    static void FontGetCharacterDataWorkerL(TMultiThreadPara *aPara);
    
	// From CStepStep
	virtual TVerdict doTestStepPreambleL();
	virtual TVerdict doTestStepL();
	};
	
_LIT(KTFbsFontRasterizePerfName,"tfbsfontrasterizeperf");

#endif