os/textandloc/fontservices/fontstore/src/ShaperCache.H
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/textandloc/fontservices/fontstore/src/ShaperCache.H	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,73 @@
     1.4 +/*
     1.5 +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +* SHAPERCACHE.CPP
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +#include <fntstore.h>
    1.24 +#include <gdi.h>
    1.25 +#include "FNTSTD.H"
    1.26 +#include <graphics/shapeimpl.h>
    1.27 +
    1.28 +const TInt KMaxShaperSesssionCacheMemory = 64*1024;
    1.29 +
    1.30 +//class to store the handle the handle-reference count
    1.31 +class THandleCount
    1.32 +	{
    1.33 +public:
    1.34 +	THandleCount(TInt aSessionHandle)
    1.35 +	:iSessionHandle(aSessionHandle),iRefCount(1),iNext(NULL){}	
    1.36 +public:
    1.37 +	TInt iSessionHandle;
    1.38 +	TInt iRefCount;
    1.39 +	THandleCount* iNext;	
    1.40 +	};
    1.41 +
    1.42 +/******************** SHAPER CACHE CLASSES*************************************/	
    1.43 +class COpenFontShaperCacheEntry: public CBase
    1.44 +	{
    1.45 +public:
    1.46 +	static COpenFontShaperCacheEntry* New(RHeap* aHeap, CShaper::TInput aInput, TShapeHeader* aShapeHeader);
    1.47 +	static COpenFontShaperCacheEntry* New(RHeap* aHeap);
    1.48 +	static void Delete (RHeap* aHeap, COpenFontShaperCacheEntry* aCache);	
    1.49 +	TBool IsSentinel(){return iShapeHeader==NULL;}
    1.50 +	TInt IncRefCount(TInt aSessionHandle);
    1.51 +	TInt DecRefCount(TInt aSessionHandle,TBool aReset=EFalse);	
    1.52 +private:
    1.53 +	COpenFontShaperCacheEntry(RHeap* aHeap,CShaper::TInput aInput)
    1.54 +	:iStart(aInput.iStart),iEnd(aInput.iEnd),iScript(aInput.iScript), iHeap(aHeap){}
    1.55 +	COpenFontShaperCacheEntry(){}
    1.56 +	TInt Construct(CShaper::TInput aInput,TShapeHeader* aShapeHeader);
    1.57 +public:
    1.58 +	COpenFontShaperCacheEntry* iPrevious;	// pointer to previous node in tree
    1.59 +	COpenFontShaperCacheEntry* iNext;		// pointer to next shaping info node in the list
    1.60 +
    1.61 +	/** The shaped information that is cached */
    1.62 +	TShapeHeader* iShapeHeader;
    1.63 +	/** Input information */
    1.64 +	TUint16* iText;
    1.65 +	TInt iStart;
    1.66 +	TInt iEnd;
    1.67 +	TInt iScript;
    1.68 +	/** pointer to a private heap for allocating the handle-refcount array*/
    1.69 +	RHeap* iHeap;
    1.70 +	/** linked list of THandleCount to store the handle-refcount information */
    1.71 +	THandleCount* iHandleRefList;
    1.72 +	TInt iHandleRefCount;
    1.73 +	};
    1.74 +	
    1.75 +/***********************SHAPER CACHE ENDS HERE********************************/
    1.76 +