diff options
Diffstat (limited to 'vcl/headless/svpgdi.cxx')
-rw-r--r-- | vcl/headless/svpgdi.cxx | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 9c9de7450afc..b0f8de8269d0 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -1271,21 +1271,15 @@ cairo_user_data_key_t* SvpSalGraphics::getDamageKey() void SvpSalGraphics::releaseCairoContext(cairo_t* cr, bool bXorModeAllowed, const basegfx::B2DRange& rExtents) const { - sal_Int32 nExtentsLeft; - sal_Int32 nExtentsTop; - sal_Int32 nExtentsRight; - sal_Int32 nExtentsBottom; - if (rExtents.isEmpty()) { - nExtentsLeft = 0; - nExtentsTop = 0; - nExtentsRight = 0; - nExtentsBottom = 0; - } else { - nExtentsLeft = rExtents.getMinX(); - nExtentsTop = rExtents.getMinY(); - nExtentsRight = rExtents.getMaxX(); - nExtentsBottom = rExtents.getMaxY(); + if (rExtents.isEmpty()) + { + //nothing changed, return early + cairo_destroy(cr); + return; } + + sal_Int32 nExtentsLeft(rExtents.getMinX()), nExtentsTop(rExtents.getMinY()); + sal_Int32 nExtentsRight(rExtents.getMaxX()), nExtentsBottom(rExtents.getMaxY()); sal_Int32 nWidth = cairo_image_surface_get_width(m_pSurface); sal_Int32 nHeight = cairo_image_surface_get_height(m_pSurface); nExtentsLeft = std::max<sal_Int32>(nExtentsLeft, 0); |