mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-24 03:19:06 +00:00
Avoid XGetGeometry calls in GetThebesContext, which require a round-trip to the X server. b=330661 r=vlad
This commit is contained in:
parent
d3e0e44a80
commit
964b8e781b
@ -5249,11 +5249,14 @@ nsWindow::GetThebesSurface()
|
||||
|
||||
if (!mThebesSurface) {
|
||||
GdkDrawable* d = GDK_DRAWABLE(mDrawingarea->inner_window);
|
||||
gint width, height;
|
||||
gdk_drawable_get_size(d, &width, &height);
|
||||
if (!gfxPlatform::UseGlitz()) {
|
||||
mThebesSurface = new gfxXlibSurface
|
||||
(GDK_WINDOW_XDISPLAY(d),
|
||||
GDK_WINDOW_XWINDOW(d),
|
||||
GDK_VISUAL_XVISUAL(gdk_drawable_get_visual(d)));
|
||||
GDK_VISUAL_XVISUAL(gdk_drawable_get_visual(d)),
|
||||
width, height);
|
||||
gfxPlatformGtk::GetPlatform()->SetSurfaceGdkWindow(mThebesSurface, GDK_WINDOW(d));
|
||||
} else {
|
||||
#ifdef MOZ_ENABLE_GLITZ
|
||||
@ -5269,16 +5272,6 @@ nsWindow::GetThebesSurface()
|
||||
Display* dpy = GDK_WINDOW_XDISPLAY(d);
|
||||
Window wnd = GDK_WINDOW_XWINDOW(d);
|
||||
|
||||
Window root_ignore;
|
||||
int x_ignore, y_ignore;
|
||||
unsigned int bwidth_ignore, width, height, depth;
|
||||
|
||||
XGetGeometry(dpy,
|
||||
wnd,
|
||||
&root_ignore, &x_ignore, &y_ignore,
|
||||
&width, &height,
|
||||
&bwidth_ignore, &depth);
|
||||
|
||||
gdraw =
|
||||
glitz_glx_create_drawable_for_window (dpy,
|
||||
DefaultScreen(dpy),
|
||||
|
Loading…
x
Reference in New Issue
Block a user