Initial support all color formats by the vncviewer in
the scaling mode.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2103 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/win/vncviewer/DesktopWindow.cxx b/win/vncviewer/DesktopWindow.cxx
index 313b756..ee941fd 100644
--- a/win/vncviewer/DesktopWindow.cxx
+++ b/win/vncviewer/DesktopWindow.cxx
@@ -856,7 +856,7 @@
void
DesktopWindow::showLocalCursor() {
if (cursorAvailable && !cursorVisible && cursorInBuffer) {
- if (!buffer->getPF().equal(cursor.getPF()) ||
+ if (!buffer->getScaledPixelFormat().equal(cursor.getPF()) ||
cursor.getRect().is_empty()) {
vlog.info("attempting to render invalid local cursor");
cursorAvailable = false;
@@ -931,7 +931,7 @@
void
DesktopWindow::setPF(const PixelFormat& pf) {
// If the cursor is the wrong format then clear it
- if (!pf.equal(buffer->getPF()))
+ if (!pf.equal(buffer->getScaledPixelFormat()))
setCursor(0, 0, Point(), 0, 0);
// Update the desktop buffer
@@ -1022,13 +1022,13 @@
cursor.hotspot = hotspot;
cursor.setSize(w, h);
- cursor.setPF(buffer->getPF());
+ cursor.setPF(buffer->getScaledPixelFormat());
cursor.imageRect(cursor.getRect(), data);
memcpy(cursor.mask.buf, mask, cursor.maskLen());
cursor.crop();
cursorBacking.setSize(w, h);
- cursorBacking.setPF(buffer->getPF());
+ cursorBacking.setPF(buffer->getScaledPixelFormat());
cursorAvailable = true;
diff --git a/win/vncviewer/DesktopWindow.h b/win/vncviewer/DesktopWindow.h
index 6e7a1d0..11b6670 100644
--- a/win/vncviewer/DesktopWindow.h
+++ b/win/vncviewer/DesktopWindow.h
@@ -83,7 +83,7 @@
// - Set the pixel format, size etc of the underlying PixelBuffer
void setPF(const PixelFormat& pf);
- PixelFormat getPF() const { return buffer->getPF(); }
+ PixelFormat getPF() const { return buffer->getPixelFormat(); }
void setSize(int w, int h);
void setColour(int i, int r, int g, int b) {buffer->setColour(i, r, g, b);}
void setAutoScaling(bool as);