Bug 380464 - "crashed [@ gfxPlatformGtk::SetSurfaceGdkWindow] in case where I used to see bug 263160" [p=vlad r=stuart a=blocking1.9+]

This commit is contained in:
reed@reedloden.com 2007-11-07 00:51:53 -08:00
Родитель 24a04e65d7
Коммит e8d2db7616
3 изменённых файлов: 4 добавлений и 51 удалений

Просмотреть файл

@ -57,11 +57,6 @@ public:
already_AddRefed<gfxASurface> CreateOffscreenSurface(const gfxIntSize& size, already_AddRefed<gfxASurface> CreateOffscreenSurface(const gfxIntSize& size,
gfxASurface::gfxImageFormat imageFormat); gfxASurface::gfxImageFormat imageFormat);
GdkDrawable *GetSurfaceGdkDrawable(gfxASurface *aSurf);
void SetSurfaceGdkWindow(gfxASurface *aSurf,
GdkWindow *win);
nsresult GetFontList(const nsACString& aLangGroup, nsresult GetFontList(const nsACString& aLangGroup,
const nsACString& aGenericFamily, const nsACString& aGenericFamily,
nsStringArray& aListOfFonts); nsStringArray& aListOfFonts);

Просмотреть файл

@ -69,14 +69,6 @@
PRInt32 gfxPlatformGtk::sDPI = -1; PRInt32 gfxPlatformGtk::sDPI = -1;
gfxFontconfigUtils *gfxPlatformGtk::sFontconfigUtils = nsnull; gfxFontconfigUtils *gfxPlatformGtk::sFontconfigUtils = nsnull;
static cairo_user_data_key_t cairo_gdk_window_key;
static cairo_user_data_key_t cairo_gdk_pixmap_key;
static void do_gdk_pixmap_unref (void *data)
{
GdkPixmap *pmap = (GdkPixmap*)data;
gdk_pixmap_unref (pmap);
}
gfxPlatformGtk::gfxPlatformGtk() gfxPlatformGtk::gfxPlatformGtk()
{ {
#ifdef MOZ_ENABLE_GLITZ #ifdef MOZ_ENABLE_GLITZ
@ -174,14 +166,6 @@ gfxPlatformGtk::CreateOffscreenSurface(const gfxIntSize& size,
size); size);
} }
if (pixmap && newSurface) {
// set up the surface to auto-unref the gdk pixmap when the surface
// is released
newSurface->SetData(&cairo_gdk_pixmap_key,
pixmap,
do_gdk_pixmap_unref);
}
} else { } else {
#ifdef MOZ_ENABLE_GLITZ #ifdef MOZ_ENABLE_GLITZ
glitz_drawable_format_t *gdformat = glitz_glx_find_pbuffer_format glitz_drawable_format_t *gdformat = glitz_glx_find_pbuffer_format
@ -215,31 +199,6 @@ gfxPlatformGtk::CreateOffscreenSurface(const gfxIntSize& size,
return newSurface; return newSurface;
} }
GdkDrawable*
gfxPlatformGtk::GetSurfaceGdkDrawable(gfxASurface *aSurf)
{
GdkDrawable *gd;
gd = (GdkDrawable*) cairo_surface_get_user_data(aSurf->CairoSurface(), &cairo_gdk_pixmap_key);
if (gd)
return gd;
gd = (GdkDrawable*) cairo_surface_get_user_data(aSurf->CairoSurface(), &cairo_gdk_window_key);
if (gd)
return gd;
return nsnull;
}
void
gfxPlatformGtk::SetSurfaceGdkWindow(gfxASurface *aSurf,
GdkWindow *win)
{
cairo_surface_set_user_data(aSurf->CairoSurface(),
&cairo_gdk_window_key,
win,
nsnull);
}
nsresult nsresult
gfxPlatformGtk::GetFontList(const nsACString& aLangGroup, gfxPlatformGtk::GetFontList(const nsACString& aLangGroup,
const nsACString& aGenericFamily, const nsACString& aGenericFamily,

Просмотреть файл

@ -5931,12 +5931,11 @@ nsWindow::GetThebesSurface()
GDK_WINDOW_XWINDOW(d), GDK_WINDOW_XWINDOW(d),
GDK_VISUAL_XVISUAL(gdk_drawable_get_visual(d)), GDK_VISUAL_XVISUAL(gdk_drawable_get_visual(d)),
gfxIntSize(width, height)); gfxIntSize(width, height));
if (mThebesSurface && !mThebesSurface->CairoStatus()) {
gfxPlatformGtk::GetPlatform()->SetSurfaceGdkWindow(mThebesSurface, GDK_WINDOW(d)); // if the surface creation is reporting an error, then
} // we don't have a surface to give back
else { if (mThebesSurface && mThebesSurface->CairoStatus() != 0)
mThebesSurface = nsnull; mThebesSurface = nsnull;
}
} else { } else {
#ifdef MOZ_ENABLE_GLITZ #ifdef MOZ_ENABLE_GLITZ
glitz_surface_t *gsurf; glitz_surface_t *gsurf;