X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=render%2Fgradient.c;h=ad9154a681e5a433cfc36e7e0f360d71c6472e42;hb=580795fe6a4b5d070f01065b309f1789cf0d0dbb;hp=8ea86aa1c3e4085b51a0e741cfcd4f2bb2ff3078;hpb=f8a47de5ec444c452093371e3db16857eb39a490;p=chaz%2Fopenbox diff --git a/render/gradient.c b/render/gradient.c index 8ea86aa1..ad9154a6 100644 --- a/render/gradient.c +++ b/render/gradient.c @@ -1,4 +1,3 @@ -#include #include #include "render.h" #include "gradient.h" @@ -28,7 +27,8 @@ void gradient_render(Surface *sf, int w, int h) gradient_crossdiagonal(sf, w, h); break; default: - printf("unhandled gradient\n"); + g_message("unhandled gradient"); + return; } if (sf->data.planar.relief == Flat && sf->data.planar.border) { @@ -231,23 +231,32 @@ void highlight(pixel32 *x, pixel32 *y, gboolean raised) + (b << default_blue_shift); } -void gradient_solid(Appearance *l, int w, int h) +void gradient_solid(Appearance *l, int x, int y, int w, int h) { - int i; + pixel32 pix; + int i, a, b; PlanarSurface *sp = &l->surface.data.planar; - int left = 0, top = 0, right = w - 1, bottom = h - 1; + int left = x, top = y, right = w - 1, bottom = h - 1; if (sp->primary->gc == None) color_allocate_gc(sp->primary); + pix = (sp->primary->r << default_red_shift) + + (sp->primary->g << default_green_shift) + + (sp->primary->b << default_blue_shift); + + for (a = 0; a < l->area.width; a++) + for (b = 0; b < l->area.height; b++) + sp->pixel_data[a + b*l->area.width] = pix; + XFillRectangle(ob_display, l->pixmap, sp->primary->gc - , 0, 0, w, h); + , x, y, w, h); if (l->surface.data.planar.interlaced) { if (sp->secondary->gc == None) color_allocate_gc(sp->secondary); - for (i = 0; i < h; i += 2) + for (i = y; i < h; i += 2) XDrawLine(ob_display, l->pixmap, sp->secondary->gc, - 0, i, w, i); + x, i, w, i); } /* switch (texture.relief()) {