diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-01-13 10:30:07 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-01-18 11:34:09 +0000 |
commit | e1d1f92eb90d4ed9f2c4123dc33e473a67497734 (patch) | |
tree | 319022ff40ad791de2f4ac20ed6b2aefe04a9a9b /vcl | |
parent | dd0a16bb6b2a674b60a2f7e55307c2800ad4c427 (diff) |
refactor to reuse
Change-Id: Ifee1b845eb4c46f35a4ad0b45bf49320772e9569
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/headless/svpgdi.cxx | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index d90024e08982..2ab29b142917 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -1137,13 +1137,9 @@ void SvpSalGraphics::copyArea( long nDestX, copyBits(aTR, this); } -void SvpSalGraphics::copySource( const SalTwoRect& rTR, - cairo_surface_t* source ) +static cairo_rectangle_int_t renderSource(cairo_t* cr, const SalTwoRect& rTR, + cairo_surface_t* source) { - cairo_t* cr = getCairoContext(false); - assert(cr && m_aDevice->isTopDown()); - clipRegion(cr); - cairo_rectangle(cr, rTR.mnDestX, rTR.mnDestY, rTR.mnDestWidth, rTR.mnDestHeight); cairo_rectangle_int_t extents = getFillDamage(cr); @@ -1155,6 +1151,18 @@ void SvpSalGraphics::copySource( const SalTwoRect& rTR, cairo_set_source_surface(cr, source, -rTR.mnSrcX, -rTR.mnSrcY); cairo_paint(cr); + return extents; +} + +void SvpSalGraphics::copySource( const SalTwoRect& rTR, + cairo_surface_t* source ) +{ + cairo_t* cr = getCairoContext(false); + assert(cr && m_aDevice->isTopDown()); + clipRegion(cr); + + cairo_rectangle_int_t extents = renderSource(cr, rTR, source); + releaseCairoContext(cr, false, extents); } |