diff options
author | Pierre Ossman <ossman@cendio.se> | 2011-07-15 08:26:51 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2011-07-15 08:26:51 +0000 |
commit | d8f848728e29c9e42c69f8d124221ab77a651639 (patch) | |
tree | 4eb9962b04a4a17a54c1ac306670479a32269e9b | |
parent | 62ea8a2b24b1f1090cd6ed1e9d728ee32cbb65a6 (diff) | |
download | tigervnc-d8f848728e29c9e42c69f8d124221ab77a651639.tar.gz tigervnc-d8f848728e29c9e42c69f8d124221ab77a651639.zip |
Make sure we use the correct pixel format for cursors when in non-native mode.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4592 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r-- | vncviewer/Viewport.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index dcadd0ef..cf575397 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -223,7 +223,12 @@ void Viewport::setCursor(int width, int height, const Point& hotspot, U8 *i, *o, *m; int m_width; - const PixelFormat &pf = frameBuffer->getPF(); + const PixelFormat *pf; + + if (pixelTrans) + pf = &pixelTrans->getInPF(); + else + pf = &frameBuffer->getPF(); i = (U8*)data; o = buffer; @@ -231,7 +236,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, &colourMap); if (m[(m_width*y)+(x/8)] & 0x80>>(x%8)) o[3] = 255; @@ -239,7 +244,7 @@ void Viewport::setCursor(int width, int height, const Point& hotspot, o[3] = 0; o += 4; - i += pf.bpp/8; + i += pf->bpp/8; } } |