summaryrefslogtreecommitdiff
path: root/vcl/unx/generic/gdi
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-11-13 21:00:16 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-11-14 07:36:02 +0000
commit1c064d1460fbf84a2fc6c2cdc7824937735a4312 (patch)
tree994a56ddc36c8bbe163e6072836e197ffc63594c /vcl/unx/generic/gdi
parent5670184ea887276643f4921e456a242455cbdc32 (diff)
I don't see that any of this makes sense anymore
Diffstat (limited to 'vcl/unx/generic/gdi')
-rw-r--r--vcl/unx/generic/gdi/gcach_xpeer.cxx89
-rw-r--r--vcl/unx/generic/gdi/gcach_xpeer.hxx8
2 files changed, 6 insertions, 91 deletions
diff --git a/vcl/unx/generic/gdi/gcach_xpeer.cxx b/vcl/unx/generic/gdi/gcach_xpeer.cxx
index 09acf205dd59..8da1101d5e1f 100644
--- a/vcl/unx/generic/gdi/gcach_xpeer.cxx
+++ b/vcl/unx/generic/gdi/gcach_xpeer.cxx
@@ -43,19 +43,7 @@
// ===========================================================================
X11GlyphPeer::X11GlyphPeer()
-: mpDisplay( GetGenericData()->GetSalDisplay()->GetDisplay() )
-, mnMaxScreens(0)
-, mnDefaultScreen(0)
{
- if( !mpDisplay )
- return;
-
- SalDisplay& rSalDisplay = *GetGenericData()->GetSalDisplay();
- mpDisplay = rSalDisplay.GetDisplay();
- mnMaxScreens = rSalDisplay.GetScreenCount();
- if( mnMaxScreens > MAX_GCACH_SCREENS )
- mnMaxScreens = MAX_GCACH_SCREENS;
- mnDefaultScreen = rSalDisplay.GetDefaultScreenNumber();
}
// ---------------------------------------------------------------------------
@@ -65,10 +53,13 @@ X11GlyphPeer::~X11GlyphPeer()
if( !ImplGetSVData() )
return;
+ //Why do this here, move into dtor/shutdown of display?
SalDisplay* pSalDisp = GetGenericData()->GetSalDisplay();
Display* const pX11Disp = pSalDisp->GetDisplay();
+ int nMaxScreens = pSalDisp->GetScreenCount();
XRenderPeer& rRenderPeer = XRenderPeer::GetInstance();
- for( int i = 0; i < mnMaxScreens; i++ )
+
+ for( int i = 0; i < nMaxScreens; i++ )
{
SalDisplay::RenderEntryMap& rMap = pSalDisp->GetRenderEntries( i );
for( SalDisplay::RenderEntryMap::iterator it = rMap.begin(); it != rMap.end(); ++it )
@@ -82,85 +73,17 @@ X11GlyphPeer::~X11GlyphPeer()
}
}
-// ===========================================================================
-
-enum { INFO_EMPTY=0, INFO_PIXMAP, INFO_XRENDER, INFO_RAWBMP };
-static const Glyph NO_GLYPHID = 0;
-static RawBitmap* const NO_RAWBMP = NULL;
-static const Pixmap NO_PIXMAP = ~0;
-
// ---------------------------------------------------------------------------
-void X11GlyphPeer::RemovingFont( ServerFont& rServerFont )
+void X11GlyphPeer::RemovingFont( ServerFont& )
{
- void* pFontExt = rServerFont.GetExtPointer();
- switch( rServerFont.GetExtInfo() )
- {
- case INFO_PIXMAP:
- case INFO_RAWBMP:
- // nothing to do
- break;
-
- case INFO_XRENDER:
- XRenderPeer::GetInstance().FreeGlyphSet( (GlyphSet)pFontExt );
- break;
- }
-
- rServerFont.SetExtended( INFO_EMPTY, NULL );
}
// ---------------------------------------------------------------------------
// notification to clean up GlyphPeer resources for this glyph
-void X11GlyphPeer::RemovingGlyph( ServerFont& /*rServerFont*/, GlyphData& rGlyphData, int /*nGlyphIndex*/ )
+void X11GlyphPeer::RemovingGlyph( ServerFont&, GlyphData&, int /*nGlyphIndex*/ )
{
- // nothing to do if the GlyphPeer hasn't allocated resources for the glyph
- if( rGlyphData.ExtDataRef().meInfo == INFO_EMPTY )
- return;
-
- const GlyphMetric& rGM = rGlyphData.GetMetric();
- const int nWidth = rGM.GetSize().Width();
- const int nHeight = rGM.GetSize().Height();
-
- void* pGlyphExt = rGlyphData.ExtDataRef().mpData;
- switch( rGlyphData.ExtDataRef().meInfo )
- {
- case INFO_PIXMAP:
- {
- Pixmap aPixmap = (Pixmap)pGlyphExt;
- if( aPixmap != None )
- {
- XFreePixmap( mpDisplay, aPixmap );
- mnBytesUsed -= nHeight * ((nWidth + 7) >> 3);
- }
- }
- break;
-
- case INFO_RAWBMP:
- {
- RawBitmap* pRawBitmap = (RawBitmap*)pGlyphExt;
- if( pRawBitmap != NULL )
- {
- mnBytesUsed -= pRawBitmap->mnScanlineSize * pRawBitmap->mnHeight;
- mnBytesUsed -= sizeof(RawBitmap);
- delete pRawBitmap;
- }
- }
- break;
-
- case INFO_XRENDER:
- {
- // Glyph nGlyphId = (Glyph)rGlyphData.GetExtPointer();
- // XRenderPeer::GetInstance().FreeGlyph( aGlyphSet, &nGlyphId );
- mnBytesUsed -= nHeight * ((nWidth + 3) & ~3);
- }
- break;
- }
-
- if( mnBytesUsed < 0 ) // TODO: eliminate nBytesUsed calc mismatch
- mnBytesUsed = 0;
-
- rGlyphData.ExtDataRef() = ExtGlyphData();
}
// ===========================================================================
diff --git a/vcl/unx/generic/gdi/gcach_xpeer.hxx b/vcl/unx/generic/gdi/gcach_xpeer.hxx
index 42032d42b351..0efd0faa769e 100644
--- a/vcl/unx/generic/gdi/gcach_xpeer.hxx
+++ b/vcl/unx/generic/gdi/gcach_xpeer.hxx
@@ -47,14 +47,6 @@ public:
protected:
virtual void RemovingFont( ServerFont& );
virtual void RemovingGlyph( ServerFont&, GlyphData&, int nGlyphIndex );
-
-private:
- Display* mpDisplay;
-
- // thirty-two screens should be enough for everyone...
- static const int MAX_GCACH_SCREENS = 32;
- int mnMaxScreens;
- int mnDefaultScreen;
};
class X11GlyphCache : public GlyphCache