diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-02-04 21:14:59 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-02-07 13:07:57 +0000 |
commit | 7863798f2ab420fdb91ba3dcda6cea2ab2aded9d (patch) | |
tree | 32ec8459ffd30c04b18c48d0c2374344ad7ebbec /vcl/headless/svpvd.cxx | |
parent | 5ddf5d8dc60cdc44515e5f551bf1a61a4f1e62bc (diff) |
bubble the original gtk surface type through rendering
this may make scrolling a tad faster
Change-Id: I5f11f9b3196c3d42c82ac03bc332ef84189f3737
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 |