xcb_xfixes_fetch_region_cookie_t ck_region;
int waiting_region;
+ int x_region;
+ int y_region;
+ int w_region;
+ int h_region;
+ int bw_region;
} window_data_t;
static gboolean glxrender_find_fb_config(d_screen_t *sc, data_t *d);
d->fbconfig[depth],
px, attrs);
-
glBindTexture(GL_TEXTURE_2D, wd->texname);
d->bind_func(w->sc->dpy->xlib_dpy,
wd->glpixmap, GLX_FRONT_LEFT_EXT, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glBindTexture(GL_TEXTURE_2D, 0);
-
- glxrender_update_window_region(w, wd);
}
static void
glxrender_fetch_window_region(d_window_t *w, window_data_t *wd)
{
- if (wd->waiting_region) return;
+ window_get_area(w, &wd->x_region, &wd->y_region,
+ &wd->w_region, &wd->h_region, &wd->bw_region);
wd->ck_region =
xcb_xfixes_fetch_region_unchecked(w->sc->dpy->conn,
{
xcb_xfixes_fetch_region_reply_t *rep;
xcb_rectangle_t area, *rects;
- int nrects, i, j, x, y, wid, hei, bwid;
+ int nrects, i, j;
if (!wd->waiting_region) return;
- window_get_area(w, &x, &y, &wid, &hei, &bwid);
- area.x = x;
- area.y = y;
- area.width = wid + bwid * 2;
- area.height = hei + bwid * 2;
+ area.x = wd->x_region;
+ area.y = wd->y_region;
+ area.width = wd->w_region + wd->bw_region * 2;
+ area.height = wd->h_region + wd->bw_region * 2;
rep = xcb_xfixes_fetch_region_reply(w->sc->dpy->conn, wd->ck_region, NULL);
if (!rep) {
for (i = j = 0; i < nrects * 4; ++j, i += 4) {
wd->texcoords[i+LEFT] =
- (GLfloat)(rects[j].x - x) / (GLfloat)area.width;
+ (GLfloat)(rects[j].x - area.x) / (GLfloat)area.width;
wd->texcoords[i+TOP] =
- (GLfloat)(rects[j].y - y) / (GLfloat)area.height;
+ (GLfloat)(rects[j].y - area.y) / (GLfloat)area.height;
wd->texcoords[i+RIGHT] =
- (GLfloat)(rects[j].x - x + rects[j].width) /
+ (GLfloat)(rects[j].x - area.x + rects[j].width) /
(GLfloat)area.width;
wd->texcoords[i+BOTTOM] =
- (GLfloat)(rects[j].y - y + rects[j].height) /
+ (GLfloat)(rects[j].y - area.y + rects[j].height) /
(GLfloat)area.height;
- wd->vertices[i+LEFT] = rects[j].x - x;
- wd->vertices[i+TOP] = rects[j].y - y;
- wd->vertices[i+RIGHT] = rects[j].x - x + rects[j].width;
- wd->vertices[i+BOTTOM] = rects[j].y - y + rects[j].height;
+ wd->vertices[i+LEFT] = rects[j].x - area.x;
+ wd->vertices[i+TOP] = rects[j].y - area.y;
+ wd->vertices[i+RIGHT] = rects[j].x - area.x + rects[j].width;
+ wd->vertices[i+BOTTOM] = rects[j].y - area.y + rects[j].height;
}
if (rep)
assert(wd != NULL);
glxrender_free_window_pixmap(w, d, wd);
-
- glxrender_free_window_region(wd);
glxrender_fetch_window_region(w, wd);
}
assert(wd != NULL);
glxrender_free_window_pixmap(w, d, wd);
-
- glxrender_free_window_region(wd);
glxrender_fetch_window_region(w, wd);
}
if (!wd->glpixmap)
glxrender_update_window_pixmap(w, d, wd);
+ if (wd->waiting_region)
+ glxrender_update_window_region(w, wd);
if (wd->nrects < 1) return;