summaryrefslogtreecommitdiff
path: root/vcl/headless/svpgdi.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-01-18 18:27:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-17 12:56:51 +0200
commit9090dc1f3b27195f5defd35586ac79357992be21 (patch)
treed39f4b624ae337d5c9ce76eba8521b76e53afa05 /vcl/headless/svpgdi.cxx
parentc8cf2e0e088b74afa52564945a9c005b3b86bf7e (diff)
split OutputDevice from Window
as part of a longer-term goal of doing our widget rendering only inside a top-level render- context. I moved all of the OutputDevice-related code that existed in vcl::Window into a new subclass of OutputDevice called WindowOutputDevice. Notes for further work (*) not sure why we are getting an 1x1 surface in SvpSalGraphics::releaseCairoContext, but to fix it I clamp the size there (*) might have to dump VCLXDevice, and move it's code down into VCLXWindow and VCLXVirtualDevice (*) can we remove use of VCLXDevice in other places, in favour of just talking to the VCL code? Change-Id: I105946377f5322677d6f7d0c1c23847178a720b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113204 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/headless/svpgdi.cxx')
-rw-r--r--vcl/headless/svpgdi.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 84d0d3b02d2c..c756c79ae60a 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -2583,6 +2583,19 @@ void SvpSalGraphics::releaseCairoContext(cairo_t* cr, bool bXorModeAllowed, cons
sal_Int32 nUnscaledExtentsRight = nExtentsRight * m_fScale;
sal_Int32 nUnscaledExtentsTop = nExtentsTop * m_fScale;
sal_Int32 nUnscaledExtentsBottom = nExtentsBottom * m_fScale;
+
+ // not sure why this happens
+ int target_surface_width = cairo_image_surface_get_width(target_surface);
+ if (nUnscaledExtentsLeft > target_surface_width)
+ nUnscaledExtentsLeft = target_surface_width;
+ if (nUnscaledExtentsRight > target_surface_width)
+ nUnscaledExtentsRight = target_surface_width;
+ int target_surface_height = cairo_image_surface_get_height(target_surface);
+ if (nUnscaledExtentsTop > target_surface_height)
+ nUnscaledExtentsTop = target_surface_height;
+ if (nUnscaledExtentsBottom > target_surface_height)
+ nUnscaledExtentsBottom = target_surface_height;
+
vcl::bitmap::lookup_table const & unpremultiply_table
= vcl::bitmap::get_unpremultiply_table();
vcl::bitmap::lookup_table const & premultiply_table = vcl::bitmap::get_premultiply_table();