X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=render%2Frender.c;h=82e6f96e3d155d1a0830eca6a7742ded5a0f9a8e;hb=ed4d0ca31a9c1c6c815cb87a058bb1d36a0888c1;hp=ecb07ada2b6ab200c27eed69ddaafc9541790e87;hpb=6017c061ebdb1722963b446233b4138d7a0c0947;p=chaz%2Fopenbox diff --git a/render/render.c b/render/render.c index ecb07ada..82e6f96e 100644 --- a/render/render.c +++ b/render/render.c @@ -42,7 +42,7 @@ Pixmap RrPaintPixmap(RrAppearance *a, gint w, gint h) { gint i, transferred = 0, sw, sh, partial_w, partial_h; RrPixel32 *source, *dest; - Pixmap oldp; + Pixmap oldp = None; RrRect tarea; /* area in which to draw textures */ gboolean resized; @@ -77,8 +77,10 @@ Pixmap RrPaintPixmap(RrAppearance *a, gint w, gint h) RrVisual(a->inst), RrColormap(a->inst)); g_assert(a->xftdraw != NULL); - g_free(a->surface.pixel_data); - a->surface.pixel_data = g_new(RrPixel32, w * h); + if (resized) { + g_free(a->surface.pixel_data); + a->surface.pixel_data = g_new(RrPixel32, w * h); + } if (a->surface.grad == RR_SURFACE_PARENTREL) { g_assert (a->surface.parent); @@ -194,6 +196,14 @@ RrAppearance *RrAppearanceNew(const RrInstance *inst, gint numtex) return out; } +void RrAppearanceAddTextures(RrAppearance *a, gint numtex) +{ + g_assert(a->textures == 0); + + a->textures = numtex; + if (numtex) a->texture = g_new0(RrTexture, numtex); +} + RrAppearance *RrAppearanceCopy(RrAppearance *orig) { RrSurface *spo, *spc;