Change fillRect() to take a buffer instead of a pixel
There has been some confusion if fillRect() should accept a buffer
or a pixel. This can cause misrendering if your data is not in the
native endian order. A buffer makes more sense here though, and
is what most of the callers are already assuming, so change the
API to follow that.
diff --git a/common/rfb/SDesktop.h b/common/rfb/SDesktop.h
index 546506a..833762e 100644
--- a/common/rfb/SDesktop.h
+++ b/common/rfb/SDesktop.h
@@ -92,12 +92,16 @@
public:
SStaticDesktop(const Point& size) : server(0), buffer(0) {
PixelFormat pf;
+ const rdr::U8 black[4] = { 0, 0, 0, 0 };
buffer = new ManagedPixelBuffer(pf, size.x, size.y);
- if (buffer) buffer->fillRect(buffer->getRect(), 0);
+ if (buffer)
+ buffer->fillRect(buffer->getRect(), black);
}
SStaticDesktop(const Point& size, const PixelFormat& pf) : buffer(0) {
+ const rdr::U8 black[4] = { 0, 0, 0, 0 };
buffer = new ManagedPixelBuffer(pf, size.x, size.y);
- if (buffer) buffer->fillRect(buffer->getRect(), 0);
+ if (buffer)
+ buffer->fillRect(buffer->getRect(), black);
}
virtual ~SStaticDesktop() {
if (buffer) delete buffer;