diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2017-03-12 17:25:04 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2017-03-12 17:33:17 +0100 |
commit | 494e7218597a6cd94902b3ae6f827e74b41c00b0 (patch) | |
tree | 8b0e7359b9664249945b62a0012c2178b5faf823 /plugingui/pixelbuffer.cc | |
parent | 75de9c0ac782fa6fecb92f3a22f311b517856abb (diff) |
Fix redrawing of underlying exposed area on Widget moves/resizing.
Diffstat (limited to 'plugingui/pixelbuffer.cc')
-rw-r--r-- | plugingui/pixelbuffer.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/plugingui/pixelbuffer.cc b/plugingui/pixelbuffer.cc index bbef84c..360ad06 100644 --- a/plugingui/pixelbuffer.cc +++ b/plugingui/pixelbuffer.cc @@ -33,7 +33,7 @@ namespace GUI { -PixelBuffer::PixelBuffer(size_t width, size_t height) +PixelBuffer::PixelBuffer(std::size_t width, std::size_t height) : buf(nullptr) { realloc(width, height); @@ -44,7 +44,7 @@ PixelBuffer::~PixelBuffer() free(buf); } -void PixelBuffer::realloc(size_t width, size_t height) +void PixelBuffer::realloc(std::size_t width, std::size_t height) { free(buf); buf = (unsigned char *)calloc(width * height, 3); @@ -53,7 +53,7 @@ void PixelBuffer::realloc(size_t width, size_t height) } #define PX(k) ((x + y * width) * 3 + k) -void PixelBuffer::setPixel(size_t x, size_t y, +void PixelBuffer::setPixel(std::size_t x, std::size_t y, unsigned char red, unsigned char green, unsigned char blue, @@ -84,7 +84,7 @@ void PixelBuffer::setPixel(size_t x, size_t y, } } -PixelBufferAlpha::PixelBufferAlpha(size_t width, size_t height) +PixelBufferAlpha::PixelBufferAlpha(std::size_t width, std::size_t height) : managed(true) , buf(nullptr) , x(0) @@ -101,7 +101,7 @@ PixelBufferAlpha::~PixelBufferAlpha() } } -void PixelBufferAlpha::realloc(size_t width, size_t height) +void PixelBufferAlpha::realloc(std::size_t width, std::size_t height) { free(buf); buf = (unsigned char *)calloc(width * height, 4); @@ -111,7 +111,7 @@ void PixelBufferAlpha::realloc(size_t width, size_t height) #undef PX #define PX(k) ((x + y * width) * 4 + k) -void PixelBufferAlpha::setPixel(size_t x, size_t y, +void PixelBufferAlpha::setPixel(std::size_t x, std::size_t y, unsigned char red, unsigned char green, unsigned char blue, @@ -135,7 +135,7 @@ static inline void getAlpha(unsigned char _a, unsigned char _b, b *= (1 - a); } -void PixelBufferAlpha::addPixel(size_t x, size_t y, +void PixelBufferAlpha::addPixel(std::size_t x, std::size_t y, unsigned char red, unsigned char green, unsigned char blue, @@ -172,13 +172,13 @@ void PixelBufferAlpha::addPixel(size_t x, size_t y, } } -void PixelBufferAlpha::addPixel(size_t x, size_t y, const Colour& c) +void PixelBufferAlpha::addPixel(std::size_t x, std::size_t y, const Colour& c) { addPixel(x, y, c.red() * 255, c.green() * 255, c.blue() * 255, c.alpha() * 255); } -void PixelBufferAlpha::pixel(size_t x, size_t y, +void PixelBufferAlpha::pixel(std::size_t x, std::size_t y, unsigned char* red, unsigned char* green, unsigned char* blue, |