summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--unix/x0vncserver/XPixelBuffer.cxx18
-rw-r--r--unix/x0vncserver/XPixelBuffer.h4
-rw-r--r--unix/x0vncserver/x0vncserver.cxx5
3 files changed, 9 insertions, 18 deletions
diff --git a/unix/x0vncserver/XPixelBuffer.cxx b/unix/x0vncserver/XPixelBuffer.cxx
index 7e515b25..ed22508d 100644
--- a/unix/x0vncserver/XPixelBuffer.cxx
+++ b/unix/x0vncserver/XPixelBuffer.cxx
@@ -28,18 +28,14 @@
using namespace rfb;
XPixelBuffer::XPixelBuffer(Display *dpy, ImageFactory &factory,
- int offsetLeft, int offsetTop,
- int width, int height,
- ColourMap* cm)
+ const Rect &rect, ColourMap* cm)
: FullFramePixelBuffer(),
m_dpy(dpy),
- m_image(0),
- m_offsetLeft(offsetLeft),
- m_offsetTop(offsetTop),
+ m_image(factory.newImage(dpy, rect.width(), rect.height())),
+ m_offsetLeft(rect.tl.x),
+ m_offsetTop(rect.tl.y),
m_stride(0)
{
- m_image = factory.newImage(dpy, width, height);
-
// Fill in the PixelFormat structure of the parent class.
format.bpp = m_image->xim->bits_per_pixel;
format.depth = m_image->xim->depth;
@@ -53,13 +49,13 @@ XPixelBuffer::XPixelBuffer(Display *dpy, ImageFactory &factory,
format.blueMax = m_image->xim->blue_mask >> format.blueShift;
// Set up the remaining data of the parent class.
- width_ = width;
- height_ = height;
+ width_ = rect.width();
+ height_ = rect.height();
data = (rdr::U8 *)m_image->xim->data;
colourmap = cm;
// Calculate the distance in pixels between two subsequent scan
- // lines of the framebuffer.
+ // lines of the framebuffer. This may differ from image width.
m_stride = m_image->xim->bytes_per_line * 8 / m_image->xim->bits_per_pixel;
// Get initial screen image from the X display.
diff --git a/unix/x0vncserver/XPixelBuffer.h b/unix/x0vncserver/XPixelBuffer.h
index 7829038c..25a3d844 100644
--- a/unix/x0vncserver/XPixelBuffer.h
+++ b/unix/x0vncserver/XPixelBuffer.h
@@ -36,9 +36,7 @@ class XPixelBuffer : public FullFramePixelBuffer
{
public:
XPixelBuffer(Display *dpy, ImageFactory &factory,
- int offsetLeft, int offsetTop,
- int width, int height,
- ColourMap* cm);
+ const Rect &rect, ColourMap* cm);
virtual ~XPixelBuffer();
// We allow public access to the underlying Image object.
diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx
index 5016d12c..2d387618 100644
--- a/unix/x0vncserver/x0vncserver.cxx
+++ b/unix/x0vncserver/x0vncserver.cxx
@@ -180,10 +180,7 @@ public:
// Provide pixel buffer to the server object.
// FIXME: Pass coordinates in a structure?
- pb = new XPixelBuffer(dpy, factory,
- geometry->offsetLeft(), geometry->offsetTop(),
- geometry->width(), geometry->height(),
- this);
+ pb = new XPixelBuffer(dpy, factory, geometry->getRect(), this);
vlog.info("Allocated %s", pb->getImage()->classDesc());
server = vs;