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
1 files changed,
5 insertions(+),
7 deletions(-)
jump to
M
src/FbTk/TextureRender.cc
→
src/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];