summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2006-11-06 13:44:14 +0000
committerKurt Zenker <kz@openoffice.org>2006-11-06 13:44:14 +0000
commit3dd62ad57cfc376fcd7ccdcb8171fa112137b67f (patch)
treeec2f1480a02ec2a43c46e54035cb9d07c88a5219 /vcl
parentd9477599a88de2fe09df23256f375920fa71c8e3 (diff)
INTEGRATION: CWS dba21fini (1.44.44); FILE MERGED
2006/10/27 13:26:44 hdu 1.44.44.2: #i70946# cache font face specific notdef glyph only once 2006/10/27 10:40:44 hdu 1.44.44.1: #i70946# handle GetBitmap1()==false condition gracefully
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/source/gdi/gcach_xpeer.cxx26
1 files changed, 20 insertions, 6 deletions
diff --git a/vcl/unx/source/gdi/gcach_xpeer.cxx b/vcl/unx/source/gdi/gcach_xpeer.cxx
index 1d509bfe6b1d..a5467123f3ba 100644
--- a/vcl/unx/source/gdi/gcach_xpeer.cxx
+++ b/vcl/unx/source/gdi/gcach_xpeer.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: gcach_xpeer.cxx,v $
*
- * $Revision: 1.44 $
+ * $Revision: 1.45 $
*
- * last change: $Author: kz $ $Date: 2006-10-06 10:05:28 $
+ * last change: $Author: kz $ $Date: 2006-11-06 14:44:14 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -305,7 +305,7 @@ void X11GlyphPeer::SetDisplay( const SalDisplay& rSalDisplay )
enum { INFO_EMPTY=0, INFO_PIXMAP, INFO_XRENDER, INFO_RAWBMP, INFO_MULTISCREEN };
static const Glyph NO_GLYPHID = 0;
static RawBitmap* const NO_RAWBMP = NULL;
-static const Pixmap NO_PIXMAP = 0;
+static const Pixmap NO_PIXMAP = ~0;
// ---------------------------------------------------------------------------
@@ -313,18 +313,31 @@ MultiScreenGlyph* X11GlyphPeer::PrepareForMultiscreen( ExtGlyphData& rEGD ) cons
{
// prepare to store screen specific pixmaps
MultiScreenGlyph* pMSGlyph = (MultiScreenGlyph*)new char[ mnExtByteCount ];
+
+ // init the glyph formats
pMSGlyph->mpRawBitmap = NO_RAWBMP;
pMSGlyph->maXRGlyphId = NO_GLYPHID;
for( int i = 0; i < mnMaxScreens; ++i )
pMSGlyph->maPixmaps[i] = NO_PIXMAP;
+ // reuse already available glyph formats
if( rEGD.meInfo == INFO_XRENDER )
pMSGlyph->maXRGlyphId = reinterpret_cast<Glyph>(rEGD.mpData);
else if( rEGD.meInfo == INFO_RAWBMP )
pMSGlyph->mpRawBitmap = reinterpret_cast<RawBitmap*>(rEGD.mpData);
else if( rEGD.meInfo == INFO_PIXMAP )
- pMSGlyph->maPixmaps[ mnDefaultScreen ] = reinterpret_cast<Pixmap>(rEGD.mpData);
+ {
+ Pixmap aPixmap = reinterpret_cast<Pixmap>(rEGD.mpData);
+ if( aPixmap != None )
+ // pixmap for the default screen is available
+ pMSGlyph->maPixmaps[ mnDefaultScreen ] = aPixmap;
+ else // empty pixmap for all screens is available
+ for( int i = 0; i < mnMaxScreens; ++i )
+ pMSGlyph->maPixmaps[ i ] = None;
+ }
+ // enable use of multiscreen glyph
rEGD.mpData = (void*)pMSGlyph;
rEGD.meInfo = INFO_MULTISCREEN;
+
return pMSGlyph;
}
@@ -504,6 +517,8 @@ void X11GlyphPeer::RemovingGlyph( ServerFont& /*rServerFont*/, GlyphData& rGlyph
{
if( pMSGlyph->maPixmaps[i] == NO_PIXMAP )
continue;
+ if( pMSGlyph->maPixmaps[i] == None )
+ continue;
XFreePixmap( mpDisplay, pMSGlyph->maPixmaps[i] );
mnBytesUsed -= nHeight * ((nWidth + 7) >> 3);
}
@@ -610,6 +625,7 @@ Pixmap X11GlyphPeer::GetPixmap( ServerFont& rServerFont, int nGlyphIndex, int nR
Pixmap aPixmap = GetPixmap( rGlyphData, nReqScreen );
if( aPixmap == NO_PIXMAP )
{
+ aPixmap = None;
if( rServerFont.GetGlyphBitmap1( nGlyphIndex, maRawBitmap ) )
{
// #94666# circumvent bug in some X11 systems, e.g. XF410.LynxEM.v163
@@ -697,8 +713,6 @@ Pixmap X11GlyphPeer::GetPixmap( ServerFont& rServerFont, int nGlyphIndex, int nR
if( aPixmap == NO_PIXMAP )
aPixmap = None;
-
- SetPixmap( rGlyphData, aPixmap, nReqScreen );
}
}