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/Viewport.cxx | |
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/Viewport.cxx')
-rw-r--r-- | vncviewer/Viewport.cxx | 40 |
1 files changed, 4 insertions, 36 deletions
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; |