X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=render%2Fgradient.c;h=47f4850fdfbf9fc83ecbee7f43669310e076fabb;hb=5be0a82a353b67160142134de1cc51fa31d72759;hp=6f976e0b0e6843fc3b7c9b3034e377d32ee620b5;hpb=1e882b62718e4d6a4a149b415964646ad424fbfd;p=chaz%2Fopenbox diff --git a/render/gradient.c b/render/gradient.c index 6f976e0b..47f4850f 100644 --- a/render/gradient.c +++ b/render/gradient.c @@ -21,7 +21,7 @@ void RrRender(RrAppearance *a, int w, int h) switch (a->surface.grad) { case RR_SURFACE_SOLID: gradient_solid(a, w, h); - return; + break; case RR_SURFACE_VERTICAL: gradient_vertical(&a->surface, w, h); break; @@ -38,7 +38,7 @@ void RrRender(RrAppearance *a, int w, int h) gradient_pyramid(&a->surface, w, h); break; default: - g_message("unhandled gradient"); + g_assert_not_reached(); /* unhandled gradient */ return; } @@ -334,7 +334,7 @@ static void gradient_solid(RrAppearance *l, int w, int h) static void gradient_horizontal(RrSurface *sf, int w, int h) { int x, y; - RrPixel32 *data = sf->RrPixel_data; + RrPixel32 *data = sf->RrPixel_data, *datav; RrPixel32 current; VARS(x); @@ -342,8 +342,11 @@ static void gradient_horizontal(RrSurface *sf, int w, int h) for (x = w - 1; x > 0; --x) { /* 0 -> w-1 */ current = COLOR(x); - for (y = h - 1; y >= 0; --y) /* 0 -> h */ - *(data + y * w) = current; + datav = data; + for (y = h - 1; y >= 0; --y) { /* 0 -> h */ + *datav = current; + datav += w; + } ++data; NEXT(x); @@ -530,6 +533,7 @@ static void gradient_pyramid(RrSurface *sf, int inw, int inh) NEXT(x); } + current = COLOR(x); *(data+x) = current; *(data+inw-x) = current; *(end-x) = current;