mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 12:55:46 +00:00
Bug 924679. Part 2: Create static gfxXlibSurface::GetColormapAndVisual so it can be used without a gfxXlibSurface. r=karlt
--HG-- extra : rebase_source : 10599d49077114cd214ceafd811bfea3135bb9ff
This commit is contained in:
parent
d862803ca5
commit
9c82415c8f
@ -401,19 +401,27 @@ DisplayTable::DisplayClosing(Display *display, XExtCodes* codes)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* static */
|
||||
bool
|
||||
gfxXlibSurface::GetColormapAndVisual(cairo_surface_t* aXlibSurface,
|
||||
Colormap* aColormap, Visual** aVisual)
|
||||
{
|
||||
XRenderPictFormat* format =
|
||||
cairo_xlib_surface_get_xrender_format(aXlibSurface);
|
||||
Screen* screen = cairo_xlib_surface_get_screen(aXlibSurface);
|
||||
Visual* visual = cairo_xlib_surface_get_visual(aXlibSurface);
|
||||
|
||||
return DisplayTable::GetColormapAndVisual(screen, format, visual,
|
||||
aColormap, aVisual);
|
||||
}
|
||||
|
||||
bool
|
||||
gfxXlibSurface::GetColormapAndVisual(Colormap* aColormap, Visual** aVisual)
|
||||
{
|
||||
if (!mSurfaceValid)
|
||||
return false;
|
||||
|
||||
XRenderPictFormat* format =
|
||||
cairo_xlib_surface_get_xrender_format(CairoSurface());
|
||||
Screen* screen = cairo_xlib_surface_get_screen(CairoSurface());
|
||||
Visual* visual = cairo_xlib_surface_get_visual(CairoSurface());
|
||||
|
||||
return DisplayTable::GetColormapAndVisual(screen, format, visual,
|
||||
aColormap, aVisual);
|
||||
return GetColormapAndVisual(CairoSurface(), aColormap, aVisual);
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
@ -61,6 +61,7 @@ public:
|
||||
static int DepthOfVisual(const Screen* screen, const Visual* visual);
|
||||
static Visual* FindVisual(Screen* screen, gfxImageFormat format);
|
||||
static XRenderPictFormat *FindRenderFormat(Display *dpy, gfxImageFormat format);
|
||||
static bool GetColormapAndVisual(cairo_surface_t* aXlibSurface, Colormap* colormap, Visual **visual);
|
||||
|
||||
// take ownership of a passed-in Pixmap, calling XFreePixmap on it
|
||||
// when the gfxXlibSurface is destroyed.
|
||||
|
Loading…
Reference in New Issue
Block a user