diff options
author | Pierre Ossman <ossman@cendio.se> | 2014-01-20 15:05:21 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2014-07-07 14:50:11 +0200 |
commit | b6b4dc6487690e891ec2487c6cf765d36821fe3a (patch) | |
tree | 77d2e0f49461c7ff8fc78872c9763fe9b6f67adb /vncviewer | |
parent | bcc295e5a60954ff39b011d6a2cbdf052a0efafc (diff) | |
download | tigervnc-b6b4dc6487690e891ec2487c6cf765d36821fe3a.tar.gz tigervnc-b6b4dc6487690e891ec2487c6cf765d36821fe3a.zip |
Remove full support for colour maps
Gets rid of a loooot of code and complexity.
Colour map clients are still supported through an
automatically generated map, but we lose the ability to
develop a client or server that uses colour maps
internally.
Diffstat (limited to 'vncviewer')
-rw-r--r-- | vncviewer/CConn.cxx | 7 | ||||
-rw-r--r-- | vncviewer/DesktopWindow.cxx | 6 | ||||
-rw-r--r-- | vncviewer/DesktopWindow.h | 2 | ||||
-rw-r--r-- | vncviewer/Viewport.cxx | 40 | ||||
-rw-r--r-- | vncviewer/Viewport.h | 9 | ||||
-rw-r--r-- | vncviewer/Win32PixelBuffer.cxx | 2 | ||||
-rw-r--r-- | vncviewer/X11PixelBuffer.cxx | 2 |
7 files changed, 10 insertions, 58 deletions
diff --git a/vncviewer/CConn.cxx b/vncviewer/CConn.cxx index 789cf09e..d7f57b5f 100644 --- a/vncviewer/CConn.cxx +++ b/vncviewer/CConn.cxx @@ -65,8 +65,9 @@ static const PixelFormat verylowColourPF(8, 3,false, true, // 64 colours (2 bits per component) static const PixelFormat lowColourPF(8, 6, false, true, 3, 3, 3, 4, 2, 0); -// 256 colours (palette) -static const PixelFormat mediumColourPF(8, 8, false, false); +// 256 colours (2-3 bits per component) +static const PixelFormat mediumColourPF(8, 8, false, true, + 7, 7, 3, 5, 2, 0); CConn::CConn(const char* vncServerName, network::Socket* socket=NULL) : serverHost(0), serverPort(0), desktop(NULL), @@ -342,7 +343,7 @@ void CConn::framebufferUpdateEnd() void CConn::setColourMapEntries(int firstColour, int nColours, rdr::U16* rgbs) { - desktop->setColourMapEntries(firstColour, nColours, rgbs); + vlog.error("Invalid SetColourMapEntries from server!"); } void CConn::bell() diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index 2a2f8734..3e9b57e6 100644 --- a/vncviewer/DesktopWindow.cxx +++ b/vncviewer/DesktopWindow.cxx @@ -216,12 +216,6 @@ void DesktopWindow::setName(const char *name) } -void DesktopWindow::setColourMapEntries(int firstColour, int nColours, - rdr::U16* rgbs) -{ - viewport->setColourMapEntries(firstColour, nColours, rgbs); -} - void DesktopWindow::fillRect(const rfb::Rect& r, rfb::Pixel pix) { viewport->fillRect(r, pix); } diff --git a/vncviewer/DesktopWindow.h b/vncviewer/DesktopWindow.h index 06f25f55..08a66522 100644 --- a/vncviewer/DesktopWindow.h +++ b/vncviewer/DesktopWindow.h @@ -50,8 +50,6 @@ public: // Methods forwarded from CConn void setName(const char *name); - void setColourMapEntries(int firstColour, int nColours, rdr::U16* rgbs); - void fillRect(const rfb::Rect& r, rfb::Pixel pix); void imageRect(const rfb::Rect& r, void* pixels); void copyRect(const rfb::Rect& r, int srcX, int srcY); diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index 0ac76024..a7296e9a 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -87,7 +87,7 @@ enum { ID_EXIT, ID_FULLSCREEN, ID_RESIZE, Viewport::Viewport(int w, int h, const rfb::PixelFormat& serverPF, CConn* cc_) : Fl_Widget(0, 0, w, h), cc(cc_), frameBuffer(NULL), pixelTrans(NULL), - colourMapChange(false), lastPointerPos(0, 0), lastButtonMask(0), + lastPointerPos(0, 0), lastButtonMask(0), cursor(NULL), menuCtrlKey(false), menuAltKey(false) { // FLTK STR #2599 must be fixed for proper dead keys support @@ -183,11 +183,11 @@ void Viewport::setServerPF(const rfb::PixelFormat& pf) PixelFormat fake_pf(pf.bpp, pf.depth, nativeBigEndian, pf.trueColour, pf.redMax, pf.greenMax, pf.blueMax, pf.redShift, pf.greenShift, pf.blueShift); - pixelTrans->init(fake_pf, &colourMap, getPreferredPF()); + pixelTrans->init(fake_pf, getPreferredPF()); return; } - pixelTrans->init(pf, &colourMap, getPreferredPF()); + pixelTrans->init(pf, getPreferredPF()); } @@ -197,21 +197,6 @@ const rfb::PixelFormat &Viewport::getPreferredPF() } -// setColourMapEntries() changes some of the entries in the colourmap. -// We don't actually act on these changes until we need to. This is -// because recalculating the internal translation table can be expensive. -// This also solves the issue of silly servers sending colour maps in -// multiple pieces. -void Viewport::setColourMapEntries(int firstColour, int nColours, - rdr::U16* rgbs) -{ - for (int i = 0; i < nColours; i++) - colourMap.set(firstColour+i, rgbs[i*3], rgbs[i*3+1], rgbs[i*3+2]); - - colourMapChange = true; -} - - // Copy the areas of the framebuffer that have been changed (damaged) // to the displayed window. @@ -230,8 +215,6 @@ void Viewport::updateWindow() void Viewport::fillRect(const rfb::Rect& r, rfb::Pixel pix) { if (pixelTrans) { rfb::Pixel pix2; - if (colourMapChange) - commitColourMap(); pixelTrans->translatePixels(&pix, &pix2, 1); pix = pix2; } @@ -242,8 +225,6 @@ void Viewport::fillRect(const rfb::Rect& r, rfb::Pixel pix) { void Viewport::imageRect(const rfb::Rect& r, void* pixels) { if (pixelTrans) { - if (colourMapChange) - commitColourMap(); pixelTrans->translateRect(pixels, r.width(), rfb::Rect(0, 0, r.width(), r.height()), frameBuffer->data, frameBuffer->getStride(), @@ -327,7 +308,7 @@ void Viewport::setCursor(int width, int height, const Point& hotspot, m_width = (width+7)/8; for (int y = 0;y < height;y++) { for (int x = 0;x < width;x++) { - pf->rgbFromBuffer(o, i, 1, &colourMap); + pf->rgbFromBuffer(o, i, 1); if (m[(m_width*y)+(x/8)] & 0x80>>(x%8)) o[3] = 255; @@ -529,19 +510,6 @@ void Viewport::handleUpdateTimeout(void *data) } -void Viewport::commitColourMap() -{ - if (pixelTrans == NULL) - return; - if (!colourMapChange) - return; - - colourMapChange = false; - - pixelTrans->setColourMapEntries(0, 0); -} - - void Viewport::handleClipboardChange(int source, void *data) { Viewport *self = (Viewport *)data; diff --git a/vncviewer/Viewport.h b/vncviewer/Viewport.h index e83a14ba..7859db6d 100644 --- a/vncviewer/Viewport.h +++ b/vncviewer/Viewport.h @@ -26,7 +26,6 @@ #include <rfb/Region.h> #include <rfb/Pixel.h> -#include <rfb/ColourMap.h> class Fl_Menu_Button; class Fl_RGB_Image; @@ -52,8 +51,6 @@ public: // Methods forwarded from CConn - void setColourMapEntries(int firstColour, int nColours, rdr::U16* rgbs); - void fillRect(const rfb::Rect& r, rfb::Pixel pix); void imageRect(const rfb::Rect& r, void* pixels); void copyRect(const rfb::Rect& r, int srcX, int srcY); @@ -77,8 +74,6 @@ private: static void handleUpdateTimeout(void *data); - void commitColourMap(); - static void handleClipboardChange(int source, void *data); void handlePointerEvent(const rfb::Point& pos, int buttonMask); @@ -98,11 +93,7 @@ private: CConn* cc; PlatformPixelBuffer* frameBuffer; - rfb::PixelTransformer *pixelTrans; - rfb::SimpleColourMap colourMap; - bool colourMapChange; - rfb::Region damage; rfb::Point lastPointerPos; diff --git a/vncviewer/Win32PixelBuffer.cxx b/vncviewer/Win32PixelBuffer.cxx index 626bb967..4ee15ce5 100644 --- a/vncviewer/Win32PixelBuffer.cxx +++ b/vncviewer/Win32PixelBuffer.cxx @@ -40,7 +40,7 @@ static rfb::LogWriter vlog("PlatformPixelBuffer"); PlatformPixelBuffer::PlatformPixelBuffer(int width, int height) : FullFramePixelBuffer(rfb::PixelFormat(32, 24, false, true, 255, 255, 255, 16, 8, 0), - width, height, NULL, NULL), + width, height, NULL), bitmap(NULL) { BITMAPINFOHEADER bih; diff --git a/vncviewer/X11PixelBuffer.cxx b/vncviewer/X11PixelBuffer.cxx index 548591e1..f834003e 100644 --- a/vncviewer/X11PixelBuffer.cxx +++ b/vncviewer/X11PixelBuffer.cxx @@ -94,7 +94,7 @@ static PixelFormat display_pf() } PlatformPixelBuffer::PlatformPixelBuffer(int width, int height) : - FullFramePixelBuffer(display_pf(), width, height, NULL, NULL), + FullFramePixelBuffer(display_pf(), width, height, NULL), shminfo(NULL), xim(NULL) { // Might not be open at this point |