Classes | Static Public Member Functions | Static Protected Member Functions | Friends

gfxTextRunCache Class Reference

A simple textrun cache for textruns that do not carry state (e.g., actual or potential linebreaks) and do not need complex initialization. More...

#include <gfxTextRunCache.h>

List of all members.

Classes

class  AutoTextRun

Static Public Member Functions

static gfxTextRunMakeTextRun (const PRUnichar *aText, PRUint32 aLength, gfxFontGroup *aFontGroup, gfxContext *aRefContext, PRUint32 aAppUnitsPerDevUnit, PRUint32 aFlags)
 Get a textrun for the given text, using a global cache.
static gfxTextRunMakeTextRun (const PRUnichar *aText, PRUint32 aLength, gfxFontGroup *aFontGroup, const gfxTextRunFactory::Parameters *aParams, PRUint32 aFlags)
 As above, but allows a full Parameters object to be passed in.
static gfxTextRunMakeTextRun (const PRUint8 *aText, PRUint32 aLength, gfxFontGroup *aFontGroup, gfxContext *aRefContext, PRUint32 aAppUnitsPerDevUnit, PRUint32 aFlags)
 Get a textrun for the given text, using a global cache.
static void ReleaseTextRun (gfxTextRun *aTextRun)
 Release a previously acquired textrun.

Static Protected Member Functions

static nsresult Init ()
static void Shutdown ()

Friends

class gfxPlatform

Detailed Description

A simple textrun cache for textruns that do not carry state (e.g., actual or potential linebreaks) and do not need complex initialization.

The lifetimes of these textruns are managed by the cache (they are auto-expired after a certain period of time).


Member Function Documentation

static nsresult gfxTextRunCache::Init (  )  [static, protected]
static gfxTextRun* gfxTextRunCache::MakeTextRun ( const PRUnichar aText,
PRUint32  aLength,
gfxFontGroup aFontGroup,
gfxContext aRefContext,
PRUint32  aAppUnitsPerDevUnit,
PRUint32  aFlags 
) [static]

Get a textrun for the given text, using a global cache.

The textrun must be released via ReleaseTextRun, not deleted. Do not set any state in the textrun (e.g. actual or potential linebreaks). Flags IS_8BIT and IS_ASCII are automatically set appropriately. Flag IS_PERSISTENT must NOT be set unless aText is guaranteed to live forever. The string can contain any characters, invalid ones will be stripped properly.

static gfxTextRun* gfxTextRunCache::MakeTextRun ( const PRUnichar aText,
PRUint32  aLength,
gfxFontGroup aFontGroup,
const gfxTextRunFactory::Parameters aParams,
PRUint32  aFlags 
) [static]

As above, but allows a full Parameters object to be passed in.

static gfxTextRun* gfxTextRunCache::MakeTextRun ( const PRUint8 *  aText,
PRUint32  aLength,
gfxFontGroup aFontGroup,
gfxContext aRefContext,
PRUint32  aAppUnitsPerDevUnit,
PRUint32  aFlags 
) [static]

Get a textrun for the given text, using a global cache.

The textrun must be released via ReleaseTextRun, not deleted. Do not set any state in the textrun (e.g. actual or potential linebreaks). Flags IS_8BIT, IS_ASCII and HAS_SURROGATES are automatically set appropriately. Flag IS_PERSISTENT must NOT be set unless aText is guaranteed to live forever. The string can contain any characters, invalid ones will be stripped properly.

static void gfxTextRunCache::ReleaseTextRun ( gfxTextRun aTextRun  )  [static]

Release a previously acquired textrun.

Consider using AutoTextRun instead of calling this.

static void gfxTextRunCache::Shutdown (  )  [static, protected]

Friends And Related Function Documentation

friend class gfxPlatform [friend]

The documentation for this class was generated from the following file: