diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-04-11 16:14:06 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-04-11 16:15:40 +0100 |
commit | 2ca4b505b25e13c9f422c28252f5b7533b8e3270 (patch) | |
tree | 394427bca62aec1bf19e574df4bb18074cf4e0a3 /vcl/headless/svpgdi.cxx | |
parent | 7db137e87177dbe381186491ca36e3e8fd62ddc2 (diff) |
cairo_surface_create_similar_image is >= cairo 1.12.0
Change-Id: I1805e5680beff6c632016686aa661efe25a8c2f8
Diffstat (limited to 'vcl/headless/svpgdi.cxx')
-rw-r--r-- | vcl/headless/svpgdi.cxx | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index cad5f5ea21a5..7543bc69c760 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -1320,7 +1320,13 @@ SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeigh Color SvpSalGraphics::getPixel( long nX, long nY ) { - cairo_surface_t *target = cairo_surface_create_similar_image(m_pSurface, CAIRO_FORMAT_ARGB32, 1, 1); +#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0) + cairo_surface_t *target = cairo_surface_create_similar_image(m_pSurface, +#else + cairo_surface_t *target = cairo_image_surface_create( +#endif + CAIRO_FORMAT_ARGB32, 1, 1); + cairo_t* cr = cairo_create(target); cairo_rectangle(cr, 0, 0, 1, 1); @@ -1484,9 +1490,15 @@ cairo_surface_t* SvpSalGraphics::createCairoSurface(const BitmapBuffer *pBuffer) cairo_t* SvpSalGraphics::createTmpCompatibleCairoContext() const { - cairo_surface_t *target = cairo_surface_create_similar_image(m_pSurface, CAIRO_FORMAT_ARGB32, - m_aFrameSize.getX() * m_fScale, - m_aFrameSize.getY() * m_fScale); +#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0) + cairo_surface_t *target = cairo_surface_create_similar_image(m_pSurface, +#else + cairo_surface_t *target = cairo_image_surface_create( +#endif + CAIRO_FORMAT_ARGB32, + m_aFrameSize.getX() * m_fScale, + m_aFrameSize.getY() * m_fScale); + #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0) cairo_surface_set_device_scale(target, m_fScale, m_fScale); #endif |