all repos — fluxbox @ a4a4bca745fc9e5417243be404c77486fcdfe336

custom fork of the fluxbox windowmanager

Reduces memory footprint

The buffer for some gradients does not have to be width * height big when two
lines are sufficient.
Mathias Gumz akira at fluxbox dot org
commit

a4a4bca745fc9e5417243be404c77486fcdfe336

parent

6514398bead7926b85b6e5eb7d6276f47a97cd2f

1 files changed, 5 insertions(+), 7 deletions(-)

jump to
M src/FbTk/TextureRender.ccsrc/FbTk/TextureRender.cc

@@ -403,7 +403,7 @@ const FbTk::Color* from, const FbTk::Color* to,

FbTk::ImageControl& imgctrl) { - const size_t s = width * height; + const size_t s = width + height; // we need 2 gradients but use only 'one' buffer FbTk::RGBA* x_gradient = (FbTk::RGBA*)&getGradientBuffer(s * sizeof(FbTk::RGBA))[0];

@@ -446,7 +446,7 @@ FbTk::RGBA* rgba,

const FbTk::Color* from, const FbTk::Color* to, FbTk::ImageControl& imgctrl) { - const size_t s = width * height; + const size_t s = width + height; // we need 2 gradients but use only 'one' buffer FbTk::RGBA* x_gradient = (FbTk::RGBA*)&getGradientBuffer(s * sizeof(FbTk::RGBA))[0];

@@ -488,7 +488,7 @@ FbTk::RGBA* rgba,

const FbTk::Color* from, const FbTk::Color* to, FbTk::ImageControl& imgctrl) { - size_t s = width * height; + size_t s = width + height; // we need 2 gradients but use only 'one' buffer FbTk::RGBA* x_gradient = (FbTk::RGBA*)&getGradientBuffer(s * sizeof(FbTk::RGBA))[0];

@@ -535,7 +535,7 @@ const FbTk::Color* from, const FbTk::Color* to,

FbTk::ImageControl& imgctrl) { - size_t s = width * height; + size_t s = width + height; // we need 2 gradients but use only 'one' buffer FbTk::RGBA* x_gradient = (FbTk::RGBA*)&getGradientBuffer(s * sizeof(FbTk::RGBA))[0];

@@ -568,8 +568,6 @@ unsigned int width, unsigned int height,

FbTk::RGBA* rgba, const FbTk::Color* from, const FbTk::Color* to, FbTk::ImageControl& imgctrl) { - - size_t s = width * height; size_t i; int x;

@@ -614,7 +612,7 @@ FbTk::RGBA* rgba,

const FbTk::Color* from, const FbTk::Color* to, FbTk::ImageControl& imgctrl) { - size_t s = width * height; + size_t s = width + height; // we need 2 gradients but use only 'one' buffer FbTk::RGBA* x_gradient = (FbTk::RGBA*)&getGradientBuffer(s * sizeof(FbTk::RGBA))[0];