aboutsummaryrefslogtreecommitdiffstats
path: root/win/rfb_win32/DeviceFrameBuffer.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2014-01-20 15:05:21 +0100
committerPierre Ossman <ossman@cendio.se>2014-07-07 14:50:11 +0200
commitb6b4dc6487690e891ec2487c6cf765d36821fe3a (patch)
tree77d2e0f49461c7ff8fc78872c9763fe9b6f67adb /win/rfb_win32/DeviceFrameBuffer.cxx
parentbcc295e5a60954ff39b011d6a2cbdf052a0efafc (diff)
downloadtigervnc-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 'win/rfb_win32/DeviceFrameBuffer.cxx')
-rw-r--r--win/rfb_win32/DeviceFrameBuffer.cxx50
1 files changed, 2 insertions, 48 deletions
diff --git a/win/rfb_win32/DeviceFrameBuffer.cxx b/win/rfb_win32/DeviceFrameBuffer.cxx
index cc9bbcad..33b1be5a 100644
--- a/win/rfb_win32/DeviceFrameBuffer.cxx
+++ b/win/rfb_win32/DeviceFrameBuffer.cxx
@@ -79,10 +79,6 @@ DeviceFrameBuffer::DeviceFrameBuffer(HDC deviceContext, const Rect& wRect)
// Configure the cursor buffer
cursorBm.setPF(format);
-
- // Set up a palette if required
- if (!format.trueColour)
- updateColourMap();
}
DeviceFrameBuffer::~DeviceFrameBuffer() {
@@ -134,37 +130,6 @@ DeviceFrameBuffer::grabRegion(const Region &rgn) {
}
-void copyDevicePaletteToDIB(HDC dc, DIBSectionBuffer* dib) {
- // - Fetch the system palette for the framebuffer
- PALETTEENTRY syspalette[256];
- UINT entries = ::GetSystemPaletteEntries(dc, 0, 256, syspalette);
-
- if (entries == 0) {
- vlog.info("resorting to standard 16 color palette");
- for (unsigned int i=0;i<256;i++) {
- int v = (i%16) >= 8 ? 127 : 255;
- syspalette[i].peRed = i & 1 ? v : 0;
- syspalette[i].peGreen = i & 2 ? v : 0;
- syspalette[i].peBlue = i & 4 ? v : 0;
- }
- } else {
- vlog.info("framebuffer has %u palette entries", entries);
- }
-
- // - Update the bitmap's stored copy of the palette
- for (unsigned int i=0;i<256;i++) {
- int r, g, b;
- r = (syspalette[i].peRed << 8) + 0x80;
- g = (syspalette[i].peGreen << 8) + 0x80;
- b = (syspalette[i].peBlue << 8) + 0x80;
- dib->setColour(i, r, g, b);
- }
-
- // - Update the DIB section to use the palette
- dib->refreshPalette();
-}
-
-
void DeviceFrameBuffer::setCursor(HCURSOR hCursor, VNCServer* server)
{
// - If hCursor is null then there is no cursor - clear the old one
@@ -211,10 +176,6 @@ void DeviceFrameBuffer::setCursor(HCURSOR hCursor, VNCServer* server)
// Configure the cursor bitmap
cursorBm.setSize(cursor.width(), cursor.height());
- // Copy the palette into it if required
- if (format.bpp <= 8)
- copyDevicePaletteToDIB(device, &cursorBm);
-
// Draw the cursor into the bitmap
BitmapDC dc(device, cursorBm.bitmap);
if (!DrawIconEx(dc, 0, 0, hCursor, 0, 0, 0, NULL, DI_NORMAL | DI_COMPAT))
@@ -231,7 +192,7 @@ void DeviceFrameBuffer::setCursor(HCURSOR hCursor, VNCServer* server)
bool doOutline = false;
if (!iconInfo.hbmColor) {
- Pixel xorColour = format.pixelFromRGB((rdr::U16)0, (rdr::U16)0, (rdr::U16)0, cursorBm.getColourMap());
+ Pixel xorColour = format.pixelFromRGB((rdr::U16)0, (rdr::U16)0, (rdr::U16)0);
for (int y = 0; y < cursor.height(); y++) {
for (int x = 0; x < cursor.width(); x++) {
int byte = y * maskInfo.bmWidthBytes + x / 8;
@@ -269,7 +230,7 @@ void DeviceFrameBuffer::setCursor(HCURSOR hCursor, VNCServer* server)
if (doOutline) {
vlog.debug("drawing cursor outline!");
memcpy(cursor.data, cursorBm.data, cursor.dataLen());
- cursor.drawOutline(format.pixelFromRGB((rdr::U16)0xffff, (rdr::U16)0xffff, (rdr::U16)0xffff, cursorBm.getColourMap()));
+ cursor.drawOutline(format.pixelFromRGB((rdr::U16)0xffff, (rdr::U16)0xffff, (rdr::U16)0xffff));
memcpy(cursorBm.data, cursor.data, cursor.dataLen());
}
@@ -279,10 +240,3 @@ void DeviceFrameBuffer::setCursor(HCURSOR hCursor, VNCServer* server)
vlog.error("%s", e.str());
}
}
-
-
-void
-DeviceFrameBuffer::updateColourMap() {
- if (!format.trueColour)
- copyDevicePaletteToDIB(device, this);
-}