diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-11-22 15:35:16 +0000 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2016-11-23 22:40:58 +0000 |
commit | d9a6e0023c9a192850b9db00f8120fbcc4256ec9 (patch) | |
tree | 41e3ea0e81c4f0bc1581e61919ef3d0db6711c42 /vcl/headless/svpgdi.cxx | |
parent | d689ad29c28ad7f077c2239a8fa4c2b6307a6aa1 (diff) |
Resolves: tdf#99508 ensure sufficient size for hidpi backing surface
and match virtual device scale with widget device scale
Change-Id: I1f35dcbaec94be12758ad6e4276bfd6bda4b1e88
Reviewed-on: https://gerrit.libreoffice.org/31080
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Jenkins <ci@libreoffice.org>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/headless/svpgdi.cxx')
-rw-r--r-- | vcl/headless/svpgdi.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 1f861e7d8651..46d8a8a8dbda 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -374,6 +374,7 @@ bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, SvpSalGraphics::SvpSalGraphics() : m_pSurface(nullptr) + , m_fScale(1.0) , m_aLineColor(MAKE_SALCOLOR(0x00, 0x00, 0x00)) , m_aFillColor(MAKE_SALCOLOR(0xFF, 0xFF, 0XFF)) , m_ePaintMode(OVERPAINT) @@ -388,6 +389,7 @@ SvpSalGraphics::~SvpSalGraphics() void SvpSalGraphics::setSurface(cairo_surface_t* pSurface) { m_pSurface = pSurface; + cairo_surface_get_device_scale(pSurface, &m_fScale, nullptr); ResetClipRegion(); } @@ -981,14 +983,15 @@ void SvpSalGraphics::copyBits( const SalTwoRect& rTR, #if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 12, 0) pCopy = cairo_surface_create_similar(source, cairo_surface_get_content(m_pSurface), - aTR.mnSrcWidth, - aTR.mnSrcHeight); + aTR.mnSrcWidth * m_fScale, + aTR.mnSrcHeight * m_fScale); #else pCopy = cairo_surface_create_similar_image(source, cairo_image_surface_get_format(m_pSurface), - aTR.mnSrcWidth, - aTR.mnSrcHeight); + aTR.mnSrcWidth * m_fScale, + aTR.mnSrcHeight * m_fScale); #endif + cairo_surface_set_device_scale(pCopy, m_fScale, m_fScale); cairo_t* cr = cairo_create(pCopy); cairo_set_source_surface(cr, source, -aTR.mnSrcX, -aTR.mnSrcY); |