diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-11-25 20:39:34 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-11-25 20:43:01 +0000 |
commit | db884459a0e250122f8bbcc906107ce424f1e955 (patch) | |
tree | 63838a63ec45aca28ebfc7e05a3f2bc62f2b821c /vcl/headless | |
parent | ce79da83338b1a9eb11214c24c456f858b6e1daa (diff) |
gtk3: use cairo to do drawAlphaBitmap with scaling
now we're beautiful
Change-Id: If688a89c3a65b7f9bb01890f8ddc81fc6cc8c2b8
Diffstat (limited to 'vcl/headless')
-rw-r--r-- | vcl/headless/svpgdi.cxx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index ccfdd5c38b33..477b33ed9cdd 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -156,12 +156,6 @@ bool SvpSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, const SalBitmap& rS return false; } - if (rTR.mnSrcWidth != rTR.mnDestWidth || rTR.mnSrcHeight != rTR.mnDestHeight) - { - SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::drawAlphaBitmap scale case"); - return false; - } - cairo_surface_t* source = nullptr; const SvpSalBitmap& rSrc = static_cast<const SvpSalBitmap&>(rSourceBitmap); @@ -259,13 +253,15 @@ bool SvpSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, const SalBitmap& rS cairo_rectangle(cr, rTR.mnDestX, rTR.mnDestY, rTR.mnDestWidth, rTR.mnDestHeight); - cairo_set_source_surface(cr, source, rTR.mnDestX - rTR.mnSrcX, rTR.mnDestY - rTR.mnSrcY); - if (xDamageTracker) extents = getFillDamage(cr); cairo_clip(cr); - cairo_mask_surface(cr, mask, rTR.mnDestX - rTR.mnSrcX, rTR.mnDestY - rTR.mnSrcY); + + cairo_translate(cr, rTR.mnDestX, rTR.mnDestY); + cairo_scale(cr, (double)(rTR.mnDestWidth)/rTR.mnSrcWidth, ((double)rTR.mnDestHeight)/rTR.mnSrcHeight); + cairo_set_source_surface(cr, source, -rTR.mnSrcX, -rTR.mnSrcY); + cairo_mask_surface(cr, mask, -rTR.mnSrcX, -rTR.mnSrcY); cairo_surface_flush(cairo_get_target(cr)); cairo_surface_destroy(mask); |