cairo_surface_create_similar_image is >= cairo 1.12.0

Change-Id: I1805e5680beff6c632016686aa661efe25a8c2f8
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index cad5f5e..7543bc69 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
diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx
index 77583f2..6d3b0af 100644
--- a/vcl/source/bitmap/BitmapTools.cxx
+++ b/vcl/source/bitmap/BitmapTools.cxx
@@ -235,8 +235,13 @@ BitmapEx* CreateFromCairoSurface(Size aSize, cairo_surface_t * pSurface)
{
    // FIXME: if we could teach VCL/ about cairo handles, life could
    // be significantly better here perhaps.
    cairo_surface_t *pPixels = cairo_surface_create_similar_image(pSurface, CAIRO_FORMAT_ARGB32,
                                              aSize.Width(), aSize.Height());

#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0)
    cairo_surface_t *pPixels = cairo_surface_create_similar_image(pSurface,
#else
    cairo_surface_t *pPixels = cairo_image_surface_create(
#endif
            CAIRO_FORMAT_ARGB32, aSize.Width(), aSize.Height());
    cairo_t *pCairo = cairo_create( pPixels );
    if( !pPixels || !pCairo || cairo_status(pCairo) != CAIRO_STATUS_SUCCESS )
        return nullptr;