[wxGTK2] gtk+-2.8.0 compatibility. Removed the usage of pango_x_get_context to not depend on a fully deprecated
pangox library, which is not pulled in with gtk+-2.8.0. The pango_x_get_context call was (arguably) making font drawing on top of a wxDC slightly faster on (especially remote) X11 in case of non-antialiased fonts (I was unable to find a non-antialiased font that actually returns true for GetNoAntiAliasing()). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35215 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -167,8 +167,11 @@ public:
|
|||||||
// Returns the X11 context which renders on the X11 client
|
// Returns the X11 context which renders on the X11 client
|
||||||
// side (which can be remote) and which usually is not
|
// side (which can be remote) and which usually is not
|
||||||
// anti-aliased and is thus faster
|
// anti-aliased and is thus faster
|
||||||
|
// MR: Now returns the default pango_context for the widget as GtkGetPangoDefaultContext to
|
||||||
|
// not depend on libpangox - which is completely deprecated.
|
||||||
|
//BCI: Remove GtkGetPangoX11Context and m_x11Context completely when symbols may be removed
|
||||||
PangoContext *GtkGetPangoX11Context();
|
PangoContext *GtkGetPangoX11Context();
|
||||||
PangoContext *m_x11Context;
|
PangoContext *m_x11Context; // MR: Now unused
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
|
@@ -167,8 +167,11 @@ public:
|
|||||||
// Returns the X11 context which renders on the X11 client
|
// Returns the X11 context which renders on the X11 client
|
||||||
// side (which can be remote) and which usually is not
|
// side (which can be remote) and which usually is not
|
||||||
// anti-aliased and is thus faster
|
// anti-aliased and is thus faster
|
||||||
|
// MR: Now returns the default pango_context for the widget as GtkGetPangoDefaultContext to
|
||||||
|
// not depend on libpangox - which is completely deprecated.
|
||||||
|
//BCI: Remove GtkGetPangoX11Context and m_x11Context completely when symbols may be removed
|
||||||
PangoContext *GtkGetPangoX11Context();
|
PangoContext *GtkGetPangoX11Context();
|
||||||
PangoContext *m_x11Context;
|
PangoContext *m_x11Context; // MR: Now unused
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
|
@@ -1888,10 +1888,13 @@ void wxWindowDC::SetFont( const wxFont &font )
|
|||||||
PangoContext *oldContext = m_context;
|
PangoContext *oldContext = m_context;
|
||||||
|
|
||||||
// We might want to use the X11 context for faster
|
// We might want to use the X11 context for faster
|
||||||
// rendering on screen
|
// rendering on screen.
|
||||||
|
// MR: Lets not want to do this, as this introduces libpangox dependancy.
|
||||||
|
#if 0
|
||||||
if (m_font.GetNoAntiAliasing())
|
if (m_font.GetNoAntiAliasing())
|
||||||
m_context = m_owner->GtkGetPangoX11Context();
|
m_context = m_owner->GtkGetPangoX11Context();
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
m_context = m_owner->GtkGetPangoDefaultContext();
|
m_context = m_owner->GtkGetPangoDefaultContext();
|
||||||
|
|
||||||
// If we switch back/forth between different contexts
|
// If we switch back/forth between different contexts
|
||||||
|
@@ -4279,12 +4279,10 @@ PangoContext *wxWindowGTK::GtkGetPangoDefaultContext()
|
|||||||
return gtk_widget_get_pango_context( m_widget );
|
return gtk_widget_get_pango_context( m_widget );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MR: Returns the same as GtkGetPangoDefaultContext until the symbol can be removed in 2.7.x
|
||||||
PangoContext *wxWindowGTK::GtkGetPangoX11Context()
|
PangoContext *wxWindowGTK::GtkGetPangoX11Context()
|
||||||
{
|
{
|
||||||
if (!m_x11Context)
|
return gtk_widget_get_pango_context( m_widget );
|
||||||
m_x11Context = pango_x_get_context( gdk_display );
|
|
||||||
|
|
||||||
return m_x11Context;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -1888,10 +1888,13 @@ void wxWindowDC::SetFont( const wxFont &font )
|
|||||||
PangoContext *oldContext = m_context;
|
PangoContext *oldContext = m_context;
|
||||||
|
|
||||||
// We might want to use the X11 context for faster
|
// We might want to use the X11 context for faster
|
||||||
// rendering on screen
|
// rendering on screen.
|
||||||
|
// MR: Lets not want to do this, as this introduces libpangox dependancy.
|
||||||
|
#if 0
|
||||||
if (m_font.GetNoAntiAliasing())
|
if (m_font.GetNoAntiAliasing())
|
||||||
m_context = m_owner->GtkGetPangoX11Context();
|
m_context = m_owner->GtkGetPangoX11Context();
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
m_context = m_owner->GtkGetPangoDefaultContext();
|
m_context = m_owner->GtkGetPangoDefaultContext();
|
||||||
|
|
||||||
// If we switch back/forth between different contexts
|
// If we switch back/forth between different contexts
|
||||||
|
@@ -4279,12 +4279,10 @@ PangoContext *wxWindowGTK::GtkGetPangoDefaultContext()
|
|||||||
return gtk_widget_get_pango_context( m_widget );
|
return gtk_widget_get_pango_context( m_widget );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MR: Returns the same as GtkGetPangoDefaultContext until the symbol can be removed in 2.7.x
|
||||||
PangoContext *wxWindowGTK::GtkGetPangoX11Context()
|
PangoContext *wxWindowGTK::GtkGetPangoX11Context()
|
||||||
{
|
{
|
||||||
if (!m_x11Context)
|
return gtk_widget_get_pango_context( m_widget );
|
||||||
m_x11Context = pango_x_get_context( gdk_display );
|
|
||||||
|
|
||||||
return m_x11Context;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user