summaryrefslogtreecommitdiffstats
path: root/vncviewer
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2015-06-05 12:57:02 +0200
committerPierre Ossman <ossman@cendio.se>2015-06-05 12:57:02 +0200
commit56f99d63df16836e03cc8bc2c531684e89e1b6f1 (patch)
tree4b163e1f2abed34a71840e87ebf59aa21de2adf0 /vncviewer
parent500cb6ef11a52345bf49e751976bff386e6e09ef (diff)
downloadtigervnc-56f99d63df16836e03cc8bc2c531684e89e1b6f1.tar.gz
tigervnc-56f99d63df16836e03cc8bc2c531684e89e1b6f1.zip
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.
Diffstat (limited to 'vncviewer')
-rw-r--r--vncviewer/Viewport.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx
index 3d0d6888..ca65acde 100644
--- a/vncviewer/Viewport.cxx
+++ b/vncviewer/Viewport.cxx
@@ -281,6 +281,8 @@ void Viewport::resize(int x, int y, int w, int h)
const rdr::U8* data;
int stride;
+ const rdr::U8 black[4] = { 0, 0, 0, 0 };
+
// FIXME: Resize should probably be a feature of the pixel buffer itself
if ((w == frameBuffer->width()) && (h == frameBuffer->height()))
@@ -304,14 +306,14 @@ void Viewport::resize(int x, int y, int w, int h)
rect.setXYWH(frameBuffer->width(), 0,
newBuffer->width() - frameBuffer->width(),
newBuffer->height());
- newBuffer->fillRect(rect, 0);
+ newBuffer->fillRect(rect, black);
}
if (newBuffer->height() > frameBuffer->height()) {
rect.setXYWH(0, frameBuffer->height(),
newBuffer->width(),
newBuffer->height() - frameBuffer->height());
- newBuffer->fillRect(rect, 0);
+ newBuffer->fillRect(rect, black);
}
delete frameBuffer;