- if (resized) {
- oldp = l->pixmap; /* save to free after changing the visible pixmap */
- l->pixmap = XCreatePixmap(RrDisplay(l->inst),
- RrRootWindow(l->inst),
- w, h, RrDepth(l->inst));
- } else
- oldp = None;
-
- g_assert(l->pixmap != None);
- l->w = w;
- l->h = h;
-
- if (l->xftdraw != NULL)
- XftDrawDestroy(l->xftdraw);
- l->xftdraw = XftDrawCreate(RrDisplay(l->inst), l->pixmap,
- RrVisual(l->inst), RrColormap(l->inst));
- g_assert(l->xftdraw != NULL);
-
- g_free(l->surface.RrPixel_data);
- l->surface.RrPixel_data = g_new(RrPixel32, w * h);
-
- if (l->surface.grad == RR_SURFACE_PARENTREL) {
- g_assert (l->surface.parent);
- g_assert (l->surface.parent->w);
-
- sw = l->surface.parent->w;
- source = (l->surface.parent->surface.RrPixel_data + l->surface.parentx +
- sw * l->surface.parenty);
- dest = l->surface.RrPixel_data;
- for (i = 0; i < h; i++, source += sw, dest += w) {
- memcpy(dest, source, w * sizeof(RrPixel32));
- }
- } else if (l->surface.grad == RR_SURFACE_SOLID)
- gradient_solid(l, 0, 0, w, h);
- else
- gradient_render(&l->surface, w, h);
-
- RECT_SET(tarea, 0, 0, w, h);
- if (l->surface.grad != RR_SURFACE_PARENTREL) {
- if (l->surface.relief != RR_RELIEF_FLAT) {
- switch (l->surface.bevel) {
- case RR_BEVEL_1:
- tarea.x += 1; tarea.y += 1;
- tarea.width -= 2; tarea.height -= 2;
- break;
- case RR_BEVEL_2:
- tarea.x += 2; tarea.y += 2;
- tarea.width -= 4; tarea.height -= 4;
- break;
- }
- } else if (l->surface.border) {
- tarea.x += 1; tarea.y += 1;
- tarea.width -= 2; tarea.height -= 2;
- }