Kaydet (Commit) ebd68448 authored tarafından Caolán McNamara's avatar Caolán McNamara

ok non-zeroed empty extents is legitimate after all

Change-Id: Ida1e27322bad5d2d36ae4217bb84187a022ebadf
üst be2bf035
...@@ -1271,21 +1271,15 @@ cairo_user_data_key_t* SvpSalGraphics::getDamageKey() ...@@ -1271,21 +1271,15 @@ cairo_user_data_key_t* SvpSalGraphics::getDamageKey()
void SvpSalGraphics::releaseCairoContext(cairo_t* cr, bool bXorModeAllowed, const basegfx::B2DRange& rExtents) const void SvpSalGraphics::releaseCairoContext(cairo_t* cr, bool bXorModeAllowed, const basegfx::B2DRange& rExtents) const
{ {
sal_Int32 nExtentsLeft; if (rExtents.isEmpty())
sal_Int32 nExtentsTop; {
sal_Int32 nExtentsRight; //nothing changed, return early
sal_Int32 nExtentsBottom; cairo_destroy(cr);
if (rExtents.isEmpty()) { return;
nExtentsLeft = 0;
nExtentsTop = 0;
nExtentsRight = 0;
nExtentsBottom = 0;
} else {
nExtentsLeft = rExtents.getMinX();
nExtentsTop = rExtents.getMinY();
nExtentsRight = rExtents.getMaxX();
nExtentsBottom = rExtents.getMaxY();
} }
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 nWidth = cairo_image_surface_get_width(m_pSurface);
sal_Int32 nHeight = cairo_image_surface_get_height(m_pSurface); sal_Int32 nHeight = cairo_image_surface_get_height(m_pSurface);
nExtentsLeft = std::max<sal_Int32>(nExtentsLeft, 0); nExtentsLeft = std::max<sal_Int32>(nExtentsLeft, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment