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/PixelBuffer.h b/common/rfb/PixelBuffer.h
index b0db6eb..ba586b0 100644
--- a/common/rfb/PixelBuffer.h
+++ b/common/rfb/PixelBuffer.h
@@ -119,7 +119,7 @@
// These operations DO NOT clip to the pixelbuffer area, or trap overruns.
// Fill a rectangle
- void fillRect(const Rect &dest, Pixel pix);
+ void fillRect(const Rect &dest, const void* pix);
// Copy pixel data to the buffer
void imageRect(const Rect &dest, const void* pixels, int stride=0);
@@ -140,7 +140,7 @@
// Render in a specific format
// Does the exact same thing as the above methods, but the given
// pixel values are defined by the given PixelFormat.
- void fillRect(const PixelFormat& pf, const Rect &dest, Pixel pix);
+ void fillRect(const PixelFormat& pf, const Rect &dest, const void* pix);
void imageRect(const PixelFormat& pf, const Rect &dest,
const void* pixels, int stride=0);