diff options
Diffstat (limited to 'unix/x0vncserver/XPixelBuffer.cxx')
-rw-r--r-- | unix/x0vncserver/XPixelBuffer.cxx | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/unix/x0vncserver/XPixelBuffer.cxx b/unix/x0vncserver/XPixelBuffer.cxx index f691c576..aa52620a 100644 --- a/unix/x0vncserver/XPixelBuffer.cxx +++ b/unix/x0vncserver/XPixelBuffer.cxx @@ -1,4 +1,5 @@ /* Copyright (C) 2007-2008 Constantin Kaplinsky. All Rights Reserved. + * Copyright 2014 Pierre Ossman for Cendio AB * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,16 +39,16 @@ XPixelBuffer::XPixelBuffer(Display *dpy, ImageFactory &factory, m_stride(0) { // Fill in the PixelFormat structure of the parent class. - format.bpp = m_image->xim->bits_per_pixel; - format.depth = m_image->xim->depth; - format.bigEndian = (m_image->xim->byte_order == MSBFirst); - format.trueColour = m_image->isTrueColor(); - format.redShift = ffs(m_image->xim->red_mask) - 1; - format.greenShift = ffs(m_image->xim->green_mask) - 1; - format.blueShift = ffs(m_image->xim->blue_mask) - 1; - format.redMax = m_image->xim->red_mask >> format.redShift; - format.greenMax = m_image->xim->green_mask >> format.greenShift; - format.blueMax = m_image->xim->blue_mask >> format.blueShift; + format = PixelFormat(m_image->xim->bits_per_pixel, + m_image->xim->depth, + (m_image->xim->byte_order == MSBFirst), + m_image->isTrueColor(), + m_image->xim->red_mask >> (ffs(m_image->xim->red_mask) - 1), + m_image->xim->green_mask >> (ffs(m_image->xim->green_mask) - 1), + m_image->xim->blue_mask >> (ffs(m_image->xim->blue_mask) - 1), + ffs(m_image->xim->red_mask) - 1, + ffs(m_image->xim->green_mask) - 1, + ffs(m_image->xim->blue_mask) - 1); // Set up the remaining data of the parent class. width_ = rect.width(); |