LibreOffice Module vcl (master) 1
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
SalLayoutGlyphsCache Class Referencefinal

A cache for SalLayoutGlyphs objects. More...

#include <glyphitemcache.hxx>

Collaboration diagram for SalLayoutGlyphsCache:
[legend]

Classes

struct  CachedGlyphsHash
 
struct  CachedGlyphsKey
 
struct  GlyphsCost
 

Public Member Functions

const SalLayoutGlyphsGetLayoutGlyphs (VclPtr< const OutputDevice > outputDevice, const OUString &text, const vcl::text::TextLayoutCache *layoutCache=nullptr)
 
const SalLayoutGlyphsGetLayoutGlyphs (VclPtr< const OutputDevice > outputDevice, const OUString &text, sal_Int32 nIndex, sal_Int32 nLen, tools::Long nLogicWidth=0, const vcl::text::TextLayoutCache *layoutCache=nullptr)
 
void clear ()
 
 SalLayoutGlyphsCache (int size)
 

Static Public Member Functions

static SalLayoutGlyphsCacheself ()
 

Private Types

typedef o3tl::lru_map< CachedGlyphsKey, SalLayoutGlyphs, CachedGlyphsHash, std::equal_to< CachedGlyphsKey >, GlyphsCostGlyphsCache
 

Private Member Functions

 SalLayoutGlyphsCache (const SalLayoutGlyphsCache &)=delete
 
SalLayoutGlyphsCacheoperator= (const SalLayoutGlyphsCache &)=delete
 

Private Attributes

GlyphsCache mCachedGlyphs
 
std::optional< CachedGlyphsKeymLastTemporaryKey
 
SalLayoutGlyphs mLastTemporaryGlyphs
 
std::optional< CachedGlyphsKeymLastSubstringKey
 

Detailed Description

A cache for SalLayoutGlyphs objects.

Allows caching for OutputDevice::DrawText() and similar calls. Pass the text and the output device for the call to OutputDevice::ImplLayout(). Items are cached per output device and its font. If something more changes, call clear().

Definition at line 43 of file glyphitemcache.hxx.

Member Typedef Documentation

◆ GlyphsCache

Definition at line 95 of file glyphitemcache.hxx.

Constructor & Destructor Documentation

◆ SalLayoutGlyphsCache() [1/2]

SalLayoutGlyphsCache::SalLayoutGlyphsCache ( int  size)
inline

Definition at line 61 of file glyphitemcache.hxx.

References size.

◆ SalLayoutGlyphsCache() [2/2]

SalLayoutGlyphsCache::SalLayoutGlyphsCache ( const SalLayoutGlyphsCache )
privatedelete

Member Function Documentation

◆ clear()

void SalLayoutGlyphsCache::clear ( )

◆ GetLayoutGlyphs() [1/2]

const SalLayoutGlyphs * SalLayoutGlyphsCache::GetLayoutGlyphs ( VclPtr< const OutputDevice outputDevice,
const OUString &  text,
const vcl::text::TextLayoutCache layoutCache = nullptr 
)
inline

Definition at line 48 of file glyphitemcache.hxx.

References text().

Referenced by GetLayoutGlyphs().

◆ GetLayoutGlyphs() [2/2]

const SalLayoutGlyphs * SalLayoutGlyphsCache::GetLayoutGlyphs ( VclPtr< const OutputDevice outputDevice,
const OUString &  text,
sal_Int32  nIndex,
sal_Int32  nLen,
tools::Long  nLogicWidth = 0,
const vcl::text::TextLayoutCache layoutCache = nullptr 
)

◆ operator=()

SalLayoutGlyphsCache & SalLayoutGlyphsCache::operator= ( const SalLayoutGlyphsCache )
privatedelete

◆ self()

SalLayoutGlyphsCache * SalLayoutGlyphsCache::self ( )
static

Member Data Documentation

◆ mCachedGlyphs

GlyphsCache SalLayoutGlyphsCache::mCachedGlyphs
private

Definition at line 96 of file glyphitemcache.hxx.

Referenced by clear(), and GetLayoutGlyphs().

◆ mLastSubstringKey

std::optional<CachedGlyphsKey> SalLayoutGlyphsCache::mLastSubstringKey
private

Definition at line 101 of file glyphitemcache.hxx.

Referenced by GetLayoutGlyphs().

◆ mLastTemporaryGlyphs

SalLayoutGlyphs SalLayoutGlyphsCache::mLastTemporaryGlyphs
private

Definition at line 99 of file glyphitemcache.hxx.

Referenced by GetLayoutGlyphs().

◆ mLastTemporaryKey

std::optional<CachedGlyphsKey> SalLayoutGlyphsCache::mLastTemporaryKey
private

Definition at line 98 of file glyphitemcache.hxx.

Referenced by GetLayoutGlyphs().


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