X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=render%2Frender.c;h=1d5b705c57aad901c32b28e7eb80454536931303;hb=c791cbfda0865a9716419c533b665d0550ae2916;hp=87706c8eea72c9d83e06d70758499968c5c8cbf4;hpb=dbe2851b910dcdb02afbb744dbb2926286ab8f65;p=chaz%2Fopenbox diff --git a/render/render.c b/render/render.c index 87706c8e..1d5b705c 100644 --- a/render/render.c +++ b/render/render.c @@ -15,7 +15,8 @@ # include #endif -static void RrPixel32_to_pixmap(RrAppearance *l, gint x, gint y, gint w, gint h); +static void RrPixel32_to_pixmap(RrAppearance *l, + gint x, gint y, gint w, gint h); void RrPaint(RrAppearance *l, Window win, gint w, gint h) { @@ -29,13 +30,10 @@ void RrPaint(RrAppearance *l, Window win, gint w, gint h) resized = (l->w != w || l->h != h); - 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; + 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)); g_assert(l->pixmap != None); l->w = w; @@ -55,16 +53,14 @@ void RrPaint(RrAppearance *l, Window win, gint w, gint h) 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); + 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); + }else + RrRender(l, w, h); RECT_SET(tarea, 0, 0, w, h); if (l->surface.grad != RR_SURFACE_PARENTREL) { @@ -109,12 +105,12 @@ void RrPaint(RrAppearance *l, Window win, gint w, gint h) RrPixel32_to_pixmap(l, 0, 0, w, h); } if (l->texture[i].data.mask.color->gc == None) - color_allocate_gc(l->texture[i].data.mask.color); + RrColorAllocateGC(l->texture[i].data.mask.color); RrPixmapMaskDraw(l->pixmap, &l->texture[i].data.mask, &tarea); break; case RR_TEXTURE_RGBA: - image_draw(l->surface.RrPixel_data, - &l->texture[i].data.rgba, &tarea); + RrImageDraw(l->surface.RrPixel_data, + &l->texture[i].data.rgba, &tarea); break; } } @@ -236,13 +232,13 @@ static void RrPixel32_to_pixmap(RrAppearance *l, gint x, gint y, gint w, gint h) in = l->surface.RrPixel_data; out = l->pixmap; - im->byte_order = render_endian; + im->byte_order = RrEndian; /* this malloc is a complete waste of time on normal 32bpp as reduce_depth just sets im->data = data and returns */ scratch = g_new(RrPixel32, im->width * im->height); im->data = (char*) scratch; - reduce_depth(l->inst, in, im); + RrReduceDepth(l->inst, in, im); XPutImage(RrDisplay(l->inst), out, DefaultGC(RrDisplay(l->inst), RrScreen(l->inst)), im, 0, 0, x, y, w, h); @@ -336,7 +332,7 @@ gboolean RrPixmapToRGBA(const RrInstance *inst, } *data = g_new(RrPixel32, pw * ph); - increase_depth(inst, *data, xi); + RrIncreaseDepth(inst, *data, xi); if (mask) { /* apply transparency from the mask */ @@ -344,7 +340,7 @@ gboolean RrPixmapToRGBA(const RrInstance *inst, for (i = 0, y = 0; y < ph; ++y) { for (x = 0; x < pw; ++x, ++i) { if (!((((unsigned)xm->data[di + x / 8]) >> (x % 8)) & 0x1)) - (*data)[i] &= ~(0xff << default_alpha_offset); + (*data)[i] &= ~(0xff << RrDefaultAlphaOffset); } di += xm->bytes_per_line; }