diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-02-04 21:14:59 +0000 |
---|---|---|
committer | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2017-12-18 01:07:41 -0500 |
commit | c2a072732a2447d5733ab456a5f03faaf6c54308 (patch) | |
tree | c61f9896cfb685c0998ff6fe4aa77a267c7ef577 /vcl/headless/svpvd.cxx | |
parent | 448a931f776f2d4e4ca2e44c49f830653af7efbc (diff) |
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)
Diffstat (limited to 'vcl/headless/svpvd.cxx')
-rw-r--r-- | vcl/headless/svpvd.cxx | 21 |
1 files changed, 11 insertions, 10 deletions
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 |