diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-02-05 12:11:16 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-02-05 14:47:07 +0000 |
commit | ebd684486903021f3bd1434474876667d4430c97 (patch) | |
tree | 014bbfc823a26ca4911b2d69875e36846c7c0dcd /vcl/headless | |
parent | be2bf03563873602515d0c784d2a15488ca46ac0 (diff) |
ok non-zeroed empty extents is legitimate after all
Change-Id: Ida1e27322bad5d2d36ae4217bb84187a022ebadf
Diffstat (limited to 'vcl/headless')
-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); |