From c2a072732a2447d5733ab456a5f03faaf6c54308 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 4 Feb 2017 21:14:59 +0000 Subject: bubble the original gtk surface type through rendering this may make scrolling a tad faster Change-Id: I5f11f9b3196c3d42c82ac03bc332ef84189f3737 (cherry picked from commit 7863798f2ab420fdb91ba3dcda6cea2ab2aded9d) (cherry picked from commit 4ed5d561f1fff1e7db8b83cec458e76b8e30cb82) --- vcl/headless/svpvd.cxx | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'vcl/headless/svpvd.cxx') diff --git a/vcl/headless/svpvd.cxx b/vcl/headless/svpvd.cxx index ca28a5246b46..b5ab755a0d1b 100644 --- a/vcl/headless/svpvd.cxx +++ b/vcl/headless/svpvd.cxx @@ -38,7 +38,7 @@ SvpSalVirtualDevice::~SvpSalVirtualDevice() SalGraphics* SvpSalVirtualDevice::AcquireGraphics() { SvpSalGraphics* pGraphics = new SvpSalGraphics(); - pGraphics->setSurface(m_pSurface); + pGraphics->setSurface(m_pSurface, m_aFrameSize); m_aGraphics.push_back( pGraphics ); return pGraphics; } @@ -62,12 +62,14 @@ bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY, if (nNewDY == 0) nNewDY = 1; - nNewDX *= m_fScale; - nNewDY *= m_fScale; - - if (!m_pSurface || cairo_image_surface_get_width(m_pSurface) != nNewDX || - cairo_image_surface_get_height(m_pSurface) != nNewDY ) + if (!m_pSurface || m_aFrameSize.getX() != nNewDX || + m_aFrameSize.getY() != nNewDY ) { + m_aFrameSize = basegfx::B2IVector(nNewDX, nNewDY); + + nNewDX *= m_fScale; + nNewDY *= m_fScale; + if (m_pSurface) { cairo_surface_destroy(m_pSurface); @@ -96,20 +98,19 @@ bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY, // update device in existing graphics for( std::list< SvpSalGraphics* >::iterator it = m_aGraphics.begin(); it != m_aGraphics.end(); ++it ) - (*it)->setSurface(m_pSurface); - + (*it)->setSurface(m_pSurface, m_aFrameSize); } return true; } long SvpSalVirtualDevice::GetWidth() const { - return m_pSurface ? cairo_image_surface_get_width(m_pSurface) : 0; + return m_pSurface ? m_aFrameSize.getX() : 0; } long SvpSalVirtualDevice::GetHeight() const { - return m_pSurface ? cairo_image_surface_get_height(m_pSurface) : 0; + return m_pSurface ? m_aFrameSize.getY() : 0; } #endif -- cgit