gdkgl: Use a GdkTexturedQuad struct to paint quads

We'll soon have a new function that paints multiple quads.
This commit is contained in:
Jasper St. Pierre
2014-11-22 09:39:18 -08:00
parent 28846536cb
commit 37697f1817
3 changed files with 43 additions and 33 deletions

View File

@ -498,11 +498,15 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context,
vscale = 1.0 / cairo_xlib_surface_get_height (surface);
}
gdk_gl_texture_quad (paint_context, target,
rect.x * window_scale, FLIP_Y(rect.y) * window_scale,
(rect.x + rect.width) * window_scale, FLIP_Y(rect.y + rect.height) * window_scale,
uscale * src_x, vscale * src_y,
uscale * (src_x + src_width), vscale * (src_y + src_height));
{
GdkTexturedQuad quad = {
rect.x * window_scale, FLIP_Y(rect.y) * window_scale,
(rect.x + rect.width) * window_scale, FLIP_Y(rect.y + rect.height) * window_scale,
uscale * src_x, vscale * src_y,
uscale * (src_x + src_width), vscale * (src_y + src_height),
};
gdk_gl_texture_quad (paint_context, target, &quad);
}
}
glXReleaseTexImageEXT (glx_pixmap->display, glx_pixmap->drawable,