LibreOffice Module vcl (master) 1
|
A cache for SalLayoutGlyphs objects. More...
#include <glyphitemcache.hxx>
Classes | |
struct | CachedGlyphsHash |
struct | CachedGlyphsKey |
struct | GlyphsCost |
Public Member Functions | |
const SalLayoutGlyphs * | GetLayoutGlyphs (VclPtr< const OutputDevice > outputDevice, const OUString &text, const vcl::text::TextLayoutCache *layoutCache=nullptr) |
const SalLayoutGlyphs * | GetLayoutGlyphs (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 SalLayoutGlyphsCache * | self () |
Private Types | |
typedef o3tl::lru_map< CachedGlyphsKey, SalLayoutGlyphs, CachedGlyphsHash, std::equal_to< CachedGlyphsKey >, GlyphsCost > | GlyphsCache |
Private Member Functions | |
SalLayoutGlyphsCache (const SalLayoutGlyphsCache &)=delete | |
SalLayoutGlyphsCache & | operator= (const SalLayoutGlyphsCache &)=delete |
Private Attributes | |
GlyphsCache | mCachedGlyphs |
std::optional< CachedGlyphsKey > | mLastTemporaryKey |
SalLayoutGlyphs | mLastTemporaryGlyphs |
std::optional< CachedGlyphsKey > | mLastSubstringKey |
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.
|
private |
Definition at line 95 of file glyphitemcache.hxx.
|
inline |
Definition at line 61 of file glyphitemcache.hxx.
References size.
|
privatedelete |
void SalLayoutGlyphsCache::clear | ( | ) |
Definition at line 233 of file impglyphitem.cxx.
References o3tl::lru_map< typename Key, typename Value, class KeyHash, class KeyEqual, class ValueSize >::clear(), and mCachedGlyphs.
|
inline |
Definition at line 48 of file glyphitemcache.hxx.
References text().
Referenced by GetLayoutGlyphs().
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 |
||
) |
Definition at line 347 of file impglyphitem.cxx.
References o3tl::lru_map< typename Key, typename Value, class KeyHash, class KeyEqual, class ValueSize >::begin(), vcl::text::BiDiStrong, checkGlyphsEqual(), vcl::text::TextLayoutCache::Create(), o3tl::lru_map< typename Key, typename Value, class KeyHash, class KeyEqual, class ValueSize >::end(), o3tl::lru_map< typename Key, typename Value, class KeyHash, class KeyEqual, class ValueSize >::find(), GetLayoutGlyphs(), OutputDevice::GetLayoutMode(), GlyphItemsOnly, SalLayoutGlyphs::Impl(), OutputDevice::ImplLayout(), o3tl::lru_map< typename Key, typename Value, class KeyHash, class KeyEqual, class ValueSize >::insert(), SalLayoutGlyphs::IsValid(), makeGlyphsSubset(), mCachedGlyphs, mLastSubstringKey, mLastTemporaryGlyphs, mLastTemporaryKey, nIndex, Point, pos, and text().
|
privatedelete |
|
static |
Definition at line 235 of file impglyphitem.cxx.
References vcl::DeleteOnDeinit< T >::get(), and utl::ConfigManager::IsFuzzing().
Referenced by vcl::PDFWriterImpl::drawStretchText(), vcl::PDFWriterImpl::drawText(), vcl::PDFWriterImpl::drawTextArray(), and StatusBar::SetItemText().
|
private |
Definition at line 96 of file glyphitemcache.hxx.
Referenced by clear(), and GetLayoutGlyphs().
|
private |
Definition at line 101 of file glyphitemcache.hxx.
Referenced by GetLayoutGlyphs().
|
private |
Definition at line 99 of file glyphitemcache.hxx.
Referenced by GetLayoutGlyphs().
|
private |
Definition at line 98 of file glyphitemcache.hxx.
Referenced by GetLayoutGlyphs().