@@ -1805,58 +1805,6 @@ wxBitmap VNCConn::getFrameBufferRegion(const wxRect& rect)
18051805}
18061806
18071807
1808-
1809-
1810- bool VNCConn::getFrameBufferRegion (const wxRect& rect, wxBitmap& dst)
1811- {
1812- wxCriticalSectionLocker lock (mutex_framebuffer);
1813-
1814- // sanity check requested region against framebuffer
1815- if (rect.x < 0 || rect.x + rect.width > getFrameBufferWidth ()
1816- || rect.y < 0 || rect.y + rect.height > getFrameBufferHeight ())
1817- return false ;
1818-
1819- // check dst against framebuffer
1820- if (dst.GetWidth () != getFrameBufferWidth () || dst.GetHeight () != getFrameBufferHeight ())
1821- return false ;
1822-
1823- /*
1824- copy directly from framebuffer into the destination bitmap
1825- */
1826- wxAlphaPixelData dst_data (dst);
1827- wxAlphaPixelData::Iterator dst_it (dst_data);
1828- dst_it.Offset (dst_data, rect.x , rect.y );
1829-
1830- int bytesPerPixel = cl->format .bitsPerPixel /8 ;
1831- uint8_t *fbsub_it = cl->frameBuffer + rect.y *cl->width *bytesPerPixel + rect.x *bytesPerPixel;
1832-
1833- for ( int y = 0 ; y < rect.height ; ++y )
1834- {
1835- wxAlphaPixelData::Iterator dst_it_rowStart = dst_it;
1836- uint8_t *fbsub_it_rowStart = fbsub_it;
1837-
1838- for ( int x = 0 ; x < rect.width ; ++x, ++dst_it, fbsub_it += bytesPerPixel)
1839- {
1840- dst_it.Red () = *(fbsub_it+0 );
1841- dst_it.Green () = *(fbsub_it+1 );
1842- dst_it.Blue () = *(fbsub_it+2 );
1843- dst_it.Alpha () = 255 ; // 255 is opaque, libvncclient always sets this byte to 0
1844- }
1845-
1846- // CR
1847- dst_it = dst_it_rowStart;
1848- fbsub_it = fbsub_it_rowStart;
1849-
1850- // LF
1851- dst_it.OffsetY (dst_data, 1 );
1852- fbsub_it += cl->width * bytesPerPixel;
1853- }
1854-
1855- return true ;
1856- }
1857-
1858-
1859-
18601808int VNCConn::getFrameBufferWidth ()
18611809{
18621810 wxCriticalSectionLocker lock (mutex_framebuffer);
0 commit comments