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/Cursor.cxx b/common/rfb/Cursor.cxx
index 8ef8b17..3bb8e0f 100644
--- a/common/rfb/Cursor.cxx
+++ b/common/rfb/Cursor.cxx
@@ -38,6 +38,7 @@
void Cursor::drawOutline(const Pixel& c)
{
Cursor outlined;
+ rdr::U8 cbuf[4];
// Create a mirror of the existing cursor
outlined.setPF(getPF());
@@ -45,7 +46,8 @@
outlined.hotspot = hotspot;
// Clear the mirror's background to the outline colour
- outlined.fillRect(getRect(), c);
+ outlined.getPF().bufferFromPixel(cbuf, c);
+ outlined.fillRect(getRect(), cbuf);
// Blit the existing cursor, using its mask
outlined.maskRect(getRect(), data, mask.buf);