request explicitly as many elements for the gradient tables as we need the next step is to not use 'unsigned int' and then only store 'chars' in it, maybe even using RGBA data instead of separated arrays for r, g and b.
Mathias Gumz akira at fluxbox dot org
2 files changed,
8 insertions(+),
18 deletions(-)
M
src/FbTk/ImageControl.cc
→
src/FbTk/ImageControl.cc
@@ -381,10 +381,10 @@ unsigned int **xbuf,
unsigned int **ybuf) { if (w > grad_xbuffer.size()) - grad_xbuffer.resize(w * 3); + grad_xbuffer.resize(w); if (h > grad_ybuffer.size()) - grad_ybuffer.resize(h * 3); + grad_ybuffer.resize(h); *xbuf = &grad_xbuffer[0]; *ybuf = &grad_ybuffer[0];
M
src/FbTk/TextureRender.cc
→
src/FbTk/TextureRender.cc
@@ -374,12 +374,7 @@
unsigned char* red = r; unsigned char* green = g; unsigned char* blue = b; - unsigned int* xtable; - unsigned int* ytable; register unsigned int x, y; - - imgctrl.getGradientBuffers(width, height, &xtable, &ytable); - drx = (float) (to->red() - from->red()); dgx = (float) (to->green() - from->green());@@ -479,11 +474,6 @@ yb = (float) from->blue();
register unsigned int y; - unsigned int* xtable; - unsigned int* ytable; - - imgctrl.getGradientBuffers(width, height, &xtable, &ytable); - dry = (float) (to->red() - from->red()); dgy = (float) (to->green() - from->green()); dby = (float) (to->blue() - from->blue());@@ -571,7 +561,7 @@ unsigned int* yt;
register unsigned int x, y; - imgctrl.getGradientBuffers(width, height, &xtable, &ytable); + imgctrl.getGradientBuffers(width * 3, height * 3, &xtable, &ytable); xt = xtable; yt = ytable;@@ -695,7 +685,7 @@ unsigned int* yt;
register unsigned int x, y; - imgctrl.getGradientBuffers(width, height, &xtable, &ytable); + imgctrl.getGradientBuffers(width * 3, height * 3, &xtable, &ytable); xt = xtable; yt = ytable;@@ -821,7 +811,7 @@ unsigned int* xt;
unsigned int* yt; register unsigned int x, y; - imgctrl.getGradientBuffers(w, h, &xtable, &ytable); + imgctrl.getGradientBuffers(width * 3, height * 3, &xtable, &ytable); xt = xtable; yt = ytable;@@ -939,7 +929,7 @@ tb = (unsigned long) to->blue();
register unsigned int x, y; - imgctrl.getGradientBuffers(width, height, &xtable, &ytable); + imgctrl.getGradientBuffers(width * 3, height * 3, &xtable, &ytable); xt = xtable; yt = ytable;@@ -1070,7 +1060,7 @@ tg = to->green(),
tb = to->blue(); register unsigned int x, y; - imgctrl.getGradientBuffers(width, height, &xtable, &ytable); + imgctrl.getGradientBuffers(width * 3, height * 3, &xtable, &ytable); xt = xtable; yt = ytable;@@ -1192,7 +1182,7 @@ unsigned int* yt;
register unsigned int x, y; - imgctrl.getGradientBuffers(w, h, &xtable, &ytable); + imgctrl.getGradientBuffers(width * 3, height * 3, &xtable, &ytable); xt = xtable; yt = ytable;