[cairo-commit] 6 commits - BUGS build/aclocal.pkg.m4 build/configure.ac.tools build/Makefile.am.releasing configure.ac doc/tutorial HACKING INSTALL NEWS perf/README README RELEASING src/cairo.c src/cairo-clip-tor-scan-converter.c src/cairo-gl-composite.c src/cairo.h src/cairo-image-info.c src/cairo-image-info-private.h src/cairo-output-stream.c src/cairo-pattern.c src/cairo-pdf-interchange.c src/cairo-pdf-surface.c src/cairo-ps-surface.c src/cairo-skia.h src/cairo-skia-surface.cpp src/cairo-tor22-scan-converter.c src/cairo-tor-scan-converter.c src/cairo-xlib-private.h src/Makefile.sources src/skia src/win32 test/api-special-cases.c test/big-trap.c test/clip-push-group.c test/culled-glyphs.c test/dash-infinite-loop.c test/degenerate-arc.c test/degenerate-pen.c test/filter-bilinear-extents.c test/get-path-extents.c test/leaky-dashed-rectangle.c test/mime-surface-api.c test/path-stroke-twice.c test/scale-offset-image.c test/scale-offset-similar.c test/surface-pattern-scale-down-extend.c util/ cairo.modules util/cairo-trace

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 18 00:47:41 UTC 2018


 BUGS                                     |    8 
 HACKING                                  |   12 
 INSTALL                                  |    4 
 NEWS                                     |  156 +-
 README                                   |   30 
 RELEASING                                |    8 
 build/Makefile.am.releasing              |    2 
 build/aclocal.pkg.m4                     |    2 
 build/configure.ac.tools                 |    2 
 configure.ac                             |   42 
 doc/tutorial/slides/cairo-blank.svg      |    2 
 doc/tutorial/slides/cairo-code.svg       |    2 
 doc/tutorial/slides/cairo-separator.svg  |    2 
 doc/tutorial/slides/cairo.svg            |    2 
 doc/tutorial/slides/tutorial.xml         |   12 
 doc/tutorial/src/README                  |    2 
 perf/README                              |    2 
 src/Makefile.sources                     |    7 
 src/cairo-clip-tor-scan-converter.c      |    2 
 src/cairo-gl-composite.c                 |    2 
 src/cairo-image-info-private.h           |    1 
 src/cairo-image-info.c                   |   21 
 src/cairo-output-stream.c                |    2 
 src/cairo-pattern.c                      |    2 
 src/cairo-pdf-interchange.c              |    2 
 src/cairo-pdf-surface.c                  |    2 
 src/cairo-ps-surface.c                   |    2 
 src/cairo-skia-surface.cpp               | 1202 --------------------
 src/cairo-skia.h                         |   66 -
 src/cairo-tor-scan-converter.c           |    2 
 src/cairo-tor22-scan-converter.c         |    2 
 src/cairo-xlib-private.h                 |    2 
 src/cairo.c                              |    6 
 src/cairo.h                              |    3 
 src/skia/cairo-skia-context.cpp          | 1781 -------------------------------
 src/skia/cairo-skia-private.h            |  127 --
 src/skia/cairo-skia-surface.cpp          |  323 -----
 src/win32/cairo-win32-font.c             |    2 
 test/api-special-cases.c                 |    2 
 test/big-trap.c                          |    2 
 test/clip-push-group.c                   |    2 
 test/culled-glyphs.c                     |    2 
 test/dash-infinite-loop.c                |    2 
 test/degenerate-arc.c                    |    2 
 test/degenerate-pen.c                    |    2 
 test/filter-bilinear-extents.c           |    2 
 test/get-path-extents.c                  |    6 
 test/leaky-dashed-rectangle.c            |    4 
 test/mime-surface-api.c                  |    4 
 test/path-stroke-twice.c                 |    2 
 test/scale-offset-image.c                |    2 
 test/scale-offset-similar.c              |    2 
 test/surface-pattern-scale-down-extend.c |    2 
 util/cairo-trace/trace.c                 |    2 
 util/cairo.modules                       |    2 
 55 files changed, 164 insertions(+), 3727 deletions(-)

New commits:
commit 3a03c1ba4bc30492721abdb6c9ec8868663ef237
Author: Bryce Harrington <bryce at bryceharrington.org>
Date:   Wed Oct 17 17:32:10 2018 -0700

    win32: Fix regression with text containing space character
    
    Converting a series of glyphs to a path triggers an out of memory error
    if there is a space glyph (bytesGlyph==0).  The regression was
    introduced by commit 19982393 in cairo-win32-font.c:107.
    
    The behavior of malloc(0) is not well defined - it can return NULL on
    some platforms, or an arbitrary (non-allocated) pointer on other
    platforms.  Commit 19982393 introduced sanity by enforcing that NULL is
    always returned in this situation, which inappropriately triggers the
    OOM check in _cairo_win32_scaled_font_init_glyph_path().  Instead,
    special case the handling for bytesGlyph==0.
    
    Patch authored by Uli Schlachter, based on fix proposed by lb90.
    
    Fixes:  https://gitlab.freedesktop.org/cairo/cairo/issues/339
    Reference:  https://gitlab.gnome.org/GNOME/pango/issues/323
    Reviewed-by: Bryce Harrington <bryce at bryceharrington.org>

diff --git a/src/win32/cairo-win32-font.c b/src/win32/cairo-win32-font.c
index a031c1363..1f217573b 100644
--- a/src/win32/cairo-win32-font.c
+++ b/src/win32/cairo-win32-font.c
@@ -1697,7 +1697,7 @@ _cairo_win32_scaled_font_init_glyph_path (cairo_win32_scaled_font_t *scaled_font
     }
 
     ptr = buffer = _cairo_malloc (bytesGlyph);
-    if (!buffer) {
+    if (!buffer && bytesGlyph != 0) {
 	status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
 	goto CLEANUP_FONT;
     }
commit 7786b8fe4e7a2c73767be3ce7ae64389d09984d9
Author: Bryce Harrington <bryce at bryceharrington.org>
Date:   Tue Oct 16 10:31:48 2018 -0700

    Drop skia backend
    
    Commit 38806bc3 already disabled the backend from use, now drop the
    code.

diff --git a/README b/README
index 9cfa34355..0bcf14012 100644
--- a/README
+++ b/README
@@ -181,12 +181,6 @@ Experimental surface backends
 	packages and developer dependencies are available at Netlabs:
 				ftp://ftp.netlabs.org/pub/cairo
 
-	skia backend
-	------------
-	Requires the skia library as of June 2014.  Since skia is not
-	API stable, building against newer (or older) versions of skia
-	will probably fail.
-
 
 Compiling
 =========
diff --git a/configure.ac b/configure.ac
index f1487271a..5e33c96ea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -249,31 +249,6 @@ AM_CONDITIONAL(CAIRO_CAN_TEST_WIN32_PRINTING_SURFACE, test "x$test_win32_printin
 
 dnl ===========================================================================
 
-dnl NOTE: We're temporarily disabiling this backend to see if anyone
-dnl       is actually using it.  If you are, please mention on the cairo
-dnl       mailing list.
-
-dnl CAIRO_ENABLE_SURFACE_BACKEND(skia, Skia, no, [
-dnl   AC_ARG_WITH([skia],
-dnl 	      [AS_HELP_STRING([--with-skia=/path/to/skia],
-dnl 			      [directory to find compiled skia sources])],
-dnl 	      [skia_DIR="$withval"],
-dnl 	      [skia_DIR="`pwd`/../skia"])
-dnl   AC_ARG_WITH([skia-build-type],
-dnl 	      [AS_HELP_STRING([--with-skia-build-type=(Release|Debug)]
-dnl 			      [build of skia to link with, default is Release])],
-dnl 	      [skia_BUILD_TYPE="$withval"],
-dnl 	      [skia_BUILD_TYPE="Release"])
-dnl   skia_NONPKGCONFIG_CFLAGS="-I$skia_DIR/include/config -I$skia_DIR/include/core -I$skia_DIR/include/effects"
-dnl   if test "x$skia_BUILD_TYPE" = "xRelease"; then
-dnl   	skia_NONPKGCONFIG_CFLAGS="-DSK_RELEASE -DSK_CAN_USE_FLOAT $skia_NONPKGCONFIG_CFLAGS"
-dnl   fi
-dnl   skia_NONPKGCONFIG_LIBS="-L$skia_DIR/out/$skia_BUILD_TYPE/lib.target/ -lskia -lstdc++"
-dnl   AC_SUBST(skia_DIR)
-dnl ])
-
-dnl ===========================================================================
-
 CAIRO_ENABLE_SURFACE_BACKEND(os2, OS/2, no, [
   case "$host" in
     *-*-os2*)
@@ -887,7 +862,6 @@ dnl ===========================================================================
 
 dnl Extra stuff we need to do when building C++ code
 need_cxx="no"
-dnl AS_IF([test "x$use_skia" = "xyes"], [need_cxx="yes"])
 AS_IF([test "x$use_qt" = "xyes"], [need_cxx="yes"])
 AS_IF([test "x$use_beos" = "xyes"], [need_cxx="yes"])
 
diff --git a/src/Makefile.sources b/src/Makefile.sources
index e50a4d48f..096a3bcfa 100644
--- a/src/Makefile.sources
+++ b/src/Makefile.sources
@@ -375,13 +375,6 @@ cairo_win32_font_sources = \
 	win32/cairo-win32-font.c \
 	$(NULL)
 
-cairo_skia_headers = cairo-skia.h
-cairo_skia_private = skia/cairo-skia-private.h
-cairo_skia_cxx_sources = \
-	skia/cairo-skia-context.cpp \
-	skia/cairo-skia-surface.cpp \
-	$(NULL)
-
 cairo_os2_headers = cairo-os2.h
 cairo_os2_private = cairo-os2-private.h
 cairo_os2_sources = cairo-os2-surface.c
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index 745b95011..fde044a4d 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -4694,7 +4694,7 @@ _cairo_debug_print_surface_pattern (FILE *file,
     case CAIRO_SURFACE_TYPE_DRM: s = "drm"; break;
     case CAIRO_SURFACE_TYPE_TEE: s = "tee"; break;
     case CAIRO_SURFACE_TYPE_XML: s = "xml"; break;
-    case CAIRO_SURFACE_TYPE_SKIA: s = "skia"; break;
+    case CAIRO_SURFACE_TYPE_SKIA: s = "skia"; break; /* Deprecated */
     case CAIRO_SURFACE_TYPE_SUBSURFACE: s = "subsurface"; break;
     case CAIRO_SURFACE_TYPE_COGL: s = "cogl"; break;
     default: s = "invalid"; ASSERT_NOT_REACHED; break;
diff --git a/src/cairo-skia-surface.cpp b/src/cairo-skia-surface.cpp
deleted file mode 100644
index aeb69cfcd..000000000
--- a/src/cairo-skia-surface.cpp
+++ /dev/null
@@ -1,1202 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
-/* cairo - a vector graphics library with display and print output
- *
- * Copyright © 2007 Mozilla Corporation
- *
- * This library is free software; you can redistribute it and/or
- * modify it either under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation
- * (the "LGPL") or, at your option, under the terms of the Mozilla
- * Public License Version 1.1 (the "MPL"). If you do not alter this
- * notice, a recipient may use your version of this file under either
- * the MPL or the LGPL.
- *
- * You should have received a copy of the LGPL along with this library
- * in the file COPYING-LGPL-2.1; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
- * You should have received a copy of the MPL along with this library
- * in the file COPYING-MPL-1.1
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.1 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
- * OF ANY KIND, either express or implied. See the LGPL or the MPL for
- * the specific language governing rights and limitations.
- *
- * The Original Code is the cairo graphics library.
- *
- * The Initial Developer of the Original Code is Mozilla Corporation.
- *
- * Contributor(s):
- *	Vladimir Vukicevic <vladimir at mozilla.com>
- */
-
-#include "cairoint.h"
-
-#include "cairo-skia.h"
-
-#include "cairo-surface-clipper-private.h"
-#include "cairo-image-surface-inline.h"
-
-#include <SkBitmap.h>
-#include <SkCanvas.h>
-#include <SkPaint.h>
-#include <SkPath.h>
-
-#include <SkColorShader.h>
-
-#include <SkGradientShader.h>
-#include <SkDashPathEffect.h>
-
-/**
- * SECTION:cairo-skia
- * @Title: Skia Surfaces
- * @Short_Description: Rendering to Skia surfaces
- * @See_Also: #cairo_surface_t
- *
- * Originally written by Vladimir Vukicevic to investigate using Skia for
- * Mozilla, it provides a nice integration with a rather interesting code
- * base. By hooking Skia underneath Cairo it allows us to directly compare
- * code paths... which is interesting.
- **/
-
-/**
- * CAIRO_HAS_SKIA_SURFACE:
- *
- * Defined if the Skia surface backend is available.
- * This macro can be used to conditionally compile backend-specific code.
- *
- * Since: 1.10
- **/
-
-#if (CAIRO_FIXED_BITS == 32) && (CAIRO_FIXED_FRAC_BITS == 16) && defined(SK_SCALAR_IS_FIXED)
-# define CAIRO_FIXED_TO_SK_SCALAR(x)  (x)
-#elif defined(SK_SCALAR_IS_FIXED)
-/* This can be done better, but this will do for now */
-# define CAIRO_FIXED_TO_SK_SCALAR(x)  SkFloatToScalar(_cairo_fixed_to_double(x))
-#else
-# define CAIRO_FIXED_TO_SK_SCALAR(x)  SkFloatToScalar(_cairo_fixed_to_double(x))
-#endif
-
-#ifndef CAIRO_INT_STATUS_SUCCESS
-# define CAIRO_INT_STATUS_SUCCESS ((cairo_int_status_t) CAIRO_STATUS_SUCCESS)
-#endif
-
-#define DEBUG_SKIA 0
-
-#if DEBUG_SKIA
-#define UNSUPPORTED(reason) ({ \
-    fprintf (stderr, \
-	     "cairo-skia : hit unsupported operation in %s(), line %d: %s\n", \
-	     __FUNCTION__, __LINE__, reason); \
-    return CAIRO_INT_STATUS_UNSUPPORTED; \
-})
-#else
-#define UNSUPPORTED(reason) ({ \
-    return CAIRO_INT_STATUS_UNSUPPORTED; \
-})#endif
-
-
-typedef struct cairo_skia_surface {
-    cairo_surface_t base;
-
-    SkBitmap *bitmap;
-    SkCanvas *canvas;
-
-    cairo_surface_clipper_t clipper;
-
-    cairo_image_surface_t *_image_surface; /* wrapper around bitmap */
-} cairo_skia_surface_t;
-
-static cairo_skia_surface_t *
-_cairo_skia_surface_create_internal (SkBitmap::Config config,
-				     bool opaque,
-				     unsigned char *data,
-				     int width,
-				     int height,
-				     int stride);
-
-/*
- * conversion methods
- */
-
-/*
- * format conversion
- */
-static inline bool
-format_to_sk_config (cairo_format_t format,
-		     SkBitmap::Config& config,
-		     bool& opaque)
-{
-    opaque = false;
-
-    switch (format) {
-    case CAIRO_FORMAT_ARGB32:
-	config = SkBitmap::kARGB_8888_Config;
-	break;
-    case CAIRO_FORMAT_RGB24:
-	config = SkBitmap::kARGB_8888_Config;
-	opaque = true;
-	break;
-    case CAIRO_FORMAT_A8:
-	config = SkBitmap::kA8_Config;
-	break;
-    case CAIRO_FORMAT_A1:
-	config = SkBitmap::kA1_Config;
-	break;
-    default:
-	return false;
-    }
-
-    return true;
-}
-
-static inline cairo_format_t
-sk_config_to_format (SkBitmap::Config config,
-		     bool opaque)
-{
-    switch (config) {
-    case SkBitmap::kARGB_8888_Config:
-	if (opaque)
-	    return CAIRO_FORMAT_RGB24;
-	return CAIRO_FORMAT_ARGB32;
-
-    case SkBitmap::kA8_Config:
-	return CAIRO_FORMAT_A8;
-
-    case SkBitmap::kA1_Config:
-	return CAIRO_FORMAT_A1;
-
-    case SkBitmap::kNo_Config:
-    case SkBitmap::kIndex8_Config:
-    case SkBitmap::kRLE_Index8_Config:
-    case SkBitmap::kRGB_565_Config:
-    case SkBitmap::kARGB_4444_Config:
-    case SkBitmap::kConfigCount:
-    default:
-	return (cairo_format_t) -1;
-    }
-}
-
-/*
- * image surface wrapping
- */
-static inline bool
-surface_to_sk_bitmap (cairo_surface_t *surface, SkBitmap& bitmap)
-{
-    cairo_image_surface_t *img = (cairo_image_surface_t *) surface;
-    SkBitmap::Config config;
-    bool opaque;
-
-    if (unlikely (! format_to_sk_config (img->format, config, opaque)))
-	return false;
-
-    bitmap.reset ();
-    bitmap.setConfig (config, img->width, img->height, img->stride);
-    bitmap.setIsOpaque (opaque);
-    bitmap.setPixels (img->data);
-
-    return true;
-}
-
-/*
- * operator conversion
- */
-
-static inline SkXfermode::Mode
-operator_to_sk (cairo_operator_t op)
-{
-    static const SkXfermode::Mode modeMap[] = {
-	SkXfermode::kClear_Mode,
-
-	SkXfermode::kSrc_Mode,
-	SkXfermode::kSrcOver_Mode,
-	SkXfermode::kSrcIn_Mode,
-	SkXfermode::kSrcOut_Mode,
-	SkXfermode::kSrcATop_Mode,
-
-	SkXfermode::kDst_Mode,
-	SkXfermode::kDstOver_Mode,
-	SkXfermode::kDstIn_Mode,
-	SkXfermode::kDstOut_Mode,
-	SkXfermode::kDstATop_Mode,
-
-	SkXfermode::kXor_Mode,
-	SkXfermode::kPlus_Mode, // XXX Add?
-	SkXfermode::kPlus_Mode, // XXX SATURATE
-
-	SkXfermode::kPlus_Mode,
-	SkXfermode::kMultiply_Mode,
-	SkXfermode::kScreen_Mode,
-	SkXfermode::kOverlay_Mode,
-	SkXfermode::kDarken_Mode,
-	SkXfermode::kLighten_Mode,
-	SkXfermode::kColorDodge_Mode,
-	SkXfermode::kColorBurn_Mode,
-	SkXfermode::kHardLight_Mode,
-	SkXfermode::kSoftLight_Mode,
-	SkXfermode::kDifference_Mode,
-	SkXfermode::kExclusion_Mode,
-
-	SkXfermode::kSrcOver_Mode, // XXX: CAIRO_OPERATOR_HSL_HUE
-	SkXfermode::kSrcOver_Mode, // XXX: CAIRO_OPERATOR_HSL_SATURATION,
-	SkXfermode::kSrcOver_Mode, // XXX: CAIRO_OPERATOR_HSL_COLOR,
-	SkXfermode::kSrcOver_Mode, // XXX: CAIRO_OPERATOR_HSL_LUMINOSITY
-    };
-
-    return modeMap[op];
-}
-
-/*
- * tiling mode conversion
- */
-static SkShader::TileMode
-extend_to_sk (cairo_extend_t extend)
-{
-    static const SkShader::TileMode modeMap[] = {
-	SkShader::kClamp_TileMode,  // NONE behaves like PAD, because noone wants NONE
-	SkShader::kRepeat_TileMode,
-	SkShader::kMirror_TileMode,
-	SkShader::kClamp_TileMode
-    };
-
-    return modeMap[extend];
-}
-
-/*
- * color conversion
- */
-static inline SkColor
-color_to_sk (const cairo_color_t& c)
-{
-    /* Need unpremultiplied 1-byte values */
-    return SkColorSetARGB ((U8CPU) (c.alpha * 255),
-			   (U8CPU) (c.red * 255),
-			   (U8CPU) (c.green * 255),
-			   (U8CPU) (c.blue * 255));
-}
-
-/*
- * matrix conversion
- */
-static inline SkMatrix
-matrix_to_sk (const cairo_matrix_t& mat)
-{
-    SkMatrix skm;
-
-    skm.reset ();
-    skm.set (SkMatrix::kMScaleX, SkFloatToScalar (mat.xx));
-    skm.set (SkMatrix::kMSkewX,  SkFloatToScalar (mat.xy));
-    skm.set (SkMatrix::kMTransX, SkFloatToScalar (mat.x0));
-    skm.set (SkMatrix::kMSkewY,  SkFloatToScalar (mat.yx));
-    skm.set (SkMatrix::kMScaleY, SkFloatToScalar (mat.yy));
-    skm.set (SkMatrix::kMTransY, SkFloatToScalar (mat.y0));
-
-    /*
-    skm[6] = SkFloatToScalar (0.0);
-    skm[7] = SkFloatToScalar (0.0);
-    skm[8] = SkFloatToScalar (1.0); -- this isn't right, it wants a magic value in there that it'll set itself.  It wants Sk_Fract1 (2.30), not Sk_Scalar1
-    */
-
-    return skm;
-}
-
-static inline SkMatrix
-matrix_inverse_to_sk (const cairo_matrix_t& mat)
-{
-    cairo_matrix_t inv = mat;
-    cairo_status_t status = cairo_matrix_invert (&inv);
-    assert (status == CAIRO_STATUS_SUCCESS);
-    return matrix_to_sk (inv);
-}
-
-/*
- * pattern conversion
- */
-static inline cairo_surface_t *
-surface_from_pattern (const cairo_pattern_t *pattern)
-{
-    return (reinterpret_cast <const cairo_surface_pattern_t *> (pattern))->surface;
-}
-
-static SkShader*
-pattern_to_sk_shader (cairo_skia_surface_t *dst, const cairo_pattern_t *pattern,
-		      cairo_image_surface_t **image, void **image_extra)
-{
-    SkShader *shader = NULL;
-
-    if (pattern->type == CAIRO_PATTERN_TYPE_SOLID) {
-	cairo_solid_pattern_t *solid = (cairo_solid_pattern_t *) pattern;
-	return new SkColorShader (color_to_sk (solid->color));
-    } else if (pattern->type == CAIRO_PATTERN_TYPE_SURFACE) {
-	cairo_surface_t *surface = surface_from_pattern (pattern);
-
-	if (surface->type == CAIRO_SURFACE_TYPE_SKIA) {
-	    cairo_skia_surface_t *esurf = (cairo_skia_surface_t *) surface;
-
-	    shader = SkShader::CreateBitmapShader (*esurf->bitmap,
-						   extend_to_sk (pattern->extend),
-						   extend_to_sk (pattern->extend));
-	} else {
-	    SkBitmap bitmap;
-
-	    if (! _cairo_surface_is_image (surface)) {
-		cairo_status_t status;
-
-		status = _cairo_surface_acquire_source_image (surface,
-							      image, image_extra);
-		if (status)
-		    return NULL;
-
-		surface = &(*image)->base;
-	    }
-
-
-	    if (unlikely (! surface_to_sk_bitmap (surface, bitmap)))
-		return NULL;
-
-	    shader = SkShader::CreateBitmapShader (bitmap,
-						   extend_to_sk (pattern->extend),
-						   extend_to_sk (pattern->extend));
-	}
-    } else if (pattern->type == CAIRO_PATTERN_TYPE_LINEAR
-	       /* || pattern->type == CAIRO_PATTERN_TYPE_RADIAL */)
-    {
-	cairo_gradient_pattern_t *gradient = (cairo_gradient_pattern_t *) pattern;
-	SkColor colors_stack[10];
-	SkScalar pos_stack[10];
-	SkColor *colors = colors_stack;
-	SkScalar *pos = pos_stack;
-
-	if (gradient->n_stops > 10) {
-	    colors = new SkColor[gradient->n_stops];
-	    pos = new SkScalar[gradient->n_stops];
-	}
-
-	for (unsigned int i = 0; i < gradient->n_stops; i++) {
-	    pos[i] = CAIRO_FIXED_TO_SK_SCALAR (gradient->stops[i].offset);
-	    colors[i] = color_to_sk (gradient->stops[i].color);
-	}
-
-	if (pattern->type == CAIRO_PATTERN_TYPE_LINEAR) {
-	    cairo_linear_pattern_t *linear = (cairo_linear_pattern_t *) gradient;
-	    SkPoint points[2];
-
-	    points[0].set (SkFloatToScalar (linear->pd1.x),
-			   SkFloatToScalar (linear->pd1.y));
-	    points[1].set (SkFloatToScalar (linear->pd2.x),
-			   SkFloatToScalar (linear->pd2.y));
-	    shader = SkGradientShader::CreateLinear (points, colors, pos, gradient->n_stops,
-						     extend_to_sk (pattern->extend));
-	} else {
-	    // XXX todo -- implement real radial shaders in Skia
-	}
-
-	if (gradient->n_stops > 10) {
-	    delete [] colors;
-	    delete [] pos;
-	}
-    }
-
-    if (shader && ! _cairo_matrix_is_identity (&pattern->matrix))
-	shader->setLocalMatrix (matrix_inverse_to_sk (pattern->matrix));
-
-    return shader;
-}
-
-static inline bool
-pattern_filter_to_sk (const cairo_pattern_t *pattern)
-{
-    switch (pattern->filter) {
-    case CAIRO_FILTER_GOOD:
-    case CAIRO_FILTER_BEST:
-    case CAIRO_FILTER_BILINEAR:
-    case CAIRO_FILTER_GAUSSIAN:
-	return true;
-    default:
-    case CAIRO_FILTER_FAST:
-    case CAIRO_FILTER_NEAREST:
-	return false;
-    }
-}
-
-static inline bool
-pattern_to_sk_color (const cairo_pattern_t *pattern, SkColor& color)
-{
-    if (pattern->type != CAIRO_PATTERN_TYPE_SOLID)
-	return false;
-
-    color = color_to_sk (((cairo_solid_pattern_t *) pattern)->color);
-    return true;
-}
-
-/*
- * path conversion
- */
-
-struct cpc {
-    SkPath skPath;
-    cairo_matrix_t *matrix;
-};
-
-static cairo_status_t
-cpc_move_to (void *closure, const cairo_point_t *point)
-{
-    struct cpc *cpc = static_cast <struct cpc *> (closure);
-    if (cpc->matrix) {
-	double x = _cairo_fixed_to_double (point->x);
-	double y = _cairo_fixed_to_double (point->y);
-	cairo_matrix_transform_point (cpc->matrix, &x, &y);
-	cpc->skPath.moveTo (SkFloatToScalar (x), SkFloatToScalar (y));
-    } else {
-	cpc->skPath.moveTo (CAIRO_FIXED_TO_SK_SCALAR (point->x),
-			    CAIRO_FIXED_TO_SK_SCALAR (point->y));
-    }
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-cpc_line_to (void *closure, const cairo_point_t *point)
-{
-    struct cpc *cpc = static_cast <struct cpc *> (closure);
-    if (cpc->matrix) {
-	double x = _cairo_fixed_to_double (point->x);
-	double y = _cairo_fixed_to_double (point->y);
-	cairo_matrix_transform_point (cpc->matrix, &x, &y);
-	cpc->skPath.lineTo (SkFloatToScalar (x), SkFloatToScalar (y));
-    } else {
-	cpc->skPath.lineTo (CAIRO_FIXED_TO_SK_SCALAR (point->x),
-			    CAIRO_FIXED_TO_SK_SCALAR (point->y));
-    }
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-cpc_curve_to (void *closure,
-	      const cairo_point_t *p0,
-	      const cairo_point_t *p1,
-	      const cairo_point_t *p2)
-{
-    struct cpc *cpc = static_cast <struct cpc *> (closure);
-    if (cpc->matrix) {
-	double x0 = _cairo_fixed_to_double (p0->x);
-	double y0 = _cairo_fixed_to_double (p0->y);
-	double x1 = _cairo_fixed_to_double (p1->x);
-	double y1 = _cairo_fixed_to_double (p1->y);
-	double x2 = _cairo_fixed_to_double (p2->x);
-	double y2 = _cairo_fixed_to_double (p2->y);
-	cairo_matrix_transform_point (cpc->matrix, &x0, &y0);
-	cairo_matrix_transform_point (cpc->matrix, &x1, &y1);
-	cairo_matrix_transform_point (cpc->matrix, &x2, &y2);
-
-	cpc->skPath.cubicTo (SkFloatToScalar (x0),
-			     SkFloatToScalar (y0),
-			     SkFloatToScalar (x1),
-			     SkFloatToScalar (y1),
-			     SkFloatToScalar (x2),
-			     SkFloatToScalar (y2));
-    } else {
-	cpc->skPath.cubicTo (CAIRO_FIXED_TO_SK_SCALAR (p0->x),
-			     CAIRO_FIXED_TO_SK_SCALAR (p0->y),
-			     CAIRO_FIXED_TO_SK_SCALAR (p1->x),
-			     CAIRO_FIXED_TO_SK_SCALAR (p1->y),
-			     CAIRO_FIXED_TO_SK_SCALAR (p2->x),
-			     CAIRO_FIXED_TO_SK_SCALAR (p2->y));
-    }
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-cpc_close_path (void *closure)
-{
-    struct cpc *cpc = static_cast <struct cpc *> (closure);
-    cpc->skPath.close ();
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static inline SkPath
-path_to_sk (cairo_path_fixed_t *path,
-	    cairo_matrix_t *mat = NULL)
-{
-    struct cpc data;
-    cairo_status_t status;
-
-    if (mat && _cairo_matrix_is_identity (mat))
-	mat = NULL;
-    data.matrix = mat;
-
-    status = _cairo_path_fixed_interpret (path,
-					  cpc_move_to,
-					  cpc_line_to,
-					  cpc_curve_to,
-					  cpc_close_path,
-					  &data);
-    assert (status == CAIRO_STATUS_SUCCESS);
-
-    return data.skPath;
-}
-
-static inline SkPath
-path_to_sk (cairo_path_fixed_t *path,
-	    cairo_fill_rule_t fill_rule,
-	    cairo_matrix_t *mat = NULL)
-{
-    SkPath skPath = path_to_sk (path, mat);
-
-    if (fill_rule == CAIRO_FILL_RULE_EVEN_ODD)
-	skPath.setFillType (SkPath::kEvenOdd_FillType);
-    else
-	skPath.setFillType (SkPath::kWinding_FillType);
-
-    return skPath;
-}
-
-/*
- * cairo surface methods
- */
-
-static cairo_surface_t *
-_cairo_skia_surface_create_similar (void *asurface,
-				    cairo_content_t content,
-				    int width,
-				    int height)
-{
-    SkBitmap::Config config;
-    bool opaque;
-
-    if (! format_to_sk_config (_cairo_format_from_content (content),
-			       config, opaque))
-    {
-	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT));
-    }
-
-    return &_cairo_skia_surface_create_internal (config, opaque,
-						 NULL,
-						 width, height,
-						 0)->base;
-}
-
-static cairo_status_t
-_cairo_skia_surface_finish (void *asurface)
-{
-    cairo_skia_surface_t *surface = (cairo_skia_surface_t *) asurface;
-
-    _cairo_surface_clipper_reset (&surface->clipper);
-    cairo_surface_destroy (&surface->_image_surface->base);
-
-    delete surface->canvas;
-    delete surface->bitmap;
-
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_image_surface_t *
-_get_image_surface (cairo_skia_surface_t *surface)
-{
-    if (! surface->_image_surface) {
-	SkBitmap *bitmap = surface->bitmap;
-	surface->_image_surface = (cairo_image_surface_t *)
-	    cairo_image_surface_create_for_data ((unsigned char *) bitmap->getPixels (),
-						 sk_config_to_format (bitmap->config (),
-								      bitmap->isOpaque ()),
-						 bitmap->width (),
-						 bitmap->height (),
-						 bitmap->rowBytes ());
-    }
-
-    return surface->_image_surface;
-}
-
-static cairo_status_t
-_cairo_skia_surface_acquire_source_image (void *asurface,
-					  cairo_image_surface_t **image_out,
-					  void **image_extra)
-{
-    cairo_skia_surface_t *surface = (cairo_skia_surface_t *) asurface;
-    cairo_image_surface_t *image = _get_image_surface (surface);
-
-    if (unlikely (image->base.status))
-	return image->base.status;
-
-    surface->bitmap->lockPixels ();
-
-    *image_out = image;
-    *image_extra = NULL;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static void
-_cairo_skia_surface_release_source_image (void *asurface,
-					  cairo_image_surface_t *image,
-					  void *image_extra)
-{
-    cairo_skia_surface_t *surface = (cairo_skia_surface_t *) asurface;
-
-    surface->bitmap->unlockPixels ();
-}
-
-static cairo_status_t
-_cairo_skia_surface_acquire_dest_image (void *asurface,
-					cairo_rectangle_int_t *interest_rect,
-					cairo_image_surface_t **image_out,
-					cairo_rectangle_int_t *image_rect,
-					void **image_extra)
-{
-    cairo_skia_surface_t *surface = (cairo_skia_surface_t *) asurface;
-    cairo_image_surface_t *image = _get_image_surface (surface);
-
-    if (unlikely (image->base.status))
-	return image->base.status;
-
-    image_rect->x = 0;
-    image_rect->y = 0;
-    image_rect->width  = image->width;
-    image_rect->height = image->height;
-
-    surface->bitmap->lockPixels ();
-
-    *image_out = image;
-    *image_extra = NULL;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static void
-_cairo_skia_surface_release_dest_image (void *asurface,
-					cairo_rectangle_int_t *interest_rect,
-					cairo_image_surface_t *image,
-					cairo_rectangle_int_t *image_rect,
-					void *image_extra)
-{
-    cairo_skia_surface_t *surface = (cairo_skia_surface_t *) asurface;
-
-    surface->bitmap->notifyPixelsChanged ();
-    surface->bitmap->unlockPixels ();
-}
-
-#if 0
-static cairo_status_t
-_cairo_skia_surface_clone_similar (void *asurface,
-				   cairo_surface_t *src,
-				   cairo_content_t content,
-				   int src_x,
-				   int src_y,
-				   int width,
-				   int height,
-				   int *clone_offset_x,
-				   int *clone_offset_y,
-				   cairo_surface_t **clone_out)
-{
-    if (src->type == CAIRO_SURFACE_TYPE_SKIA || _cairo_surface_is_image (src)) {
-	*clone_offset_x = 0;
-	*clone_offset_y = 0;
-	*clone_out = cairo_surface_reference (src);
-	return CAIRO_STATUS_SUCCESS;
-    }
-
-    return (cairo_status_t) CAIRO_INT_STATUS_UNSUPPORTED;
-}
-#endif
-
-static cairo_status_t
-_cairo_skia_surface_clipper_intersect_clip_path (cairo_surface_clipper_t *clipper,
-						 cairo_path_fixed_t *path,
-						 cairo_fill_rule_t fill_rule,
-						 double tolerance,
-						 cairo_antialias_t antialias)
-{
-    cairo_skia_surface_t *surface = cairo_container_of (clipper,
-							cairo_skia_surface_t,
-							clipper);
-
-    if (path == NULL) {
-	/* XXX TODO: teach Skia how to reset the clip path */
-	surface->canvas->restore ();
-	surface->canvas->save ();
-    } else {
-	surface->canvas->clipPath (path_to_sk (path, fill_rule));
-    }
-
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_bool_t
-_cairo_skia_surface_get_extents (void *asurface,
-				 cairo_rectangle_int_t *extents)
-{
-    cairo_skia_surface_t *surface = (cairo_skia_surface_t *) asurface;
-
-    extents->x = 0;
-    extents->y = 0;
-    extents->width  = surface->bitmap->width ();
-    extents->height = surface->bitmap->height ();
-
-    return TRUE;
-}
-
-/*
- * Core drawing operations
- */
-
-static SkBitmap *
-pattern_to_sk_bitmap (cairo_skia_surface_t *dst,
-		      const cairo_pattern_t *pattern,
-		      SkMatrix *matrix,
-		      cairo_image_surface_t **image,
-		      void **image_extra)
-{
-    if (pattern->type != CAIRO_PATTERN_TYPE_SURFACE)
-	return NULL;
-
-    if (pattern->extend != CAIRO_EXTEND_NONE)
-	return NULL;
-
-    cairo_surface_t *surface = surface_from_pattern (pattern);
-    SkBitmap *bitmap;
-
-    if (surface->type == CAIRO_SURFACE_TYPE_SKIA) {
-	bitmap = new SkBitmap (*((cairo_skia_surface_t *) surface)->bitmap);
-    } else {
-	if (surface->type != CAIRO_SURFACE_TYPE_IMAGE) {
-	    cairo_status_t status;
-
-	    status = _cairo_surface_acquire_source_image (surface,
-							  image, image_extra);
-	    if (unlikely (status))
-		return NULL;
-
-	    surface = &(*image)->base;
-	}
-
-	bitmap = new SkBitmap;
-	if (unlikely (! surface_to_sk_bitmap (surface, *bitmap)))
-	    return NULL;
-    }
-
-    *matrix = matrix_inverse_to_sk (pattern->matrix);
-    return bitmap;
-}
-
-static cairo_int_status_t
-_cairo_skia_surface_paint (void *asurface,
-			   cairo_operator_t op,
-			   const cairo_pattern_t *source,
-			   cairo_clip_t *clip)
-{
-    cairo_skia_surface_t *surface = (cairo_skia_surface_t *) asurface;
-    cairo_image_surface_t *image = NULL;
-    cairo_status_t status;
-    void *image_extra;
-    SkColor color;
-
-    status = _cairo_surface_clipper_set_clip (&surface->clipper, clip);
-    if (unlikely (status))
-	return (cairo_int_status_t) status;
-
-    if (pattern_to_sk_color (source, color)) {
-	surface->canvas->drawColor (color, operator_to_sk (op));
-	return CAIRO_INT_STATUS_SUCCESS;
-    }
-
-    SkMatrix bitmapMatrix;
-    SkBitmap *bitmap = pattern_to_sk_bitmap (surface, source, &bitmapMatrix,
-					     &image, &image_extra);
-    SkShader *shader = NULL;
-    if (!bitmap)
-	shader = pattern_to_sk_shader (surface, source, &image, &image_extra);
-
-    if (!bitmap && !shader)
-	return UNSUPPORTED("pattern to bitmap and shader conversion");
-
-    SkPaint paint;
-    paint.setFilterBitmap (pattern_filter_to_sk (source));
-    paint.setXfermodeMode (operator_to_sk (op));
-
-    if (shader) {
-	paint.setShader (shader);
-	surface->canvas->drawPaint (paint);
-    } else {
-	surface->canvas->drawBitmapMatrix (*bitmap, bitmapMatrix, &paint);
-    }
-
-    if (bitmap)
-	delete bitmap;
-    if (shader)
-	shader->unref ();
-
-    if (image != NULL) {
-	_cairo_surface_release_source_image (&surface->base,
-					     image, image_extra);
-    }
-
-    return CAIRO_INT_STATUS_SUCCESS;
-}
-
-static cairo_int_status_t
-_cairo_skia_surface_stroke (void *asurface,
-			    cairo_operator_t op,
-			    const cairo_pattern_t *source,
-			    cairo_path_fixed_t *path,
-			    cairo_stroke_style_t *style,
-			    cairo_matrix_t *ctm,
-			    cairo_matrix_t *ctm_inverse,
-			    double tolerance,
-			    cairo_antialias_t antialias,
-			    cairo_clip_t *clip)
-{
-    cairo_skia_surface_t *surface = (cairo_skia_surface_t *) asurface;
-    cairo_image_surface_t *image = NULL;
-    cairo_status_t status;
-    void *image_extra;
-
-    status = _cairo_surface_clipper_set_clip (&surface->clipper, clip);
-    if (unlikely (status))
-	return (cairo_int_status_t) status;
-
-    SkPaint paint;
-    paint.setStyle (SkPaint::kStroke_Style);
-
-    SkColor color;
-    if (pattern_to_sk_color (source, color)) {
-	paint.setColor (color);
-    } else {
-	SkShader *shader = pattern_to_sk_shader (surface,
-						 source, &image, &image_extra);
-	if (shader == NULL)
-	    return UNSUPPORTED("pattern to shader conversion");
-
-	paint.setShader (shader);
-	shader->unref ();
-
-	paint.setFilterBitmap (pattern_filter_to_sk (source));
-    }
-
-    paint.setXfermodeMode (operator_to_sk (op));
-    paint.setAntiAlias (antialias != CAIRO_ANTIALIAS_NONE);
-
-    /* Convert the various stroke rendering bits */
-    paint.setStrokeWidth (SkFloatToScalar (style->line_width));
-    paint.setStrokeMiter (SkFloatToScalar (style->miter_limit));
-
-    static const SkPaint::Cap capMap[] = {
-	SkPaint::kButt_Cap,
-	SkPaint::kRound_Cap,
-	SkPaint::kSquare_Cap
-    };
-    paint.setStrokeCap (capMap[style->line_cap]);
-
-    static const SkPaint::Join joinMap[] = {
-	SkPaint::kMiter_Join,
-	SkPaint::kRound_Join,
-	SkPaint::kBevel_Join
-    };
-    paint.setStrokeJoin (joinMap[style->line_join]);
-
-    /* If we have a dash pattern, we need to
-     * create a SkDashPathEffect and set it on the Paint.
-     */
-    if (style->dash != NULL) {
-	SkScalar intervals_static[20];
-	SkScalar *intervals = intervals_static;
-
-	int loop = 0;
-	unsigned int dash_count = style->num_dashes;
-	if ((dash_count & 1) != 0) {
-	    loop = 1;
-	    dash_count <<= 1;
-	}
-
-	if (dash_count > 20)
-	    intervals = new SkScalar[dash_count];
-
-	unsigned int i = 0;
-	do {
-	    for (unsigned int j = 0; i < style->num_dashes; j++)
-		intervals[i++] = SkFloatToScalar (style->dash[j]);
-	} while (loop--);
-
-	SkDashPathEffect *dash = new SkDashPathEffect (intervals,
-						       dash_count,
-						       SkFloatToScalar (style->dash_offset));
-
-	paint.setPathEffect (dash);
-	dash->unref ();
-    }
-
-    surface->canvas->save (SkCanvas::kMatrix_SaveFlag);
-    surface->canvas->concat (matrix_to_sk (*ctm));
-    surface->canvas->drawPath (path_to_sk (path, ctm_inverse), paint);
-    surface->canvas->restore ();
-
-    if (image != NULL) {
-	_cairo_surface_release_source_image (&surface->base,
-					     image, image_extra);
-    }
-
-    return CAIRO_INT_STATUS_SUCCESS;
-}
-
-static cairo_int_status_t
-_cairo_skia_surface_fill (void *asurface,
-			  cairo_operator_t op,
-			  const cairo_pattern_t *source,
-			  cairo_path_fixed_t *path,
-			  cairo_fill_rule_t fill_rule,
-			  double tolerance,
-			  cairo_antialias_t antialias,
-			  cairo_clip_t *clip)
-{
-    cairo_skia_surface_t *surface = (cairo_skia_surface_t *) asurface;
-    cairo_image_surface_t *image = NULL;
-    cairo_status_t status;
-    void *image_extra;
-
-    status = _cairo_surface_clipper_set_clip (&surface->clipper, clip);
-    if (unlikely (status))
-	return (cairo_int_status_t) status;
-
-
-    SkPaint paint;
-    paint.setStyle (SkPaint::kFill_Style);
-
-    SkColor color;
-    if (pattern_to_sk_color (source, color)) {
-	paint.setColor (color);
-    } else {
-	SkShader *shader = pattern_to_sk_shader (surface,
-						 source, &image, &image_extra);
-	if (shader == NULL)
-	    return UNSUPPORTED("pattern to shader conversion");
-
-	paint.setShader (shader);
-	shader->unref ();
-
-	paint.setFilterBitmap (pattern_filter_to_sk (source));
-    }
-
-    paint.setXfermodeMode (operator_to_sk (op));
-    paint.setAntiAlias (antialias != CAIRO_ANTIALIAS_NONE);
-
-    surface->canvas->drawPath (path_to_sk (path, fill_rule), paint);
-
-    if (image != NULL) {
-	_cairo_surface_release_source_image (&surface->base,
-					     image, image_extra);
-    }
-
-    return CAIRO_INT_STATUS_SUCCESS;
-}
-
-static const struct _cairo_surface_backend
-cairo_skia_surface_backend = {
-    CAIRO_SURFACE_TYPE_SKIA,
-    _cairo_skia_surface_create_similar,
-    _cairo_skia_surface_finish,
-    _cairo_skia_surface_acquire_source_image,
-    _cairo_skia_surface_release_source_image,
-    _cairo_skia_surface_acquire_dest_image,
-    _cairo_skia_surface_release_dest_image,
-
-    NULL, // _cairo_skia_surface_clone_similar,
-    NULL, /* composite */
-    NULL, /* fill_rectangles */
-    NULL, /* composite_trapezoids */
-    NULL, /* create_span_renderer */
-    NULL, /* check_span_renderer */
-
-    NULL, /* copy_page */
-    NULL, /* show_page */
-
-    _cairo_skia_surface_get_extents,
-    NULL, /* old_show_glyphs */
-    NULL, /* get_font_options */
-    NULL, /* flush */
-    NULL, /* mark_dirty_rectangle */
-    NULL, /* scaled_font_fini */
-    NULL, /* scaled_glyph_fini */
-
-    _cairo_skia_surface_paint,
-    NULL, /* mask? */
-    _cairo_skia_surface_stroke,
-    _cairo_skia_surface_fill,
-    NULL, /* show_glyphs */
-
-    NULL, /* snapshot */
-    NULL, /* is_similar */
-    NULL, /* reset */
-};
-
-/*
- * Surface constructors
- */
-
-static cairo_skia_surface_t *
-_cairo_skia_surface_create_internal (SkBitmap::Config config,
-				     bool opaque,
-				     unsigned char *data,
-				     int width,
-				     int height,
-				     int stride)
-{
-    cairo_skia_surface_t *surface;
-    cairo_format_t format;
-
-    surface = (cairo_skia_surface_t *) _cairo_malloc (sizeof (cairo_skia_surface_t));
-    if (surface == NULL)
-	return (cairo_skia_surface_t *) _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
-
-    memset (surface, 0, sizeof (cairo_skia_surface_t));
-
-    format = sk_config_to_format (config, opaque);
-    assert (format != -1);
-
-    _cairo_surface_init (&surface->base,
-			 &cairo_skia_surface_backend,
-			 NULL, /* device */
-			 _cairo_content_from_format (format));
-
-    _cairo_surface_clipper_init (&surface->clipper,
-				 _cairo_skia_surface_clipper_intersect_clip_path);
-
-    surface->bitmap = new SkBitmap;
-    if (data == NULL)
-	stride = cairo_format_stride_for_width (format, width);
-    surface->bitmap->setConfig (config, width, height, stride);
-    surface->bitmap->setIsOpaque (opaque);
-    if (data != NULL)
-	surface->bitmap->setPixels (data);
-    else
-	surface->bitmap->allocPixels ();
-
-    surface->canvas = new SkCanvas (*surface->bitmap);
-    //surface->canvas->translate (SkIntToScalar (0), SkIntToScalar (height));
-    //surface->canvas->scale (SkIntToScalar (1), SkIntToScalar (-1));
-    surface->canvas->save ();
-
-    return surface;
-}
-
-cairo_surface_t *
-cairo_skia_surface_create (cairo_format_t format,
-			   int width,
-			   int height)
-{
-    SkBitmap::Config config;
-    bool opaque;
-
-    if (! CAIRO_FORMAT_VALID (format) ||
-	! format_to_sk_config (format, config, opaque))
-    {
-	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT));
-    }
-
-    return &_cairo_skia_surface_create_internal (config, opaque,
-						 NULL,
-						 width, height, 0)->base;
-}
-
-cairo_surface_t *
-cairo_skia_surface_create_for_data (unsigned char *data,
-				    cairo_format_t format,
-				    int width,
-				    int height,
-				    int stride)
-{
-    SkBitmap::Config config;
-    bool opaque;
-
-    if (! CAIRO_FORMAT_VALID (format) ||
-	! format_to_sk_config (format, config, opaque))
-    {
-	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT));
-    }
-
-    return &_cairo_skia_surface_create_internal (config, opaque,
-						data,
-						width, height, stride)->base;
-}
-
-unsigned char *
-cairo_skia_surface_get_data (cairo_surface_t *surface)
-{
-    if (surface->type != CAIRO_SURFACE_TYPE_SKIA)
-	return NULL;
-
-    cairo_skia_surface_t *esurf = (cairo_skia_surface_t *) surface;
-    return (unsigned char *) esurf->bitmap->getPixels ();
-}
-
-cairo_format_t
-cairo_skia_surface_get_format (cairo_surface_t *surface)
-{
-    if (surface->type != CAIRO_SURFACE_TYPE_SKIA)
-	return (cairo_format_t) -1;
-
-    cairo_skia_surface_t *esurf = (cairo_skia_surface_t *) surface;
-    return sk_config_to_format (esurf->bitmap->config (),
-				esurf->bitmap->isOpaque ());
-}
-
-int
-cairo_skia_surface_get_width (cairo_surface_t *surface)
-{
-    if (surface->type != CAIRO_SURFACE_TYPE_SKIA)
-	return 0;
-
-    cairo_skia_surface_t *esurf = (cairo_skia_surface_t *) surface;
-    return esurf->bitmap->width ();
-}
-
-int
-cairo_skia_surface_get_height (cairo_surface_t *surface)
-{
-    if (surface->type != CAIRO_SURFACE_TYPE_SKIA)
-	return 0;
-
-    cairo_skia_surface_t *esurf = (cairo_skia_surface_t *) surface;
-    return esurf->bitmap->height ();
-}
-
-int
-cairo_skia_surface_get_stride (cairo_surface_t *surface)
-{
-    if (surface->type != CAIRO_SURFACE_TYPE_SKIA)
-	return 0;
-
-    cairo_skia_surface_t *esurf = (cairo_skia_surface_t *) surface;
-    return esurf->bitmap->rowBytes ();
-}
-
-cairo_surface_t *
-cairo_skia_surface_get_image (cairo_surface_t *surface)
-{
-    if (surface->type != CAIRO_SURFACE_TYPE_SKIA)
-	return NULL;
-
-    cairo_skia_surface_t *esurf = (cairo_skia_surface_t *) surface;
-    return &_get_image_surface (esurf)->base;
-}
-
-/*
-
-Todo:
-
-*** Skia:
-
-- mask()
-
-*** Sk:
-
-High:
-- antialiased clipping?
-
-Medium:
-- implement clip path reset (to avoid restore/save)
-- implement complex radial patterns (2 centers and 2 radii)
-
-Low:
-- implement EXTEND_NONE
-
-*/
diff --git a/src/cairo-skia.h b/src/cairo-skia.h
deleted file mode 100644
index 99b928656..000000000
--- a/src/cairo-skia.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* cairo - a vector graphics library with display and print output
- *
- * Copyright © 2002 University of Southern California
- *
- * This library is free software; you can redistribute it and/or
- * modify it either under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation
- * (the "LGPL") or, at your option, under the terms of the Mozilla
- * Public License Version 1.1 (the "MPL"). If you do not alter this
- * notice, a recipient may use your version of this file under either
- * the MPL or the LGPL.
- *
- * You should have received a copy of the LGPL along with this library
- * in the file COPYING-LGPL-2.1; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
- * You should have received a copy of the MPL along with this library
- * in the file COPYING-MPL-1.1
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.1 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
- * OF ANY KIND, either express or implied. See the LGPL or the MPL for
- * the specific language governing rights and limitations.
- *
- * The Original Code is the cairo graphics library.
- *
- * The Initial Developer of the Original Code is University of Southern
- * California.
- *
- * Contributor(s):
- *	Carl D. Worth <cworth at cworth.org>
- */
-
-#ifndef CAIRO_SKIA_H
-#define CAIRO_SKIA_H
-
-#include "cairo.h"
-
-#if CAIRO_HAS_SKIA_SURFACE
-
-CAIRO_BEGIN_DECLS
-
-cairo_public cairo_surface_t *
-cairo_skia_surface_create (cairo_format_t format,
-			   int width,
-			   int height);
-
-cairo_public cairo_surface_t *
-cairo_skia_surface_create_for_data (unsigned char *data,
-				    cairo_format_t format,
-				    int width,
-				    int height,
-				    int stride);
-
-CAIRO_END_DECLS
-
-#else
-
-# error Cairo was not compiled with support for the Skia backend
-
-#endif
-
-#endif
diff --git a/src/cairo.h b/src/cairo.h
index e60ee8cde..3492bdc6b 100644
--- a/src/cairo.h
+++ b/src/cairo.h
@@ -2366,7 +2366,6 @@ cairo_surface_status (cairo_surface_t *surface);
  * @CAIRO_SURFACE_TYPE_DRM: The surface is of type Direct Render Manager, since 1.10
  * @CAIRO_SURFACE_TYPE_TEE: The surface is of type 'tee' (a multiplexing surface), since 1.10
  * @CAIRO_SURFACE_TYPE_XML: The surface is of type XML (for debugging), since 1.10
- * @CAIRO_SURFACE_TYPE_SKIA: The surface is of type Skia, since 1.10
  * @CAIRO_SURFACE_TYPE_SUBSURFACE: The surface is a subsurface created with
  *   cairo_surface_create_for_rectangle(), since 1.10
  * @CAIRO_SURFACE_TYPE_COGL: This surface is of type Cogl, since 1.12
diff --git a/src/skia/cairo-skia-context.cpp b/src/skia/cairo-skia-context.cpp
deleted file mode 100644
index f1326fdb0..000000000
--- a/src/skia/cairo-skia-context.cpp
+++ /dev/null
@@ -1,1781 +0,0 @@
-/* -*- Mode: c; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
-/* cairo - a vector graphics library with display and print output
- *
- * Copyright © 2002 University of Southern California
- * Copyright © 2005 Red Hat, Inc.
- * Copyright © 2010 Intel Corporation
- *
- * This library is free software; you can redistribute it and/or
- * modify it either under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation
- * (the "LGPL") or, at your option, under the terms of the Mozilla
- * Public License Version 1.1 (the "MPL"). If you do not alter this
- * notice, a recipient may use your version of this file under either
- * the MPL or the LGPL.
- *
- * You should have received a copy of the LGPL along with this library
- * in the file COPYING-LGPL-2.1; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * You should have received a copy of the MPL along with this library
- * in the file COPYING-MPL-1.1
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.1 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
- * OF ANY KIND, either express or implied. See the LGPL or the MPL for
- * the specific language governing rights and limitations.
- *
- * The Original Code is the cairo graphics library.
- *
- * The Initial Developer of the Original Code is University of Southern
- * California.
- *
- * Contributor(s):
- *	Carl D. Worth <cworth at cworth.org>
- *	Chris Wilson <chris at chris-wilson.co.uk>
- */
-
-#include "cairoint.h"
-
-#include "cairo-private.h"
-#include "cairo-error-private.h"
-#include "cairo-arc-private.h"
-#include "cairo-backend-private.h"
-#include "cairo-default-context-private.h"
-#include "cairo-freed-pool-private.h"
-#include "cairo-gstate-private.h"
-#include "cairo-image-surface-inline.h"
-#include "cairo-path-private.h"
-#include "cairo-pattern-private.h"
-#include "cairo-skia-private.h"
-#include "cairo-surface-backend-private.h"
-
-#include <SkPaint.h>
-#include <SkShader.h>
-#include <SkColorShader.h>
-#include <SkGradientShader.h>
-#include <SkDashPathEffect.h>
-
-#if !defined(INFINITY)
-#define INFINITY HUGE_VAL
-#endif
-
-#if (CAIRO_FIXED_BITS == 32) && (CAIRO_FIXED_FRAC_BITS == 16) && defined(SK_SCALAR_IS_FIXED)
-# define CAIRO_FIXED_TO_SK_SCALAR(x)  (x)
-#elif defined(SK_SCALAR_IS_FIXED)
-/* This can be done better, but this will do for now */
-# define CAIRO_FIXED_TO_SK_SCALAR(x)  SkFloatToScalar(_cairo_fixed_to_double(x))
-#else
-# define CAIRO_FIXED_TO_SK_SCALAR(x)  SkFloatToScalar(_cairo_fixed_to_double(x))
-#endif
-
-#define UNSUPPORTED
-
-
-static freed_pool_t context_pool;
-
-static void
-_cairo_skia_context_destroy (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cr->path->reset ();
-    cr->paint->reset ();
-
-    delete cr->canvas;
-
-    cairo_surface_destroy (&cr->target->image.base);
-    cairo_surface_destroy (&cr->original->image.base);
-
-    if (cr->source != NULL) {
-	if (cr->source_image != NULL) {
-	    _cairo_surface_release_source_image (cr->source, cr->source_image, cr->source_extra);
-	    cr->source_image = NULL;
-	}
-	cairo_surface_destroy (cr->source);
-	cr->source = NULL;
-    }
-
-    _cairo_fini (&cr->base);
-
-    _freed_pool_put (&context_pool, cr);
-}
-
-static cairo_surface_t *
-_cairo_skia_context_get_original_target (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    return &cr->original->image.base;
-}
-
-static cairo_surface_t *
-_cairo_skia_context_get_current_target (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    return &cr->target->image.base;
-}
-
-static cairo_status_t
-_cairo_skia_context_save (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cr->canvas->save ();
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_restore (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cr->canvas->restore ();
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_push_group (void *abstract_cr, cairo_content_t content)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    cairo_surface_t *group_surface;
-    cairo_status_t status;
-    int width, height;
-
-    //clip = _cairo_gstate_get_clip (cr->gstate);
-    width = cr->target->image.width;
-    height = cr->target->image.height;
-    group_surface = cr->target->image.base.backend->create_similar (&cr->target->image.base,
-								    content, width, height);
-
-#if 0
-    /* Set device offsets on the new surface so that logically it appears at
-     * the same location on the parent surface -- when we pop_group this,
-     * the source pattern will get fixed up for the appropriate target surface
-     * device offsets, so we want to set our own surface offsets from /that/,
-     * and not from the device origin. */
-    cairo_surface_set_device_offset (group_surface,
-				     parent_surface->device_transform.x0 - extents.x,
-				     parent_surface->device_transform.y0 - extents.y);
-
-    /* If we have a current path, we need to adjust it to compensate for
-     * the device offset just applied. */
-    _cairo_path_fixed_transform (cr->path,
-				 &group_surface->device_transform);
-#endif
-
-    status = _cairo_skia_context_save (cr);
-    if (unlikely (status)) {
-	cairo_surface_destroy (group_surface);
-	return status;
-    }
-
-    cairo_surface_destroy (&cr->target->image.base);
-    cr->target = (cairo_skia_surface_t *) group_surface;
-
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_pattern_t *
-_cairo_skia_context_pop_group (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    cairo_surface_t *group_surface;
-    cairo_pattern_t *group_pattern;
-    cairo_status_t status;
-
-    group_surface = cairo_surface_reference (&cr->target->image.base);
-
-    status = _cairo_skia_context_restore (cr);
-    if (unlikely (status)) {
-	group_pattern = _cairo_pattern_create_in_error (status);
-	goto done;
-    }
-
-    group_pattern = cairo_pattern_create_for_surface (group_surface);
-    status = group_pattern->status;
-    if (unlikely (status))
-        goto done;
-
-#if 0
-    _cairo_gstate_get_matrix (cr->gstate, &group_matrix);
-    /* Transform by group_matrix centered around device_transform so that when
-     * we call _cairo_gstate_copy_transformed_pattern the result is a pattern
-     * with a matrix equivalent to the device_transform of group_surface. */
-    if (_cairo_surface_has_device_transform (group_surface)) {
-	cairo_pattern_set_matrix (group_pattern, &group_surface->device_transform);
-	_cairo_pattern_transform (group_pattern, &group_matrix);
-	_cairo_pattern_transform (group_pattern, &group_surface->device_transform_inverse);
-    } else {
-	cairo_pattern_set_matrix (group_pattern, &group_matrix);
-    }
-
-    /* If we have a current path, we need to adjust it to compensate for
-     * the device offset just removed. */
-    _cairo_path_fixed_transform (cr->path,
-				 &group_surface->device_transform_inverse);
-#endif
-
-done:
-    cairo_surface_destroy (group_surface);
-
-    return group_pattern;
-}
-
-static inline cairo_surface_t *
-surface_from_pattern (const cairo_pattern_t *pattern)
-{
-    return (reinterpret_cast <const cairo_surface_pattern_t *> (pattern))->surface;
-}
-
-static inline bool
-surface_to_sk_bitmap (cairo_surface_t *surface, SkBitmap& bitmap)
-{
-    cairo_image_surface_t *img = (cairo_image_surface_t *) surface;
-    SkBitmap::Config config;
-    SkColorType colorType;
-    bool opaque;
-
-    if (unlikely (! format_to_sk_config (img->format, config, opaque)))
-	return false;
-
-    bitmap.reset ();
-    bitmap.setAlphaType (opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType);
-    colorType = SkBitmapConfigToColorType(config);
-    bitmap.setInfo (SkImageInfo::Make(img->width, img->height, colorType, kPremul_SkAlphaType), img->stride);
-    bitmap.setPixels (img->data);
-
-
-    return true;
-}
-
-static inline SkMatrix
-matrix_to_sk (const cairo_matrix_t& mat)
-{
-    SkMatrix skm;
-
-    skm.reset ();
-    skm.set (SkMatrix::kMScaleX, SkFloatToScalar (mat.xx));
-    skm.set (SkMatrix::kMSkewX,  SkFloatToScalar (mat.xy));
-    skm.set (SkMatrix::kMTransX, SkFloatToScalar (mat.x0));
-    skm.set (SkMatrix::kMSkewY,  SkFloatToScalar (mat.yx));
-    skm.set (SkMatrix::kMScaleY, SkFloatToScalar (mat.yy));
-    skm.set (SkMatrix::kMTransY, SkFloatToScalar (mat.y0));
-
-    /*
-    skm[6] = SkFloatToScalar (0.0);
-    skm[7] = SkFloatToScalar (0.0);
-    skm[8] = SkFloatToScalar (1.0); -- this isn't right, it wants a magic value in there that it'll set itself.  It wants Sk_Fract1 (2.30), not Sk_Scalar1
-    */
-
-    return skm;
-}
-
-static inline SkMatrix
-matrix_inverse_to_sk (const cairo_matrix_t& mat)
-{
-    cairo_matrix_t inv = mat;
-    cairo_status_t status = cairo_matrix_invert (&inv);
-    assert (status == CAIRO_STATUS_SUCCESS);
-    return matrix_to_sk (inv);
-}
-
-static SkShader::TileMode
-extend_to_sk (cairo_extend_t extend)
-{
-    static const SkShader::TileMode modeMap[] = {
-	SkShader::kClamp_TileMode,  // NONE behaves like PAD, because no one wants NONE
-	SkShader::kRepeat_TileMode,
-	SkShader::kMirror_TileMode,
-	SkShader::kClamp_TileMode
-    };
-
-    return modeMap[extend];
-}
-
-static inline SkColor
-color_to_sk (const cairo_color_t& c)
-{
-    /* Need unpremultiplied 1-byte values */
-    return SkColorSetARGB ((U8CPU) (c.alpha * 255),
-			   (U8CPU) (c.red * 255),
-			   (U8CPU) (c.green * 255),
-			   (U8CPU) (c.blue * 255));
-}
-
-static inline SkColor
-color_stop_to_sk (const cairo_color_stop_t& c)
-{
-    /* Need unpremultiplied 1-byte values */
-    return SkColorSetARGB ((U8CPU) (c.alpha * 255),
-			   (U8CPU) (c.red * 255),
-			   (U8CPU) (c.green * 255),
-			   (U8CPU) (c.blue * 255));
-}
-
-static SkShader*
-source_to_sk_shader (cairo_skia_context_t *cr,
-		     const cairo_pattern_t *pattern)
-{
-    SkShader *shader = NULL;
-
-    if (pattern->type == CAIRO_PATTERN_TYPE_SOLID) {
-	cairo_solid_pattern_t *solid = (cairo_solid_pattern_t *) pattern;
-	return new SkColorShader (color_to_sk (solid->color));
-    } else if (pattern->type == CAIRO_PATTERN_TYPE_SURFACE) {
-	cairo_surface_t *surface = surface_from_pattern (pattern);
-
-	cr->source = cairo_surface_reference (surface);
-
-	if (surface->type == CAIRO_SURFACE_TYPE_SKIA) {
-	    cairo_skia_surface_t *esurf = (cairo_skia_surface_t *) surface;
-
-		if (! _cairo_matrix_is_identity (&pattern->matrix))
-		{
-			SkMatrix localMatrix =  matrix_inverse_to_sk (pattern->matrix);
-			shader = SkShader::CreateBitmapShader (*esurf->bitmap,
-					extend_to_sk (pattern->extend),
-					extend_to_sk (pattern->extend),
-					&localMatrix);
-		} else {
-			shader = SkShader::CreateBitmapShader (*esurf->bitmap,
-					extend_to_sk (pattern->extend),
-					extend_to_sk (pattern->extend));
-		}
-	} else {
-	    SkBitmap bitmap;
-
-	    if (! _cairo_surface_is_image (surface)) {
-		cairo_status_t status;
-
-		status = _cairo_surface_acquire_source_image (surface,
-							      &cr->source_image,
-							      &cr->source_extra);
-		if (status)
-		    return NULL;
-
-		surface = &cr->source_image->base;
-	    }
-
-	    if (unlikely (! surface_to_sk_bitmap (surface, bitmap)))
-		return NULL;
-
-		if (! _cairo_matrix_is_identity (&pattern->matrix))
-		{
-			SkMatrix localMatrix = matrix_inverse_to_sk (pattern->matrix);
-			shader = SkShader::CreateBitmapShader (bitmap,
-					extend_to_sk (pattern->extend),
-					extend_to_sk (pattern->extend),
-					&localMatrix);
-		} else {
-			shader = SkShader::CreateBitmapShader (bitmap,
-			extend_to_sk (pattern->extend),
-			extend_to_sk (pattern->extend));
-		}
-	}
-    } else if (pattern->type == CAIRO_PATTERN_TYPE_LINEAR
-	       /* || pattern->type == CAIRO_PATTERN_TYPE_RADIAL */)
-    {
-	cairo_gradient_pattern_t *gradient = (cairo_gradient_pattern_t *) pattern;
-	SkColor colors_stack[10];
-	SkScalar pos_stack[10];
-	SkColor *colors = colors_stack;
-	SkScalar *pos = pos_stack;
-
-	if (gradient->n_stops > 10) {
-	    colors = new SkColor[gradient->n_stops];
-	    pos = new SkScalar[gradient->n_stops];
-	}
-
-	for (unsigned int i = 0; i < gradient->n_stops; i++) {
-	    pos[i] = CAIRO_FIXED_TO_SK_SCALAR (gradient->stops[i].offset);
-	    colors[i] = color_stop_to_sk (gradient->stops[i].color);
-	}
-
-	if (pattern->type == CAIRO_PATTERN_TYPE_LINEAR) {
-	    cairo_linear_pattern_t *linear = (cairo_linear_pattern_t *) gradient;
-	    SkPoint points[2];
-
-	    points[0].set (SkFloatToScalar (linear->pd1.x),
-			   SkFloatToScalar (linear->pd1.y));
-	    points[1].set (SkFloatToScalar (linear->pd2.x),
-			   SkFloatToScalar (linear->pd2.y));
-
-	    if(! _cairo_matrix_is_identity (&pattern->matrix))
-	    {
-		SkMatrix localMatrix = matrix_inverse_to_sk (pattern->matrix);
-	        shader = SkGradientShader::CreateLinear (points, colors, pos, gradient->n_stops,
-						     extend_to_sk (pattern->extend),
-						     0, &localMatrix);
-	    } else {
-	        shader = SkGradientShader::CreateLinear (points, colors, pos, gradient->n_stops,
-							extend_to_sk (pattern->extend));
-	    }
-	} else {
-	    // XXX todo -- implement real radial shaders in Skia
-	}
-
-	if (gradient->n_stops > 10) {
-	    delete [] colors;
-	    delete [] pos;
-	}
-    }
-
-    return shader;
-}
-
-static inline bool
-pattern_filter_to_sk (const cairo_pattern_t *pattern)
-{
-    switch (pattern->filter) {
-    case CAIRO_FILTER_GOOD:
-    case CAIRO_FILTER_BEST:
-    case CAIRO_FILTER_BILINEAR:
-    case CAIRO_FILTER_GAUSSIAN:
-	return true;
-    default:
-    case CAIRO_FILTER_FAST:
-    case CAIRO_FILTER_NEAREST:
-	return false;
-    }
-}
-
-static inline bool
-pattern_to_sk_color (const cairo_pattern_t *pattern, SkColor& color)
-{
-    if (pattern->type != CAIRO_PATTERN_TYPE_SOLID)
-	return false;
-
-    color = color_to_sk (((cairo_solid_pattern_t *) pattern)->color);
-    return true;
-}
-
-static cairo_status_t
-_cairo_skia_context_set_source (void *abstract_cr,
-				cairo_pattern_t *source)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    SkColor color;
-
-    if (cr->source != NULL) {
-	if (cr->source_image != NULL) {
-	    _cairo_surface_release_source_image (cr->source, cr->source_image, cr->source_extra);
-	    cr->source_image = NULL;
-	}
-	cairo_surface_destroy (cr->source);
-	cr->source = NULL;
-    }
-
-    if (pattern_to_sk_color (source, color)) {
-	cr->paint->setColor (color);
-    } else {
-	SkShader *shader = source_to_sk_shader (cr, source);
-	bool fLevel = pattern_filter_to_sk (source);
-	if (shader == NULL) {
-	    UNSUPPORTED;
-	    return CAIRO_STATUS_SUCCESS;
-	}
-
-	cr->paint->setShader (shader);
-	shader->unref ();
-
-	cr->paint->setFilterLevel (fLevel ?
-				(SkPaint::kLow_FilterLevel) : (SkPaint::kNone_FilterLevel));
-    }
-
-    /* XXX change notification */
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_set_source_rgba (void *abstract_cr, double red, double green, double blue, double alpha)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    /* Need unpremultiplied 1-byte values */
-    cr->paint->setARGB ((U8CPU) (alpha * 255),
-			(U8CPU) (red * 255),
-			(U8CPU) (green * 255),
-			(U8CPU) (blue * 255));
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_set_source_surface (void *abstract_cr,
-					cairo_surface_t *surface,
-					double	   x,
-					double	   y)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    cairo_pattern_t *pattern;
-    cairo_matrix_t matrix;
-    cairo_status_t status;
-
-    if (surface->type == CAIRO_SURFACE_TYPE_SKIA) {
-	cairo_skia_surface_t *esurf = (cairo_skia_surface_t *) surface;
-	SkShader *shader;
-
-	shader = SkShader::CreateBitmapShader (*esurf->bitmap,
-					       SkShader::kClamp_TileMode, /* XXX */
-					       SkShader::kClamp_TileMode);
-
-	cr->paint->setShader (shader);
-	shader->unref ();
-
-	cr->paint->setFilterLevel (true ?
-		(SkPaint::kLow_FilterLevel) : (SkPaint::kNone_FilterLevel));
-
-	return CAIRO_STATUS_SUCCESS;
-    }
-
-    pattern = cairo_pattern_create_for_surface (surface);
-    if (unlikely (pattern->status))
-	return pattern->status;
-
-    cairo_matrix_init_translate (&matrix, -x, -y);
-    cairo_pattern_set_matrix (pattern, &matrix);
-
-    status = _cairo_skia_context_set_source (cr, pattern);
-    cairo_pattern_destroy (pattern);
-
-    return status;
-}
-
-static cairo_pattern_t *
-_cairo_skia_context_get_source (void *abstract_cr)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-    return NULL;
-}
-
-static cairo_status_t
-_cairo_skia_context_set_tolerance (void *abstract_cr,
-				   double tolerance)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    /* XXX ignored */
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static inline SkXfermode::Mode
-operator_to_sk (cairo_operator_t op)
-{
-    static const SkXfermode::Mode modeMap[] = {
-	SkXfermode::kClear_Mode,
-
-	SkXfermode::kSrc_Mode,
-	SkXfermode::kSrcOver_Mode,
-	SkXfermode::kSrcIn_Mode,
-	SkXfermode::kSrcOut_Mode,
-	SkXfermode::kSrcATop_Mode,
-
-	SkXfermode::kDst_Mode,
-	SkXfermode::kDstOver_Mode,
-	SkXfermode::kDstIn_Mode,
-	SkXfermode::kDstOut_Mode,
-	SkXfermode::kDstATop_Mode,
-
-	SkXfermode::kXor_Mode,
-	SkXfermode::kPlus_Mode, // XXX Add?
-	SkXfermode::kPlus_Mode, // XXX SATURATE
-
-	SkXfermode::kPlus_Mode,
-	SkXfermode::kMultiply_Mode,
-	SkXfermode::kScreen_Mode,
-	SkXfermode::kOverlay_Mode,
-	SkXfermode::kDarken_Mode,
-	SkXfermode::kLighten_Mode,
-	SkXfermode::kColorDodge_Mode,
-	SkXfermode::kColorBurn_Mode,
-	SkXfermode::kHardLight_Mode,
-	SkXfermode::kSoftLight_Mode,
-	SkXfermode::kDifference_Mode,
-	SkXfermode::kExclusion_Mode,
-
-	SkXfermode::kSrcOver_Mode, // XXX: CAIRO_OPERATOR_HSL_HUE
-	SkXfermode::kSrcOver_Mode, // XXX: CAIRO_OPERATOR_HSL_SATURATION,
-	SkXfermode::kSrcOver_Mode, // XXX: CAIRO_OPERATOR_HSL_COLOR,
-	SkXfermode::kSrcOver_Mode, // XXX: CAIRO_OPERATOR_HSL_LUMINOSITY
-    };
-
-    return modeMap[op];
-}
-
-static cairo_status_t
-_cairo_skia_context_set_operator (void *abstract_cr, cairo_operator_t op)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cr->paint->setXfermodeMode (operator_to_sk (op));
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_set_opacity (void *abstract_cr, double opacity)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    /* XXX */
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_set_antialias (void *abstract_cr, cairo_antialias_t antialias)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cr->paint->setAntiAlias (antialias != CAIRO_ANTIALIAS_NONE);
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_set_fill_rule (void *abstract_cr,
-				   cairo_fill_rule_t fill_rule)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cr->path->setFillType (fill_rule == CAIRO_FILL_RULE_WINDING ? SkPath::kWinding_FillType : SkPath::kEvenOdd_FillType);
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_set_line_width (void *abstract_cr,
-				    double line_width)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cr->paint->setStrokeWidth (SkFloatToScalar (line_width));
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_set_line_cap (void *abstract_cr,
-				  cairo_line_cap_t line_cap)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    static const SkPaint::Cap map[] = {
-	SkPaint::kButt_Cap,
-	SkPaint::kRound_Cap,
-	SkPaint::kSquare_Cap
-    };
-    cr->paint->setStrokeCap (map[line_cap]);
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_set_line_join (void *abstract_cr,
-				   cairo_line_join_t line_join)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    static const SkPaint::Join map[] = {
-	SkPaint::kMiter_Join,
-	SkPaint::kRound_Join,
-	SkPaint::kBevel_Join
-    };
-    cr->paint->setStrokeJoin (map[line_join]);
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_set_dash (void *abstract_cr,
-			      const double *dashes,
-			      int	      num_dashes,
-			      double	      offset)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    SkScalar intervals_static[20];
-    SkScalar *intervals = intervals_static;
-
-    if (num_dashes == 0) {
-	cr->paint->setPathEffect (NULL);
-	return CAIRO_STATUS_SUCCESS;
-    }
-
-    int loop = 0;
-    if ((num_dashes & 1) != 0) {
-	loop = 1;
-	num_dashes <<= 1;
-    }
-
-    if (num_dashes > 20)
-	intervals = new SkScalar[num_dashes];
-
-    int i = 0;
-    do {
-	for (int j = 0; i < num_dashes; j++)
-	    intervals[i++] = SkFloatToScalar (dashes[j]);
-    } while (loop--);
-
-    SkDashPathEffect *dash = SkDashPathEffect::Create (intervals, num_dashes, SkFloatToScalar (offset));
-
-    cr->paint->setPathEffect (dash);
-    dash->unref ();
-
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_set_miter_limit (void *abstract_cr, double limit)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cr->paint->setStrokeMiter (SkFloatToScalar (limit));
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_antialias_t
-_cairo_skia_context_get_antialias (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    return cr->paint->isAntiAlias () ? CAIRO_ANTIALIAS_DEFAULT : CAIRO_ANTIALIAS_NONE;
-}
-
-static void
-_cairo_skia_context_get_dash (void *abstract_cr,
-			      double *dashes,
-			      int *num_dashes,
-			      double *offset)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    *num_dashes = 0;
-    /* XXX */
-}
-
-static cairo_fill_rule_t
-_cairo_skia_context_get_fill_rule (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    SkPath::FillType ft;
-
-    ft = cr->path->getFillType ();
-    if (ft == SkPath::kWinding_FillType)
-	return CAIRO_FILL_RULE_WINDING;
-    if (ft == SkPath::kEvenOdd_FillType)
-	return CAIRO_FILL_RULE_EVEN_ODD;;
-
-    UNSUPPORTED;
-    return CAIRO_FILL_RULE_WINDING;
-}
-
-static double
-_cairo_skia_context_get_line_width (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    return /* ScalarToFloat */ cr->paint->getStrokeWidth ();
-}
-
-static cairo_line_cap_t
-_cairo_skia_context_get_line_cap (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    static const cairo_line_cap_t map[] = {
-	CAIRO_LINE_CAP_BUTT,
-	CAIRO_LINE_CAP_ROUND,
-	CAIRO_LINE_CAP_SQUARE
-    };
-    return map[cr->paint->getStrokeCap ()];
-}
-
-static cairo_line_join_t
-_cairo_skia_context_get_line_join (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    static const cairo_line_join_t map[] = {
-	CAIRO_LINE_JOIN_MITER,
-	CAIRO_LINE_JOIN_ROUND,
-	CAIRO_LINE_JOIN_BEVEL
-    };
-    return map[cr->paint->getStrokeJoin ()];
-}
-
-static double
-_cairo_skia_context_get_miter_limit (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    return /* SkScalarToFloat */ cr->paint->getStrokeMiter ();
-}
-
-static cairo_operator_t
-_cairo_skia_context_get_operator (void *abstract_cr)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-    //cr->paint->getXfermode ();
-    return CAIRO_OPERATOR_OVER;
-}
-
-static double
-_cairo_skia_context_get_opacity (void *abstract_cr)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-    return 1.;
-}
-
-static double
-_cairo_skia_context_get_tolerance (void *abstract_cr)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    /* XXX */
-    return CAIRO_GSTATE_TOLERANCE_DEFAULT;
-}
-
-
-/* Current tranformation matrix */
-
-static cairo_status_t
-_cairo_skia_context_translate (void *abstract_cr,
-			       double tx,
-			       double ty)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cairo_matrix_translate (&cr->matrix, tx, ty);
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_scale (void *abstract_cr,
-			   double sx,
-			      double sy)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cairo_matrix_scale (&cr->matrix, sx, sy);
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_rotate (void *abstract_cr,
-			    double theta)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cairo_matrix_rotate (&cr->matrix, theta);
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_transform (void *abstract_cr,
-			       const cairo_matrix_t *matrix)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cairo_matrix_multiply (&cr->matrix, &cr->matrix, matrix);
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_set_matrix (void *abstract_cr,
-				const cairo_matrix_t *matrix)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cr->matrix = *matrix;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_set_identity_matrix (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cairo_matrix_init_identity (&cr->matrix);
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static void
-_cairo_skia_context_get_matrix (void *abstract_cr,
-				cairo_matrix_t *matrix)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    *matrix = cr->matrix;
-}
-
-static void
-_cairo_skia_context_user_to_device (void *abstract_cr,
-				    double *x,
-				    double *y)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cairo_matrix_transform_point (&cr->matrix, x, y);
-}
-
-static void
-_cairo_skia_context_user_to_device_distance (void *abstract_cr,
-					     double *dx,
-					     double *dy)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cairo_matrix_transform_distance (&cr->matrix, dx, dy);
-}
-
-static void
-_cairo_skia_context_device_to_user (void *abstract_cr,
-				    double *x,
-				    double *y)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    cairo_matrix_t inverse;
-    cairo_status_t status;
-
-    inverse = cr->matrix;
-    status = cairo_matrix_invert (&inverse);
-    assert (CAIRO_STATUS_SUCCESS == status);
-
-    cairo_matrix_transform_point (&inverse, x, y);
-}
-
-static void
-_cairo_skia_context_device_to_user_distance (void *abstract_cr,
-					     double *dx,
-					     double *dy)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    cairo_matrix_t inverse;
-    cairo_status_t status;
-
-    inverse = cr->matrix;
-    status = cairo_matrix_invert (&inverse);
-    assert (CAIRO_STATUS_SUCCESS == status);
-
-    cairo_matrix_transform_distance (&inverse, dx, dy);
-}
-
-/* Path constructor */
-
-static cairo_status_t
-_cairo_skia_context_new_path (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cr->path->reset ();
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_new_sub_path (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cr->path->rMoveTo (0, 0); /* XXX */
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static void
-user_to_device_point (cairo_skia_context_t *cr, double *x, double *y)
-{
-    cairo_matrix_transform_point (&cr->matrix, x, y);
-    cairo_matrix_transform_point (&cr->target->image.base.device_transform, x, y);
-}
-
-static void
-user_to_device_distance (cairo_skia_context_t *cr, double *dx, double *dy)
-{
-    cairo_matrix_transform_distance (&cr->matrix, dx, dy);
-    cairo_matrix_transform_distance (&cr->target->image.base.device_transform, dx, dy);
-}
-
-static cairo_status_t
-_cairo_skia_context_move_to (void *abstract_cr, double x, double y)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    user_to_device_point (cr, &x, &y);
-    cr->path->moveTo (SkFloatToScalar (x), SkFloatToScalar (y));
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_line_to (void *abstract_cr, double x, double y)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    user_to_device_point (cr, &x, &y);
-    cr->path->lineTo (SkFloatToScalar (x), SkFloatToScalar (y));
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_curve_to (void *abstract_cr,
-			      double x1, double y1,
-			      double x2, double y2,
-			      double x3, double y3)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    user_to_device_point (cr, &x1, &y1);
-    user_to_device_point (cr, &x2, &y2);
-    user_to_device_point (cr, &x3, &y3);
-    cr->path->cubicTo (SkFloatToScalar (x1), SkFloatToScalar (y1),
-		       SkFloatToScalar (x2), SkFloatToScalar (y2),
-		       SkFloatToScalar (x3), SkFloatToScalar (y3));
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_arc_to (void *abstract_cr,
-			    double x1, double y1,
-			    double x2, double y2,
-			    double radius)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-#if 0
-    user_to_device_point (cr, &x1, &y1);
-    user_to_device_point (cr, &x2, &y2);
-    user_to_device_distance (cr, &radius, &radius);
-#endif
-
-    cr->path->arcTo (SkFloatToScalar (x1), SkFloatToScalar (y1),
-		     SkFloatToScalar (x2), SkFloatToScalar (y2),
-		     SkFloatToScalar (radius));
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_rel_move_to (void *abstract_cr, double dx, double dy)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    user_to_device_distance (cr, &dx, &dy);
-    cr->path->rMoveTo (SkFloatToScalar (dx), SkFloatToScalar (dy));
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_rel_line_to (void *abstract_cr, double dx, double dy)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    user_to_device_distance (cr, &dx, &dy);
-    cr->path->rLineTo (SkFloatToScalar (dx), SkFloatToScalar (dy));
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_rel_curve_to (void *abstract_cr,
-				  double dx1, double dy1,
-				  double dx2, double dy2,
-				  double dx3, double dy3)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    user_to_device_distance (cr, &dx1, &dy1);
-    user_to_device_distance (cr, &dx2, &dy2);
-    user_to_device_distance (cr, &dx3, &dy3);
-    cr->path->rCubicTo (SkFloatToScalar (dx1), SkFloatToScalar (dy1),
-			SkFloatToScalar (dx2), SkFloatToScalar (dy2),
-			SkFloatToScalar (dx3), SkFloatToScalar (dy3));
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_rel_arc_to (void *abstract_cr,
-				double dx1, double dy1,
-				double dx2, double dy2,
-				double radius)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-#if 0
-    user_to_device_point (cr, &x1, &y1);
-    user_to_device_point (cr, &x2, &y2);
-    user_to_device_distance (cr, &radius, &radius);
-#endif
-
-    cr->path->arcTo (SkFloatToScalar (dx1), SkFloatToScalar (dy1),
-		     SkFloatToScalar (dx2), SkFloatToScalar (dy2),
-		     SkFloatToScalar (radius));
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_close_path (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cr->path->close ();
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_rectangle (void *abstract_cr,
-			       double x, double y,
-			       double width, double height)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    double x1, y1, x2, y2;
-
-    /* XXX assume no rotation! */
-    x1 = x, y1 = y;
-    user_to_device_point (cr, &x1, &y1);
-
-    x2 = x + width, y2 = y + height;
-    user_to_device_point (cr, &x2, &y2);
-
-    cr->path->addRect (SkFloatToScalar (x1), SkFloatToScalar (y1),
-		       SkFloatToScalar (x2), SkFloatToScalar (y2));
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_arc (void *abstract_cr,
-			 double xc, double yc, double radius,
-			 double angle1, double angle2,
-			 cairo_bool_t forward)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    cairo_status_t status;
-
-    /* XXX cr->path->arc() */
-
-    /* Do nothing, successfully, if radius is <= 0 */
-    if (radius <= 0.0) {
-	status = _cairo_skia_context_line_to (cr, xc, yc);
-	if (unlikely (status))
-	    return status;
-
-	status = _cairo_skia_context_line_to (cr, xc, yc);
-	if (unlikely (status))
-	    return status;
-
-	return CAIRO_STATUS_SUCCESS;
-    }
-
-    status = _cairo_skia_context_line_to (cr,
-					  xc + radius * cos (angle1),
-					  yc + radius * sin (angle1));
-
-    if (unlikely (status))
-	return status;
-
-    if (forward)
-	_cairo_arc_path (&cr->base, xc, yc, radius, angle1, angle2);
-    else
-	_cairo_arc_path_negative (&cr->base, xc, yc, radius, angle1, angle2);
-
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static void
-_cairo_skia_context_path_extents (void *abstract_cr,
-				  double *x1,
-				  double *y1,
-				  double *x2,
-				  double *y2)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    SkRect rect;
-
-    rect = cr->path->getBounds ();
-
-    UNSUPPORTED;
-    /* XXX transform SkScalar rect to user */
-}
-
-static cairo_bool_t
-_cairo_skia_context_has_current_point (void *abstract_cr)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    return TRUE;
-}
-
-static cairo_bool_t
-_cairo_skia_context_get_current_point (void *abstract_cr,
-				       double *x,
-				       double *y)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    SkPoint pt;
-
-    cr->path->getLastPt (&pt);
-    //*x = SkScalarToFloat (pt.x);
-    //*y = SkScalarToFloat (pt.y);
-    //_cairo_gstate_backend_to_user (cr->gstate, x, y);
-
-    return TRUE;
-}
-
-static cairo_path_t *
-_cairo_skia_context_copy_path (void *abstract_cr)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    /* XXX iterate */
-    UNSUPPORTED;
-    return NULL;
-}
-
-static cairo_path_t *
-_cairo_skia_context_copy_path_flat (void *abstract_cr)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    /* XXX iterate and decompose */
-    UNSUPPORTED;
-    return NULL;
-}
-
-static cairo_status_t
-_cairo_skia_context_append_path (void *abstract_cr,
-				 const cairo_path_t *path)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-   // return _cairo_path_append_to_context (path, cr);
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_stroke_to_path (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cr->paint->setStyle (SkPaint::kStroke_Style);
-    cr->paint->getFillPath (*cr->path, cr->path);
-    return CAIRO_STATUS_SUCCESS;
-}
-
-
-static cairo_status_t
-_cairo_skia_context_paint (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-#if 0
-    if (cr->source != NULL) {
-	SkBitmap bitmap;
-	SkMatrix bitmapMatrix;
-
-	if (cr->source->type == CAIRO_SURFACE_TYPE_SKIA) {
-	    cairo_skia_surface_t *esurf = (cairo_skia_surface_t *) cr->source->type;
-
-	    bitmap = *esurf->bitmap;
-	} else {
-	    surface_to_sk_bitmap (&cr->source_image->base, bitmap);
-	}
-
-	// XXX pattern->matrix, pattern->filter, pattern->extend
-	cr->canvas->drawBitmapMatrix (bitmap, bitmapMatrix, cr->paint);
-    } else {
-	cr->canvas->drawPaint (*cr->paint);
-    }
-#else
-    cr->canvas->drawPaint (*cr->paint);
-#endif
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_paint_with_alpha (void *abstract_cr,
-				      double alpha)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    cairo_status_t status;
-
-    if (CAIRO_ALPHA_IS_OPAQUE (alpha))
-	return _cairo_skia_context_paint (cr);
-
-    cr->paint->setAlpha(SkScalarRoundToInt(255*alpha));
-    status = _cairo_skia_context_paint (cr);
-    cr->paint->setAlpha(255);
-
-    return status;
-}
-
-static cairo_status_t
-_cairo_skia_context_mask (void *abstract_cr,
-			  cairo_pattern_t *mask)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    /* XXX */
-    //UNSUPPORTED;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_stroke_preserve (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cr->paint->setStyle (SkPaint::kStroke_Style);
-
-    /* XXX pen transformation? */
-    //assert (_cairo_matrix_is_identity (&cr->matrix));
-    cr->canvas->drawPath (*cr->path, *cr->paint);
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_stroke (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    cairo_status_t status;
-
-    status = _cairo_skia_context_stroke_preserve (cr);
-    if (unlikely (status))
-	return status;
-
-    return _cairo_skia_context_new_path (cr);
-}
-
-static cairo_status_t
-_cairo_skia_context_in_stroke (void *abstract_cr,
-			       double x, double y,
-			       cairo_bool_t *inside)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_stroke_extents (void *abstract_cr,
-				    double *x1, double *y1, double *x2, double *y2)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_fill_preserve (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cr->paint->setStyle (SkPaint::kFill_Style);
-    cr->canvas->drawPath (*cr->path, *cr->paint);
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_fill (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    cairo_status_t status;
-
-    status = _cairo_skia_context_fill_preserve (cr);
-    if (unlikely (status))
-	return status;
-
-    return _cairo_skia_context_new_path (cr);
-}
-
-static cairo_status_t
-_cairo_skia_context_in_fill (void *abstract_cr,
-				double x, double y,
-				cairo_bool_t *inside)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_fill_extents (void *abstract_cr,
-				     double *x1, double *y1, double *x2, double *y2)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_clip_preserve (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    cr->canvas->clipPath (*cr->path);
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_clip (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    cairo_status_t status;
-
-    status = _cairo_skia_context_clip_preserve (cr);
-    if (unlikely (status))
-	return status;
-
-    return _cairo_skia_context_new_path (cr);
-}
-
-static cairo_status_t
-_cairo_skia_context_in_clip (void *abstract_cr,
-			     double x, double y,
-			     cairo_bool_t *inside)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_reset_clip (void *abstract_cr)
-{
-    cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    SkRegion rgn(SkIRect::MakeWH (cr->target->bitmap->width (),
-				  cr->target->bitmap->height ()));
-
-    cr->canvas->setClipRegion(rgn);
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_clip_extents (void *abstract_cr,
-				  double *x1, double *y1,
-				  double *x2, double *y2)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_rectangle_list_t *
-_cairo_skia_context_copy_clip_rectangle_list (void *abstract_cr)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-    return NULL;
-}
-
-static cairo_status_t
-_cairo_skia_context_copy_page (void *abstract_cr)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_show_page (void *abstract_cr)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-    UNSUPPORTED;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_set_font_face (void *abstract_cr,
-				   cairo_font_face_t *font_face)
-{
-   // cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    //return _cairo_gstate_set_font_face (cr->gstate, font_face);
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_font_face_t *
-_cairo_skia_context_get_font_face (void *abstract_cr)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-    return NULL;
-}
-
-static cairo_status_t
-_cairo_skia_context_font_extents (void *abstract_cr,
-				  cairo_font_extents_t *extents)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_set_font_size (void *abstract_cr,
-				   double size)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_set_font_matrix (void *abstract_cr,
-				     const cairo_matrix_t *matrix)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static void
-_cairo_skia_context_get_font_matrix (void *abstract_cr,
-				     cairo_matrix_t *matrix)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-}
-
-static cairo_status_t
-_cairo_skia_context_set_font_options (void *abstract_cr,
-				      const cairo_font_options_t *options)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static void
-_cairo_skia_context_get_font_options (void *abstract_cr,
-				      cairo_font_options_t *options)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-}
-
-static cairo_status_t
-_cairo_skia_context_set_scaled_font (void *abstract_cr,
-					cairo_scaled_font_t *scaled_font)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_scaled_font_t *
-_cairo_skia_context_get_scaled_font (void *abstract_cr)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-    return _cairo_scaled_font_create_in_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH);
-}
-
-static cairo_status_t
-_cairo_skia_context_glyphs (void *abstract_cr,
-			    const cairo_glyph_t *glyphs,
-			    int num_glyphs,
-			    cairo_glyph_text_info_t *info)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    /* XXX */
-    //UNSUPPORTED;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_glyph_path (void *abstract_cr,
-				const cairo_glyph_t *glyphs,
-				int num_glyphs)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_status_t
-_cairo_skia_context_glyph_extents (void                *abstract_cr,
-				   const cairo_glyph_t    *glyphs,
-				   int                    num_glyphs,
-				   cairo_text_extents_t   *extents)
-{
-    //cairo_skia_context_t *cr = (cairo_skia_context_t *) abstract_cr;
-
-    UNSUPPORTED;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static const cairo_backend_t _cairo_skia_context_backend = {
-    CAIRO_TYPE_SKIA,
-    _cairo_skia_context_destroy,
-
-    _cairo_skia_context_get_original_target,
-    _cairo_skia_context_get_current_target,
-
-    _cairo_skia_context_save,
-    _cairo_skia_context_restore,
-
-    _cairo_skia_context_push_group,
-    _cairo_skia_context_pop_group,
-
-    _cairo_skia_context_set_source_rgba,
-    _cairo_skia_context_set_source_surface,
-    _cairo_skia_context_set_source,
-    _cairo_skia_context_get_source,
-
-    _cairo_skia_context_set_antialias,
-    _cairo_skia_context_set_dash,
-    _cairo_skia_context_set_fill_rule,
-    _cairo_skia_context_set_line_cap,
-    _cairo_skia_context_set_line_join,
-    _cairo_skia_context_set_line_width,
-    _cairo_skia_context_set_miter_limit,
-    _cairo_skia_context_set_opacity,
-    _cairo_skia_context_set_operator,
-    _cairo_skia_context_set_tolerance,
-    _cairo_skia_context_get_antialias,
-    _cairo_skia_context_get_dash,
-    _cairo_skia_context_get_fill_rule,
-    _cairo_skia_context_get_line_cap,
-    _cairo_skia_context_get_line_join,
-    _cairo_skia_context_get_line_width,
-    _cairo_skia_context_get_miter_limit,
-    _cairo_skia_context_get_opacity,
-    _cairo_skia_context_get_operator,
-    _cairo_skia_context_get_tolerance,
-
-    _cairo_skia_context_translate,
-    _cairo_skia_context_scale,
-    _cairo_skia_context_rotate,
-    _cairo_skia_context_transform,
-    _cairo_skia_context_set_matrix,
-    _cairo_skia_context_set_identity_matrix,
-    _cairo_skia_context_get_matrix,
-    _cairo_skia_context_user_to_device,
-    _cairo_skia_context_user_to_device_distance,
-    _cairo_skia_context_device_to_user,
-    _cairo_skia_context_device_to_user_distance,
-    _cairo_skia_context_user_to_device, /* XXX backend */
-    _cairo_skia_context_user_to_device_distance, /* XXX backend */
-    _cairo_skia_context_device_to_user, /* XXX backend */
-    _cairo_skia_context_device_to_user_distance, /* XXX backend */
-
-    _cairo_skia_context_new_path,
-    _cairo_skia_context_new_sub_path,
-    _cairo_skia_context_move_to,
-    _cairo_skia_context_rel_move_to,
-    _cairo_skia_context_line_to,
-    _cairo_skia_context_rel_line_to,
-    _cairo_skia_context_curve_to,
-    _cairo_skia_context_rel_curve_to,
-    _cairo_skia_context_arc_to,
-    _cairo_skia_context_rel_arc_to,
-    _cairo_skia_context_close_path,
-    _cairo_skia_context_arc,
-    _cairo_skia_context_rectangle,
-    _cairo_skia_context_path_extents,
-    _cairo_skia_context_has_current_point,
-    _cairo_skia_context_get_current_point,
-    _cairo_skia_context_copy_path,
-    _cairo_skia_context_copy_path_flat,
-    _cairo_skia_context_append_path,
-
-    _cairo_skia_stroke_to_path,
-
-    _cairo_skia_context_clip,
-    _cairo_skia_context_clip_preserve,
-    _cairo_skia_context_in_clip,
-    _cairo_skia_context_clip_extents,
-    _cairo_skia_context_reset_clip,
-    _cairo_skia_context_copy_clip_rectangle_list,
-
-    _cairo_skia_context_paint,
-    _cairo_skia_context_paint_with_alpha,
-    _cairo_skia_context_mask,
-
-    _cairo_skia_context_stroke,
-    _cairo_skia_context_stroke_preserve,
-    _cairo_skia_context_in_stroke,
-    _cairo_skia_context_stroke_extents,
-
-    _cairo_skia_context_fill,
-    _cairo_skia_context_fill_preserve,
-    _cairo_skia_context_in_fill,
-    _cairo_skia_context_fill_extents,
-
-    _cairo_skia_context_set_font_face,
-    _cairo_skia_context_get_font_face,
-    _cairo_skia_context_set_font_size,
-    _cairo_skia_context_set_font_matrix,
-    _cairo_skia_context_get_font_matrix,
-    _cairo_skia_context_set_font_options,
-    _cairo_skia_context_get_font_options,
-    _cairo_skia_context_set_scaled_font,
-    _cairo_skia_context_get_scaled_font,
-    _cairo_skia_context_font_extents,
-
-    _cairo_skia_context_glyphs,
-    _cairo_skia_context_glyph_path,
-    _cairo_skia_context_glyph_extents,
-
-    _cairo_skia_context_copy_page,
-    _cairo_skia_context_show_page,
-};
-
-cairo_t *
-_cairo_skia_context_create (void *target)
-{
-    cairo_skia_surface_t *surface = (cairo_skia_surface_t *) target;
-    cairo_skia_context_t *cr;
-
-    cr = (cairo_skia_context_t *) _freed_pool_get (&context_pool);
-    if (unlikely (cr == NULL)) {
-	    cr = new cairo_skia_context_t;
-	    if (unlikely (cr == NULL))
-		return _cairo_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
-
-	    cr->path = new SkPath;
-	    cr->paint = new SkPaint;
-    }
-
-    _cairo_init (&cr->base, &_cairo_skia_context_backend);
-
-    cr->source = NULL;
-    cr->source_image = NULL;
-
-    cr->paint->setStrokeWidth (SkFloatToScalar (2.0));
-
-    cr->target = (cairo_skia_surface_t *) cairo_surface_reference ((cairo_surface_t *) target);
-    cr->original = (cairo_skia_surface_t *) cairo_surface_reference ((cairo_surface_t *) target);
-    cr->canvas = new SkCanvas (*surface->bitmap);
-    cr->canvas->save ();
-
-    cairo_matrix_init_identity (&cr->matrix);
-
-    return &cr->base;
-}
-
-#if 0
-void
-_cairo_skia_context_set_SkPaint (cairo_t *cr, SkPaint paint)
-{
-    *cr->paint = paint;
-}
-
-void
-_cairo_skia_context_set_SkPath (cairo_t *cr, SkPath path)
-{
-    *cr->path = path;
-}
-#endif
diff --git a/src/skia/cairo-skia-private.h b/src/skia/cairo-skia-private.h
deleted file mode 100644
index f538b486b..000000000
--- a/src/skia/cairo-skia-private.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/* cairo - a vector graphics library with display and print output
- *
- * Copyright © 2005 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it either under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation
- * (the "LGPL") or, at your option, under the terms of the Mozilla
- * Public License Version 1.1 (the "MPL"). If you do not alter this
- * notice, a recipient may use your version of this file under either
- * the MPL or the LGPL.
- *
- * You should have received a copy of the LGPL along with this library
- * in the file COPYING-LGPL-2.1; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * You should have received a copy of the MPL along with this library
- * in the file COPYING-MPL-1.1
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.1 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
- * OF ANY KIND, either express or implied. See the LGPL or the MPL for
- * the specific language governing rights and limitations.
- *
- * The Original Code is the cairo graphics library.
- *
- * The Initial Developer of the Original Code is Red Hat, Inc.
- *
- * Contributor(s):
- *	Carl D. Worth <cworth at redhat.com>
- */
-
-#ifndef CAIRO_SKIA_CONTEXT_PRIVATE_H
-#define CAIRO_SKIA_CONTEXT_PRIVATE_H
-
-#include "cairo-private.h"
-#include "cairo-image-surface-private.h"
-
-#include <SkBitmap.h>
-#include <SkCanvas.h>
-#include <SkPaint.h>
-#include <SkPath.h>
-
-/**
- * cairo_skia_context_t:
- *
- * A #cairo_skia_context_t includes handles to Skia's canvas,
- * paint, and path objects along with the Cairo source surfaces
- * and matrix, and the original and target #cairo_skia_surface_t
- * objects.
- *
- * Since: 1.10
- **/
-typedef struct _cairo_skia_context cairo_skia_context_t;
-
-/**
- * cairo_skia_surface_t:
- *
- * A #cairo_skia_surface_t is a container for the underlying
- * #SkBitmap and the corresponding Cairo image surface.
- *
- * Since: 1.10
- **/
-typedef struct _cairo_skia_surface cairo_skia_surface_t;
-
-struct _cairo_skia_context {
-    cairo_t base;
-
-    cairo_skia_surface_t *original;
-    cairo_skia_surface_t *target;
-
-    cairo_matrix_t matrix;
-
-    SkCanvas *canvas;
-    SkPaint *paint;
-    SkPath *path;
-
-    cairo_surface_t *source;
-    cairo_image_surface_t *source_image;
-    void *source_extra;
-};
-
-struct _cairo_skia_surface {
-    cairo_image_surface_t image;
-
-    SkBitmap *bitmap;
-};
-
-static inline bool
-format_to_sk_config (cairo_format_t format,
-		     SkBitmap::Config& config,
-		     bool& opaque)
-{
-    opaque = false;
-
-    switch (format) {
-    case CAIRO_FORMAT_ARGB32:
-	config = SkBitmap::kARGB_8888_Config;
-	break;
-    case CAIRO_FORMAT_RGB24:
-	config = SkBitmap::kARGB_8888_Config;
-	opaque = true;
-	break;
-    case CAIRO_FORMAT_RGB16_565:
-	config = SkBitmap::kRGB_565_Config;
-	opaque = true;
-	break;
-    case CAIRO_FORMAT_A8:
-	config = SkBitmap::kA8_Config;
-	break;
-    case CAIRO_FORMAT_RGB30:
-    case CAIRO_FORMAT_INVALID:
-    case CAIRO_FORMAT_A1:
-    default:
-	return false;
-    }
-
-    return true;
-}
-
-cairo_private cairo_t *
-_cairo_skia_context_create (void *target);
-
-#endif /* CAIRO_SKIA_CONTEXT_PRIVATE_H */
diff --git a/src/skia/cairo-skia-surface.cpp b/src/skia/cairo-skia-surface.cpp
deleted file mode 100644
index a9b6086dd..000000000
--- a/src/skia/cairo-skia-surface.cpp
+++ /dev/null
@@ -1,323 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: t; tab-width: 8; -*- */
-/* cairo - a vector graphics library with display and print output
- *
- * Copyright © 2007 Mozilla Corporation
- *
- * This library is free software; you can redistribute it and/or
- * modify it either under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation
- * (the "LGPL") or, at your option, under the terms of the Mozilla
- * Public License Version 1.1 (the "MPL"). If you do not alter this
- * notice, a recipient may use your version of this file under either
- * the MPL or the LGPL.
- *
- * You should have received a copy of the LGPL along with this library
- * in the file COPYING-LGPL-2.1; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * You should have received a copy of the MPL along with this library
- * in the file COPYING-MPL-1.1
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.1 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
- * OF ANY KIND, either express or implied. See the LGPL or the MPL for
- * the specific language governing rights and limitations.
- *
- * The Original Code is the cairo graphics library.
- *
- * The Initial Developer of the Original Code is Mozilla Corporation.
- *
- * Contributor(s):
- *	Vladimir Vukicevic <vladimir at mozilla.com>
- */
-
-#include "cairoint.h"
-
-#include "cairo-skia.h"
-#include "cairo-skia-private.h"
-
-#include "cairo-composite-rectangles-private.h"
-#include "cairo-error-private.h"
-#include "cairo-surface-backend-private.h"
-#include "cairo-surface-fallback-private.h"
-
-static cairo_skia_surface_t *
-_cairo_skia_surface_create_internal (SkBitmap::Config config,
-				     bool opaque,
-				     unsigned char *data,
-				     int width,
-				     int height,
-				     int stride);
-
-static cairo_surface_t *
-_cairo_skia_surface_create_similar (void *asurface,
-				    cairo_content_t content,
-				    int width,
-				    int height)
-{
-    cairo_skia_surface_t *surface = (cairo_skia_surface_t *) asurface;
-    SkBitmap::Config config;
-    bool opaque;
-
-    if (content == surface->image.base.content)
-    {
-	config = surface->bitmap->config ();
-	opaque = surface->bitmap->isOpaque ();
-    }
-    else if (! format_to_sk_config (_cairo_format_from_content (content),
-				    config, opaque))
-    {
-	return NULL;
-    }
-
-    return &_cairo_skia_surface_create_internal (config, opaque,
-						 NULL,
-						 width, height,
-						 0)->image.base;
-}
-
-static cairo_status_t
-_cairo_skia_surface_finish (void *asurface)
-{
-    cairo_skia_surface_t *surface = (cairo_skia_surface_t *) asurface;
-
-    cairo_surface_finish (&surface->image.base);
-    delete surface->bitmap;
-
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static cairo_image_surface_t *
-_cairo_skia_surface_map_to_image (void *asurface,
-				  const cairo_rectangle_int_t *extents)
-{
-    cairo_skia_surface_t *surface = (cairo_skia_surface_t *) asurface;
-
-    surface->bitmap->lockPixels ();
-    return _cairo_image_surface_map_to_image (&surface->image, extents);
-}
-
-static cairo_int_status_t
-_cairo_skia_surface_unmap_image (void *asurface,
-				 cairo_image_surface_t *image)
-{
-    cairo_skia_surface_t *surface = (cairo_skia_surface_t *) asurface;
-    cairo_int_status_t status;
-
-    status = _cairo_image_surface_unmap_image (&surface->image, image);
-    surface->bitmap->unlockPixels ();
-
-    return status;
-}
-
-static cairo_status_t
-_cairo_skia_surface_acquire_source_image (void *asurface,
-					  cairo_image_surface_t **image_out,
-					  void **image_extra)
-{
-    cairo_skia_surface_t *surface = (cairo_skia_surface_t *) asurface;
-
-    surface->bitmap->lockPixels ();
-
-    *image_out = &surface->image;
-    *image_extra = NULL;
-    return CAIRO_STATUS_SUCCESS;
-}
-
-static void
-_cairo_skia_surface_release_source_image (void *asurface,
-					  cairo_image_surface_t *image,
-					  void *image_extra)
-{
-    cairo_skia_surface_t *surface = (cairo_skia_surface_t *) asurface;
-
-    surface->bitmap->unlockPixels ();
-}
-
-static cairo_bool_t
-_cairo_skia_surface_get_extents (void *asurface,
-				  cairo_rectangle_int_t *extents)
-{
-    cairo_skia_surface_t *surface = (cairo_skia_surface_t *) asurface;
-    extents->x = extents->y = 0;
-    extents->width  = surface->image.width;
-    extents->height = surface->image.height;
-    return TRUE;
-}
-
-static void
-_cairo_skia_surface_get_font_options (void                  *abstract_surface,
-				       cairo_font_options_t  *options)
-{
-    _cairo_font_options_init_default (options);
-
-    cairo_font_options_set_hint_metrics (options, CAIRO_HINT_METRICS_ON);
-    _cairo_font_options_set_round_glyph_positions (options, CAIRO_ROUND_GLYPH_POS_ON);
-}
-
-static const struct _cairo_surface_backend
-cairo_skia_surface_backend = {
-    CAIRO_SURFACE_TYPE_SKIA,
-    _cairo_skia_surface_finish,
-
-    _cairo_skia_context_create,
-
-    _cairo_skia_surface_create_similar,
-    NULL, //_cairo_skia_surface_create_similar_image,
-    _cairo_skia_surface_map_to_image,
-    _cairo_skia_surface_unmap_image,
-
-    _cairo_surface_default_source,
-    _cairo_skia_surface_acquire_source_image,
-    _cairo_skia_surface_release_source_image,
-    NULL, /* snapshot */
-
-    NULL, /* copy_page */
-    NULL, /* show_page */
-
-    _cairo_skia_surface_get_extents,
-    _cairo_skia_surface_get_font_options,
-
-    NULL, /* flush */
-    NULL, /* mark_dirty_rectangle */
-
-    /* XXX native surface functions? */
-    _cairo_surface_fallback_paint,
-    _cairo_surface_fallback_mask,
-    _cairo_surface_fallback_stroke,
-    _cairo_surface_fallback_fill,
-    NULL, /* fill/stroke */
-    _cairo_surface_fallback_glyphs
-};
-
-/*
- * Surface constructors
- */
-
-static inline pixman_format_code_t
-sk_config_to_pixman_format_code (SkBitmap::Config config,
-				 bool opaque)
-{
-    switch (config) {
-    case SkBitmap::kARGB_8888_Config:
-	return opaque ? PIXMAN_x8r8g8b8 : PIXMAN_a8r8g8b8;
-
-    case SkBitmap::kA8_Config:
-	return PIXMAN_a8;
-    case SkBitmap::kRGB_565_Config:
-	return PIXMAN_r5g6b5;
-    case SkBitmap::kARGB_4444_Config:
-	return PIXMAN_a4r4g4b4;
-
-    case SkBitmap::kNo_Config:
-    case SkBitmap::kIndex8_Config:
-    default:
-	ASSERT_NOT_REACHED;
-	return (pixman_format_code_t) -1;
-    }
-}
-
-static cairo_skia_surface_t *
-_cairo_skia_surface_create_internal (SkBitmap::Config config,
-				     bool opaque,
-				     unsigned char *data,
-				     int width,
-				     int height,
-				     int stride)
-{
-    cairo_skia_surface_t *surface;
-    pixman_image_t *pixman_image;
-    pixman_format_code_t pixman_format;
-    SkColorType colorType;
-
-    surface = (cairo_skia_surface_t *) _cairo_malloc (sizeof (cairo_skia_surface_t));
-    if (unlikely (surface == NULL))
-	return (cairo_skia_surface_t *) _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
-
-    pixman_format = sk_config_to_pixman_format_code (config, opaque);
-    pixman_image = pixman_image_create_bits (pixman_format,
-					     width, height,
-					     (uint32_t *) data, stride);
-    if (unlikely (pixman_image == NULL)) {
-	free (surface);
-	return (cairo_skia_surface_t *) _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
-    }
-
-    _cairo_surface_init (&surface->image.base,
-			 &cairo_skia_surface_backend,
-			 NULL, /* device */
-			 _cairo_content_from_pixman_format (pixman_format));
-
-    _cairo_image_surface_init (&surface->image, pixman_image, pixman_format);
-
-    surface->bitmap = new SkBitmap;
-    colorType = SkBitmapConfigToColorType(config);
-    surface->bitmap->setAlphaType (opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType);
-    surface->bitmap->setInfo (SkImageInfo::Make(width, height, colorType, kPremul_SkAlphaType), surface->image.stride);
-    surface->bitmap->setPixels (surface->image.data);
-
-    surface->image.base.is_clear = data == NULL;
-
-    return surface;
-}
-
-cairo_surface_t *
-cairo_skia_surface_create (cairo_format_t format,
-			   int width,
-			   int height)
-{
-    SkBitmap::Config config;
-    bool opaque;
-
-    if (! CAIRO_FORMAT_VALID (format) ||
-	! format_to_sk_config (format, config, opaque))
-    {
-	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT));
-    }
-
-    return &_cairo_skia_surface_create_internal (config, opaque, NULL, width, height, 0)->image.base;
-}
-
-cairo_surface_t *
-cairo_skia_surface_create_for_data (unsigned char *data,
-				    cairo_format_t format,
-				    int width,
-				    int height,
-				    int stride)
-{
-    SkBitmap::Config config;
-    bool opaque;
-
-    if (! CAIRO_FORMAT_VALID (format) ||
-	! format_to_sk_config (format, config, opaque))
-    {
-	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT));
-    }
-
-    return &_cairo_skia_surface_create_internal (config, opaque, data, width, height, stride)->image.base;
-}
-
-/***
-
-Todo:
-
-*** Skia:
-
-- mask()
-
-*** Sk:
-
-High:
-- antialiased clipping?
-
-Medium:
-- implement clip path reset (to avoid restore/save)
-- implement complex radial patterns (2 centers and 2 radii)
-
-Low:
-- implement EXTEND_NONE
-
-***/
commit f246a2144fd0de71b7f4fe7e8ad57285965d43b8
Author: Paul Menzel <pmenzel+cairo at molgen.mpg.de>
Date:   Tue Oct 16 13:46:52 2018 +0200

    Use HTTPS URLs for gnome.org domains
    
    Run the command below suggested by geirha in ##sed at irc.freenode.net.
    
        git grep -l 'http://.*gnome.org' | xargs sed -i 's|http\(://\([[:alnum:].-]*\.\)\{0,1\}gnome\.org\)|https\1|g'
    
    Signed-off-by: Paul Menzel <pmenzel at molgen.mpg.de>

diff --git a/NEWS b/NEWS
index 544e30d3e..256ed696e 100644
--- a/NEWS
+++ b/NEWS
@@ -4247,7 +4247,7 @@ bugs had perhaps never been hit by any users. But at least one was
 hit by the gnome-about program which resulted in dozens of duplicated
 bug reports against that program:
 
-	http://bugzilla.gnome.org/show_bug.cgi?id=431990
+	https://bugzilla.gnome.org/show_bug.cgi?id=431990
 
 We were very pleasantly surprised to see this bug get fixed as a
 side-effect of Chris's work. Well done, Chris!
@@ -5859,7 +5859,7 @@ fix:	https://gitweb.freedesktop.org/?p=cairo;a=commit;h=a0989f427be87c60415963dd
 
 PDF: Fix broken output on amd64 (Adrian Johnson)
 ------------------------------------------------
-report:	http://bugzilla.gnome.org/show_bug.cgi?id=349826
+report:	https://bugzilla.gnome.org/show_bug.cgi?id=349826
 fix:	https://gitweb.freedesktop.org/?p=cairo;a=commit;h=f4b12e497b7ac282b2f6831b8fb68deebc412e60
 
 PS: Fix broken output for truetype fonts > 64k (Adrian Johnson)
@@ -5940,7 +5940,7 @@ And at least the following bugs have been fixed:
  * PS/PDF: Fix broken placement for vertical glyphs
  * PS: Fix to not draw BUTT-capped zero-length dash segments
  * Do device offset before float->fixed conversion
-   http://bugzilla.gnome.org/show_bug.cgi?id=332266
+   https://bugzilla.gnome.org/show_bug.cgi?id=332266
  * PS: Fix source surfaces with transformations
  * PS: Fix to not draw BUTT-capped degnerate sub-paths
  * PS: Don't walk off end of array when printing "~>"
diff --git a/configure.ac b/configure.ac
index 5f06d58a0..f1487271a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -760,7 +760,7 @@ dnl Build gobject integration library
 CAIRO_ENABLE_FUNCTIONS(gobject, gobject, auto, [
   gobject_REQUIRES="gobject-2.0 glib-2.0 >= 2.14"
   PKG_CHECK_MODULES(GOBJECT, $gobject_REQUIRES, ,
-    [use_gobject="no (requires $gobject_REQUIRES http://download.gnome.org/pub/GNOME/sources/glib/)"])
+    [use_gobject="no (requires $gobject_REQUIRES https://download.gnome.org/pub/GNOME/sources/glib/)"])
   gobject_NONPKGCONFIG_EXTRA_LIBS="-L\${libdir} -lcairo-gobject"
 ])
 dnl I'm too lazy to fix the caching properly
diff --git a/src/cairo-output-stream.c b/src/cairo-output-stream.c
index 72b81526c..935fa44c3 100644
--- a/src/cairo-output-stream.c
+++ b/src/cairo-output-stream.c
@@ -293,7 +293,7 @@ _cairo_output_stream_write_hex_string (cairo_output_stream_t *stream,
 
 /* Format a double in a locale independent way and trim trailing
  * zeros.  Based on code from Alex Larson <alexl at redhat.com>.
- * http://mail.gnome.org/archives/gtk-devel-list/2001-October/msg00087.html
+ * https://mail.gnome.org/archives/gtk-devel-list/2001-October/msg00087.html
  *
  * The code in the patch is copyright Red Hat, Inc under the LGPL, but
  * has been relicensed under the LGPL/MPL dual license for inclusion
diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index 87b2df46e..1fe130bba 100644
--- a/util/cairo-trace/trace.c
+++ b/util/cairo-trace/trace.c
@@ -521,7 +521,7 @@ _fini_trace (void)
 
 /* Format a double in a locale independent way and trim trailing
  * zeros.  Based on code from Alex Larson <alexl at redhat.com>.
- * http://mail.gnome.org/archives/gtk-devel-list/2001-October/msg00087.html
+ * https://mail.gnome.org/archives/gtk-devel-list/2001-October/msg00087.html
  *
  * The code in the patch is copyright Red Hat, Inc under the LGPL.
  */
commit 1c9201721d4c3ad667214cb2032e038e57395feb
Author: Paul Menzel <pmenzel+cairo at molgen.mpg.de>
Date:   Tue Oct 16 12:21:06 2018 +0200

    Use HTTPS URLs for freedesktop.org domains
    
    Run the command below suggested by geirha in ##sed at irc.freenode.net.
    
        git grep -l 'http://.*freedesktop.org' | xargs sed -i 's|http\(://\([[:alnum:].-]*\.\)\{0,1\}freedesktop\.org\)|https\1|g'
    
    Signed-off-by: Paul Menzel <pmenzel at molgen.mpg.de>

diff --git a/BUGS b/BUGS
index 806353a4d..452d52300 100644
--- a/BUGS
+++ b/BUGS
@@ -12,7 +12,7 @@ which you prefer:
    up on previous bug reports, and search for existing, known
    bugs. Just use the "cairo" product:
 
-	http://bugs.freedesktop.org
+	https://bugs.freedesktop.org
 
    It is necessary to go through a quick account creation process,
    (with email address verification), in order to be able to report
@@ -49,7 +49,7 @@ in getting the bug fixed sooner):
 
 1) Check to see if the bug has been reported already. It's pretty easy
    to run a search or two against the cairo product in the
-   http://bugs.freedesktop.org bugzilla database. Another place to
+   https://bugs.freedesktop.org bugzilla database. Another place to
    look for known bugs is the cairo ROADMAP:
 
 	https://cairographics.org/ROADMAP
diff --git a/HACKING b/HACKING
index d2b816c63..bc97f5324 100644
--- a/HACKING
+++ b/HACKING
@@ -48,7 +48,7 @@ Bug Tracking System
 
 We use a standard bugzilla bug tracking system available at:
 
-	http://bugs.freedesktop.org/
+	https://bugs.freedesktop.org/
 
 See file named BUGS for detailed information on reporting bugs.  In short,
 for straight bug reports, it's best to report them there such that they
@@ -75,7 +75,7 @@ We use /git/ for version control.  See:
 
 For more information on using git, see:
 
-	http://freedesktop.org/wiki/Infrastructure/git/
+	https://freedesktop.org/wiki/Infrastructure/git/
 
 
 Build System
diff --git a/NEWS b/NEWS
index a2de60745..544e30d3e 100644
--- a/NEWS
+++ b/NEWS
@@ -2129,14 +2129,14 @@ A few FreeType font handling bugs were fixed:
    Don't call FT_Done_Face() on faces we did not create
 
    zombie ft_font_face / ft_unscaled_font mutual referencing problems
-   http://bugs.freedesktop.org/show_bug.cgi?id=21706
+   https://bugs.freedesktop.org/show_bug.cgi?id=21706
 
 Ensure win32 font backend sets the return value to -1 (indicating the absent
 glyph) if the font index lookup for the unicode character fails. And
 similarly fix a bug where a fatal error was raised for an invalid glyph.
 
    cairo_scaled_font_glyph_extents breaks with invalid glyph id
-   http://bugs.freedesktop.org/show_bug.cgi?id=20255
+   https://bugs.freedesktop.org/show_bug.cgi?id=20255
 
 Various improvements to the documentation, reported by Truc Troung:
 
@@ -2166,7 +2166,7 @@ Build fixes
 Fix build of DirectFB backend with debugging enabled:
 
    Bug in _cairo_directfb_surface_release_source_image function
-   http://bugs.freedesktop.org/show_bug.cgi?id=18322
+   https://bugs.freedesktop.org/show_bug.cgi?id=18322
 
 Fix build on OS/2.
 
@@ -2184,7 +2184,7 @@ Invalid referencing of patterns in the Quartz backend:
 
    Failed assertion `CAIRO_REFERENCE_COUNT_HAS_REFERENCE
    (&pattern->ref_count)' when using cairo quartz backend
-   http://bugs.freedesktop.org/show_bug.cgi?id=18632
+   https://bugs.freedesktop.org/show_bug.cgi?id=18632
 
 Invalid references to glyphs after early culling, causing segmentation faults
 in the PDF backend:
@@ -2232,7 +2232,7 @@ Fix display of user fonts as exercised by proposed support for type3
 fonts in poppler (unsigned promotion fixes):
 
     Use cairo user-font for Type 3 fonts
-    http://lists.freedesktop.org/archives/poppler/2008-October/004181.html
+    https://lists.freedesktop.org/archives/poppler/2008-October/004181.html
 
 Avoid miscomputing size of fallback images required when rendering
 with CLEAR, IN, or SOURCE operator to vector surfaces, (PS, PDF, SVG,
@@ -2311,10 +2311,10 @@ extents of transformed, filtered surfaces (Owen Taylor, Carl Worth,
 and Chris Wilson):
 
 	Bad clipping with EXTEND_NONE
-	http://bugs.freedesktop.org/show_bug.cgi?id=15349
+	https://bugs.freedesktop.org/show_bug.cgi?id=15349
 
 	Improve filtering handling in cairo-pattern.c
-	http://bugs.freedesktop.org/show_bug.cgi?id=15367
+	https://bugs.freedesktop.org/show_bug.cgi?id=15367
 
 	Many thanks to Chris Wilson for digging out and cleaning up
 	these fixes.
@@ -2542,7 +2542,7 @@ xlib: Faster bookkeeping (Karl Tomlinson)
 PS: Fix gradients with non-constant alpha (Chris Wilson)
 
 Fix deadlock in user-font code (Richard Hughes and Behdad Esfahbod)
-	http://bugs.freedesktop.org/show_bug.cgi?id=16819
+	https://bugs.freedesktop.org/show_bug.cgi?id=16819
 
 Countless other bugs have been fixed and optimizations made, many of
 them thanks to Chris Wilson. Thanks Chris and others!
@@ -2624,7 +2624,7 @@ xlib: Faster bookkeeping (Karl Tomlinson)
 PS: Fix gradients with non-constant alpha (Chris Wilson)
 
 Fix deadlock in user-font code (Richard Hughes and Behdad Esfahbod)
-	http://bugs.freedesktop.org/show_bug.cgi?id=16819
+	https://bugs.freedesktop.org/show_bug.cgi?id=16819
 
 Several other minor fixes.
 
@@ -2885,10 +2885,10 @@ This fix has been tested to resolve the bugs posted here, (for both
 Xerox and Dell printers):
 
 	Printing some PDFs from evince is crashing our Xerox printer
-	http://bugs.freedesktop.org/show_bug.cgi?id=15348
+	https://bugs.freedesktop.org/show_bug.cgi?id=15348
 
 	Cairo-generated postscript blocks Dell 5100cn
-	http://bugs.freedesktop.org/show_bug.cgi?id=15445
+	https://bugs.freedesktop.org/show_bug.cgi?id=15445
 
 Add missing locking in cairo-xlib
 ---------------------------------
@@ -2954,7 +2954,7 @@ to, (and we could use help from users that have access to misbehaving
 printers). This bug is being tracked here:
 
 	Printing some PDFs from evince is crashing our Xerox printer
-	http://bugs.freedesktop.org/show_bug.cgi?id=15348
+	https://bugs.freedesktop.org/show_bug.cgi?id=15348
 
 New support for arbitrary X server visuals (Thanks, Keith and Behdad!)
 ----------------------------------------------------------------------
@@ -3421,7 +3421,7 @@ cairo-svg
 ---------
 Fix stroke of path with a non-solid-color source pattern:
 
-	http://bugs.freedesktop.org/show_bug.cgi?id=14556
+	https://bugs.freedesktop.org/show_bug.cgi?id=14556
 
 cairo-quartz
 ------------
@@ -3432,7 +3432,7 @@ cairo_show_text()/cairo_show_glyphs().
 
 Correctly handle gradients with non-identity transformations:
 
-	Fixes http://bugs.freedesktop.org/show_bug.cgi?id=14248
+	Fixes https://bugs.freedesktop.org/show_bug.cgi?id=14248
 
 Add native implementation of REPEAT and REFLECT extend modes for
 gradients.
@@ -4444,7 +4444,7 @@ PDF:
    Johnson)
 
  • Fix glyph positioning bug when glyphs are not horizontal
-	http://lists.freedesktop.org/archives/cairo/2007-April/010337.html
+	https://lists.freedesktop.org/archives/cairo/2007-April/010337.html
 
 win32:
  • Fix crash when rendering with bitmap fonts (Carl Worth)
@@ -4495,7 +4495,7 @@ Critical fixes
 • Fix a crash due to a LOCK vs. UNLOCK typo (M. Drochner fixing Carl
   Worth's embarrassing typo).
 
-  http://bugs.freedesktop.org/show_bug.cgi?id=10235
+  https://bugs.freedesktop.org/show_bug.cgi?id=10235
 
 • Fix potential buffer overflow, which on some systems with a checking
   variant of snprintf would lead to a crash (Adrian Johnson, Stanislav
@@ -4540,7 +4540,7 @@ Other bug fixes
   PDF output in some viewers. (Adrian Johnson, Adam Goode, and
   MenTaLguY).
 
-  http://lists.freedesktop.org/archives/cairo/2006-November/008551.html
+  https://lists.freedesktop.org/archives/cairo/2006-November/008551.html
 
 • win32: Return correct metrics when hinting is off, and fix font
   descent computation (Behdad Esfahbod).
@@ -5257,7 +5257,7 @@ several improvements. The bug fixes in this snapshot include:
    mentioned here:
 
 	CAIRO_BO_GUARD_BITS and coordinate space?
-	http://lists.freedesktop.org/archives/cairo/2006-December/008743.html
+	https://lists.freedesktop.org/archives/cairo/2006-December/008743.html
 
  * Fix several regressions in new tessellator (M Joonas Pihlaja)
 
@@ -5317,7 +5317,7 @@ performance improvements are as follows:
    His own writeup of the work he did is quite thorough, but more than
    can be quoted here. Please see his post for the interesting details:
 
-   http://lists.freedesktop.org/archives/cairo/2006-November/008483.html
+   https://lists.freedesktop.org/archives/cairo/2006-November/008483.html
 
    (Though note that this snapshot also includes some additional,
    significant improvements that were only sketched out in that
@@ -5701,54 +5701,54 @@ here for such a short time period.
 Rendering fixes
 ---------------
 Fix image surfaces to not be clipped when used as a source (Vladimir Vukicevic)
-http://gitweb.freedesktop.org/?p=cairo;a=commit;h=72e25648c4c4bc82ddd938aa4e05887a293f0d8b
+https://gitweb.freedesktop.org/?p=cairo;a=commit;h=72e25648c4c4bc82ddd938aa4e05887a293f0d8b
 
 Fix a couple of corner cases in dashing degenerate paths (Jeff Muizelaar)
-http://gitweb.freedesktop.org/?p=cairo;a=commit;h=fbb1758ba8384650157b2bbbc93d161b0c2a05f0
+https://gitweb.freedesktop.org/?p=cairo;a=commit;h=fbb1758ba8384650157b2bbbc93d161b0c2a05f0
 
 Fix support for type1 fonts on win32 (Adrian Johnson)
-http://gitweb.freedesktop.org/?p=cairo;a=commit;h=da1019c9138695cb838a54f8b871bbfd0e8996d7
+https://gitweb.freedesktop.org/?p=cairo;a=commit;h=da1019c9138695cb838a54f8b871bbfd0e8996d7
 
 Fix assertion failure when rotating bitmap fonts (Carl Worth)
-http://gitweb.freedesktop.org/?p=cairo;a=commit;h=0bfa6d4f33b8ddb5dc55bbe419c15df4af856ff9
+https://gitweb.freedesktop.org/?p=cairo;a=commit;h=0bfa6d4f33b8ddb5dc55bbe419c15df4af856ff9
 
 Fix assertion failure when calling cairo_text_path with bitmap fonts (Carl Worth)
-http://gitweb.freedesktop.org/?p=cairo;a=commit;h=9878a033531e6b96b5f27e69e10e90dee7440cd9
+https://gitweb.freedesktop.org/?p=cairo;a=commit;h=9878a033531e6b96b5f27e69e10e90dee7440cd9
 
 Fix mis-handling of cairo_close_path in some situations (Tim Rowley, Carl Worth)
-http://gitweb.freedesktop.org/?p=cairo;a=commit;h=53f74e59faf1af78f2f0741ccf1f23aa5dad4efc
+https://gitweb.freedesktop.org/?p=cairo;a=commit;h=53f74e59faf1af78f2f0741ccf1f23aa5dad4efc
 
 Respect font_matrix translation in _cairo_gstate_glyph_path (Behdad Esfahbod)
-http://gitweb.freedesktop.org/?p=cairo;a=commit;h=f183b835b111d23e838889178aa8106ec84663b3
+https://gitweb.freedesktop.org/?p=cairo;a=commit;h=f183b835b111d23e838889178aa8106ec84663b3
 
 Fix vertical metrics adjustment to work with non-identity shapes (Behdad Esfahbod)
-http://gitweb.freedesktop.org/?p=cairo;a=commit;h=b7bc263842a798d657a95e539e1693372448837f
+https://gitweb.freedesktop.org/?p=cairo;a=commit;h=b7bc263842a798d657a95e539e1693372448837f
 
 [PS] Set correct ImageMatrix in _cairo_ps_surface_emit_bitmap_glyph_data (Behdad Esfahbod)
-http://gitweb.freedesktop.org/?p=cairo;a=commit;h=d47388ad759b0a1a0869655a87d9b5eb6ae2445d
+https://gitweb.freedesktop.org/?p=cairo;a=commit;h=d47388ad759b0a1a0869655a87d9b5eb6ae2445d
 
 Build system fixes
 ------------------
 Fix xlib detection to prefer pkg-config to avoid false libXt dependency (Behdad Esfahbod)
-http://gitweb.freedesktop.org/?p=cairo;a=commit;h=0e78e7144353703cbd28aae6a67cd9ca261f1d68
+https://gitweb.freedesktop.org/?p=cairo;a=commit;h=0e78e7144353703cbd28aae6a67cd9ca261f1d68
 
 Fix typos causing win32 build problem with PS,PDF, and SVG backends (Behdad Esfahbod)
-http://gitweb.freedesktop.org/?p=cairo;a=commit;h=aea83b908d020e26732753830bb3056e6702a774
+https://gitweb.freedesktop.org/?p=cairo;a=commit;h=aea83b908d020e26732753830bb3056e6702a774
 
 Fix configure cache to not use stale results (Behdad Esfahbod)
-http://gitweb.freedesktop.org/?p=cairo;a=commit;h=6d0e3260444a2d5b6fb0cb223ac79f1c0e7b3a6e
+https://gitweb.freedesktop.org/?p=cairo;a=commit;h=6d0e3260444a2d5b6fb0cb223ac79f1c0e7b3a6e
 
 Fix to not pass unsupported warning options to the compiler (Jens Granseuer)
-http://gitweb.freedesktop.org/?p=cairo;a=commit;h=97524a8fdb899de1ae4a3e920fb7bda6d76c5571
+https://gitweb.freedesktop.org/?p=cairo;a=commit;h=97524a8fdb899de1ae4a3e920fb7bda6d76c5571
 
 Fix to allow env. variables such as png_REQUIRES to override configure detection (Jens Granseuer)
-http://gitweb.freedesktop.org/?p=cairo;a=commit;h=abd16e47d6331bd3811c908e524b4dcb6bd23bf0
+https://gitweb.freedesktop.org/?p=cairo;a=commit;h=abd16e47d6331bd3811c908e524b4dcb6bd23bf0
 
 Fix test suite to not use an old system cairo when converting svg2png (Behdad Esfahbod)
-http://gitweb.freedesktop.org/?p=cairo;a=commit;h=6122cc85c8f71b1ba2df3ab86907768edebe1781
+https://gitweb.freedesktop.org/?p=cairo;a=commit;h=6122cc85c8f71b1ba2df3ab86907768edebe1781
 
 Fix test suite to not require signal.h to be present (Behdad Esfahbod)
-http://gitweb.freedesktop.org/?p=cairo;a=commit;h=6f8cf53b1e1ccdbe1ab6a275656b19c6e5120e40
+https://gitweb.freedesktop.org/?p=cairo;a=commit;h=6f8cf53b1e1ccdbe1ab6a275656b19c6e5120e40
 
 Code cleanups
 -------------
@@ -5774,7 +5774,7 @@ affected X servers that do not provide the Render extension and that
 provide a visual with BGR rather than RGB channel order.
 
 report:	https://bugs.freedesktop.org/show_bug.cgi?id=7294
-fix:	http://gitweb.freedesktop.org/?p=cairo;a=commit;h=9ae66174e774b57f16ad791452ed44efc2770a59
+fix:	https://gitweb.freedesktop.org/?p=cairo;a=commit;h=9ae66174e774b57f16ad791452ed44efc2770a59
 
 Fix the "disappearing text" bug
 -------------------------------
@@ -5788,7 +5788,7 @@ was also exacerbated by a KDE migration bug that caused antialiasing
 to be disabled more than desired.
 
 report:	https://bugs.freedesktop.org/show_bug.cgi?id=7494
-fix:	http://gitweb.freedesktop.org/?p=cairo;a=commit;h=456cdb3058f3b416109a9600167cd8842300ae14
+fix:	https://gitweb.freedesktop.org/?p=cairo;a=commit;h=456cdb3058f3b416109a9600167cd8842300ae14
 see also:
 Xorg:	https://bugs.freedesktop.org/show_bug.cgi?id=7681
 KDE:	http://qa.mandriva.com/show_bug.cgi?id=23990
@@ -5804,7 +5804,7 @@ than 72.0 would lead to incorrect results, (larger values would lead
 to increasingly shrunken output).
 
 report:	https://bugs.freedesktop.org/show_bug.cgi?id=7533
-fix:	http://gitweb.freedesktop.org/?p=cairo;a=commit;h=1feb4291cf7813494355459bb547eec604c54ffb
+fix:	https://gitweb.freedesktop.org/?p=cairo;a=commit;h=1feb4291cf7813494355459bb547eec604c54ffb
 
 Fix inadvertent semantic change of font matrix translation (Behdad Esfahbod)
 ----------------------------------------------------------------------------
@@ -5818,7 +5818,7 @@ practice, and it was not intentional to introduce a semantic
 change. With 1.2.2 we return to the 1.0 semantics, with a much better
 implementation that provides correct glyph metrics.
 
-fix:	http://gitweb.freedesktop.org/?p=cairo;a=commit;h=84840e6bba6e72aa88fad7a0ee929e8955ba9051
+fix:	https://gitweb.freedesktop.org/?p=cairo;a=commit;h=84840e6bba6e72aa88fad7a0ee929e8955ba9051
 
 Fix create_similar to preserve fallback resolution and font options (Behdad Esfahbod)
 -------------------------------------------------------------------------------------
@@ -5830,8 +5830,8 @@ destination surface would not be preserved to the intermediate
 fallbacks, for example.
 
 report:	https://bugs.freedesktop.org/show_bug.cgi?id=4106
-fixes:	http://gitweb.freedesktop.org/?p=cairo;a=commit;h=9fcb3c32c1f16fe6ab913e27eb54d18b7d9a06b0
-	http://gitweb.freedesktop.org/?p=cairo;a=commit;h=bdb4e1edadb78a2118ff70b28163f8bd4317f1ec
+fixes:	https://gitweb.freedesktop.org/?p=cairo;a=commit;h=9fcb3c32c1f16fe6ab913e27eb54d18b7d9a06b0
+	https://gitweb.freedesktop.org/?p=cairo;a=commit;h=bdb4e1edadb78a2118ff70b28163f8bd4317f1ec
 
 xlib: Fix text performance regression from 1.0 to 1.2.0 (Vladimir Vukicevic)
 ----------------------------------------------------------------------------
@@ -5843,7 +5843,7 @@ to the X server, (such as a remote X server over an ssh
 connection). The slowdown was identified and fixed in 1.2.2.
 
 report:	https://bugs.freedesktop.org/show_bug.cgi?id=7514
-fix:	http://gitweb.freedesktop.org/?p=cairo;a=commit;h=b7191885c88068dad57d68ced69a752d1162b12c
+fix:	https://gitweb.freedesktop.org/?p=cairo;a=commit;h=b7191885c88068dad57d68ced69a752d1162b12c
 
 PDF: Eliminate dependency on FreeType library dependency (Adrian Johnson)
 -------------------------------------------------------------------------
@@ -5855,16 +5855,16 @@ freetype library is not required to use the pdf backend on the win32
 platform.
 
 report:	https://bugs.freedesktop.org/show_bug.cgi?id=7538
-fix:	http://gitweb.freedesktop.org/?p=cairo;a=commit;h=a0989f427be87c60415963dd6822b3c5c3781691
+fix:	https://gitweb.freedesktop.org/?p=cairo;a=commit;h=a0989f427be87c60415963dd6822b3c5c3781691
 
 PDF: Fix broken output on amd64 (Adrian Johnson)
 ------------------------------------------------
 report:	http://bugzilla.gnome.org/show_bug.cgi?id=349826
-fix:	http://gitweb.freedesktop.org/?p=cairo;a=commit;h=f4b12e497b7ac282b2f6831b8fb68deebc412e60
+fix:	https://gitweb.freedesktop.org/?p=cairo;a=commit;h=f4b12e497b7ac282b2f6831b8fb68deebc412e60
 
 PS: Fix broken output for truetype fonts > 64k (Adrian Johnson)
 ---------------------------------------------------------------
-fix:	http://gitweb.freedesktop.org/?p=cairo;a=commit;h=067d97eb1793a6b0d0dddfbd0b54117844511a94
+fix:	https://gitweb.freedesktop.org/?p=cairo;a=commit;h=067d97eb1793a6b0d0dddfbd0b54117844511a94
 
 PDF: Fix so that dashing doesn't get stuck on (Kent Worsnop)
 ------------------------------------------------------------
@@ -5872,26 +5872,26 @@ Kent notices that with the PDF backend in cairo 1.2.0 as soon as a
 stroke was performed with dashing, all subsequent strokes would also
 be dashed. There was no way to turn dashing off again.
 
-fix:	http://gitweb.freedesktop.org/?p=cairo;a=commit;h=778c4730a86296bf0a71080cf7008d7291792256
+fix:	https://gitweb.freedesktop.org/?p=cairo;a=commit;h=778c4730a86296bf0a71080cf7008d7291792256
 
 Fix memory leaks in failure paths in gradient creation (Alfred Peng)
 --------------------------------------------------------------------
-fix:	http://gitweb.freedesktop.org/?p=cairo;a=commit;h=db06681b487873788b51a6766894fc619eb8d8f2
+fix:	https://gitweb.freedesktop.org/?p=cairo;a=commit;h=db06681b487873788b51a6766894fc619eb8d8f2
 
 Fix memory leak in _cairo_surface_show_glyphs (Chris Wilson)
 ------------------------------------------------------------
 report:	https://bugs.freedesktop.org/show_bug.cgi?id=7766
-fix:	http://gitweb.freedesktop.org/?p=cairo;a=commit;h=e2fddcccb43d06486d3680a19cfdd5a54963fcbd
+fix:	https://gitweb.freedesktop.org/?p=cairo;a=commit;h=e2fddcccb43d06486d3680a19cfdd5a54963fcbd
 
 Solaris: Add definition of cairo_private for some Sun compilers (Alfred Peng)
 -----------------------------------------------------------------------------
 report:	https://bugzilla.mozilla.org/show_bug.cgi?id=341874
-fix:	http://gitweb.freedesktop.org/?p=cairo;a=commit;h=04757a3aa8deeff3265719ebe01b021638990ec6
+fix:	https://gitweb.freedesktop.org/?p=cairo;a=commit;h=04757a3aa8deeff3265719ebe01b021638990ec6
 
 Solaris: Change version number of Sun's Xorg server with buggy repeat (Brian Cameron)
 -------------------------------------------------------------------------------------
 report: https://bugs.freedesktop.org/show_bug.cgi?id=7483
-fix:	http://gitweb.freedesktop.org/?p=cairo;a=commit;h=e0ad1aa995bcec4246c0b8ab0d5a5a79871ce235
+fix:	https://gitweb.freedesktop.org/?p=cairo;a=commit;h=e0ad1aa995bcec4246c0b8ab0d5a5a79871ce235
 
 Various memory leak fixes
 -------------------------
diff --git a/README b/README
index 0e73a3967..9cfa34355 100644
--- a/README
+++ b/README
@@ -113,11 +113,11 @@ Supported, "platform" surface backends
 -----------------------------------
 	xlib backend
 	------------
-	X11			http://freedesktop.org/Software/xlibs
+	X11			https://freedesktop.org/Software/xlibs
 
 	xlib-xrender backend
 	--------------------
-	Xrender >= 0.6		http://freedesktop.org/Software/xlibs
+	Xrender >= 0.6		https://freedesktop.org/Software/xlibs
 
 	quartz backend
 	--------------
@@ -129,7 +129,7 @@ Supported, "platform" surface backends
 
 	xcb backend
 	-----------
-	XCB			http://xcb.freedesktop.org
+	XCB			https://xcb.freedesktop.org
 
 Font backends (required to have at least one)
 ---------------------------------------------
diff --git a/build/aclocal.pkg.m4 b/build/aclocal.pkg.m4
index cf90a9678..8b9fda909 100644
--- a/build/aclocal.pkg.m4
+++ b/build/aclocal.pkg.m4
@@ -146,7 +146,7 @@ path to pkg-config.
 
 _PKG_TEXT
 
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
+To get pkg-config, see <https://pkg-config.freedesktop.org/>.])],
 		[$4])
 else
 	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
diff --git a/build/configure.ac.tools b/build/configure.ac.tools
index a24dbcecb..1fd2d3df8 100644
--- a/build/configure.ac.tools
+++ b/build/configure.ac.tools
@@ -12,7 +12,7 @@ dnl ===========================================================================
 
 PKG_PROG_PKG_CONFIG()
 if test "x$PKG_CONFIG" = x; then
-	AC_MSG_ERROR([pkg-config >= $PKGCONFIG_REQUIRED required but not found (http://pkgconfig.freedesktop.org/)])
+	AC_MSG_ERROR([pkg-config >= $PKGCONFIG_REQUIRED required but not found (https://pkgconfig.freedesktop.org/)])
 fi
 
 dnl Check for recent pkg-config which supports Requires.private
diff --git a/configure.ac b/configure.ac
index 5d18327b8..5f06d58a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ AC_PREREQ([2.63])
 CAIRO_PARSE_VERSION
 AC_INIT([cairo],
 	[cairo_version_major.cairo_version_minor.cairo_version_micro],
-	[http://bugs.freedesktop.org/enter_bug.cgi?product=cairo],
+	[https://bugs.freedesktop.org/enter_bug.cgi?product=cairo],
 	[cairo],
 	[https://cairographics.org/])
 AC_CONFIG_AUX_DIR(build)
@@ -143,7 +143,7 @@ CAIRO_ENABLE_SURFACE_BACKEND(xlib_xrender, Xlib Xrender, auto, [
 		       CPPFLAGS="$CPPFLAGS $xlib_CFLAGS $xlib_NONPKGCONFIG_CFLAGS"
 		       AC_CHECK_HEADER(X11/extensions/Xrender.h,
 				       [xlib_xrender_NONPKGCONFIG_LIBS="-lXrender"],
-				       [use_xlib_xrender="no (requires $xlib_xrender_REQUIRES http://freedesktop.org/Software/xlibs)"],
+				       [use_xlib_xrender="no (requires $xlib_xrender_REQUIRES https://freedesktop.org/Software/xlibs)"],
 				       [#include <X11/X.h>])
 		       CPPFLAGS=$old_CPPFLAGS
 		      ])
@@ -164,14 +164,14 @@ dnl ===========================================================================
 CAIRO_ENABLE_SURFACE_BACKEND(xcb, XCB, auto, [
   xcb_REQUIRES="xcb >= 1.6 xcb-render >= 1.6"
   PKG_CHECK_MODULES(xcb, $xcb_REQUIRES, ,
-		    [use_xcb="no (requires $xcb_REQUIRES http://xcb.freedesktop.org)"])
+		    [use_xcb="no (requires $xcb_REQUIRES https://xcb.freedesktop.org)"])
 ])
 
 CAIRO_ENABLE_FUNCTIONS(xlib_xcb, Xlib/XCB, no, [
   if test "x$use_xcb" = "xyes" -a "x$use_xlib" = "xyes"; then
     xlib_xcb_REQUIRES="x11-xcb"
     PKG_CHECK_MODULES(xlib_xcb, $xlib_xcb_REQUIRES, ,
-		      [use_xlib_xcb="no (requires $xlib_xcb_REQUIRES http://xcb.freedesktop.org)"])
+		      [use_xlib_xcb="no (requires $xlib_xcb_REQUIRES https://xcb.freedesktop.org)"])
   else
     use_xlib_xcb="no (requires both --enable-xlib and --enable-xcb)"
   fi
@@ -181,7 +181,7 @@ CAIRO_ENABLE_FUNCTIONS(xcb_shm, XCB/SHM, auto, [
   if test "x$use_xcb" = "xyes"; then
       xcb_shm_REQUIRES="xcb-shm"
       PKG_CHECK_MODULES(xcb_shm, $xcb_shm_REQUIRES, ,
-			[use_xcb_shm="no (requires $xcb_shm http://xcb.freedesktop.org)"])
+			[use_xcb_shm="no (requires $xcb_shm https://xcb.freedesktop.org)"])
   else
     use_xcb_shm="no (requires --enable-xcb)"
   fi
diff --git a/perf/README b/perf/README
index 9e402098a..1b1c19a1f 100644
--- a/perf/README
+++ b/perf/README
@@ -8,7 +8,7 @@ which will give a report of the speed of each individual test. See
 more details on other options for running the suite below.
 
 A macro test suite (with full traces and more intensive benchmarks) is
-also available; for this, see http://cgit.freedesktop.org/cairo-traces.
+also available; for this, see https://cgit.freedesktop.org/cairo-traces.
 The macro-benchmarks are better measures of actual real-world
 performance, and should be preferred over the micro-benchmarks (and over
 make perf) for identifying performance regressions or improvements.  If
diff --git a/src/cairo-clip-tor-scan-converter.c b/src/cairo-clip-tor-scan-converter.c
index 062ba83cf..2ac1d32b1 100644
--- a/src/cairo-clip-tor-scan-converter.c
+++ b/src/cairo-clip-tor-scan-converter.c
@@ -29,7 +29,7 @@
  * The source is from commit 734c53237a867a773640bd5b64816249fa1730f8
  * of
  *
- *   http://gitweb.freedesktop.org/?p=users/joonas/glitter-paths
+ *   https://gitweb.freedesktop.org/?p=users/joonas/glitter-paths
  */
 /* Glitter-paths is a stand alone polygon rasteriser derived from
  * David Turner's reimplementation of Tor Anderssons's 15x17
diff --git a/src/cairo-tor-scan-converter.c b/src/cairo-tor-scan-converter.c
index 28bc2f3fa..e8142d5bc 100644
--- a/src/cairo-tor-scan-converter.c
+++ b/src/cairo-tor-scan-converter.c
@@ -29,7 +29,7 @@
  * The source is from commit 734c53237a867a773640bd5b64816249fa1730f8
  * of
  *
- *   http://gitweb.freedesktop.org/?p=users/joonas/glitter-paths
+ *   https://gitweb.freedesktop.org/?p=users/joonas/glitter-paths
  */
 /* Glitter-paths is a stand alone polygon rasteriser derived from
  * David Turner's reimplementation of Tor Anderssons's 15x17
diff --git a/src/cairo-tor22-scan-converter.c b/src/cairo-tor22-scan-converter.c
index 9904cacff..bf44742b0 100644
--- a/src/cairo-tor22-scan-converter.c
+++ b/src/cairo-tor22-scan-converter.c
@@ -29,7 +29,7 @@
  * The source is from commit 734c53237a867a773640bd5b64816249fa1730f8
  * of
  *
- *   http://gitweb.freedesktop.org/?p=users/joonas/glitter-paths
+ *   https://gitweb.freedesktop.org/?p=users/joonas/glitter-paths
  */
 /* Glitter-paths is a stand alone polygon rasteriser derived from
  * David Turner's reimplementation of Tor Anderssons's 15x17
diff --git a/src/cairo-xlib-private.h b/src/cairo-xlib-private.h
index 0f2f2e1fa..71dccc3a7 100644
--- a/src/cairo-xlib-private.h
+++ b/src/cairo-xlib-private.h
@@ -104,7 +104,7 @@ struct _cairo_xlib_display {
      * We also use this variable as a guard against a second
      * independent bug with transformed repeating pictures:
      *
-     * http://lists.freedesktop.org/archives/cairo/2004-September/001839.html
+     * https://lists.freedesktop.org/archives/cairo/2004-September/001839.html
      *
      * Both are fixed in xorg >= 6.9 and hopefully in > 6.8.2, so
      * we can reuse the test for now.
diff --git a/test/big-trap.c b/test/big-trap.c
index 5e11237a8..a59a38ea3 100644
--- a/test/big-trap.c
+++ b/test/big-trap.c
@@ -31,7 +31,7 @@
  * _cairo_fixed_from_double changed the details of the bogus trapezoid
  * (it overflows in a different way now), so the bug is being masked.
  *
- * According to Vladimir, (http://lists.freedesktop.org/archives/cairo/2006-November/008482.html):
+ * According to Vladimir, (https://lists.freedesktop.org/archives/cairo/2006-November/008482.html):
  *
  *	Before the change, the two trapezoids that were generated were:
  *
diff --git a/test/clip-push-group.c b/test/clip-push-group.c
index 4effb0aba..f63ac731d 100644
--- a/test/clip-push-group.c
+++ b/test/clip-push-group.c
@@ -25,7 +25,7 @@
 
 /* A test for the crash described here:
  *
- *	http://lists.freedesktop.org/archives/cairo/2006-August/007698.html
+ *	https://lists.freedesktop.org/archives/cairo/2006-August/007698.html
  *
  * The triggering condition for this bug should be setting a
  * surface-based clip and then calling cairo_push_group.
diff --git a/test/filter-bilinear-extents.c b/test/filter-bilinear-extents.c
index 79d36f6e6..91ac703db 100644
--- a/test/filter-bilinear-extents.c
+++ b/test/filter-bilinear-extents.c
@@ -34,7 +34,7 @@
  * The original bug was reported by Owen Taylor here:
  *
  *	bad clipping with EXTEND_NONE
- *	http://bugs.freedesktop.org/show_bug.cgi?id=15349
+ *	https://bugs.freedesktop.org/show_bug.cgi?id=15349
  */
 
 #define SCALE	10
diff --git a/test/get-path-extents.c b/test/get-path-extents.c
index f6a7d03f8..080fc34c4 100644
--- a/test/get-path-extents.c
+++ b/test/get-path-extents.c
@@ -220,7 +220,7 @@ draw (cairo_t *cr, int width, int height)
 
     cairo_restore (cr2);
 
-    /* http://bugs.freedesktop.org/show_bug.cgi?id=7965 */
+    /* https://bugs.freedesktop.org/show_bug.cgi?id=7965 */
     phase = "A horizontal, open path";
     cairo_save (cr2);
     cairo_set_line_cap (cr2, CAIRO_LINE_CAP_ROUND);
@@ -337,7 +337,7 @@ draw (cairo_t *cr, int width, int height)
 
     cairo_restore (cr2);
 
-    /* http://bugs.freedesktop.org/show_bug.cgi?id=7245 */
+    /* https://bugs.freedesktop.org/show_bug.cgi?id=7245 */
     phase = "Arc";
     cairo_save (cr2);
     cairo_arc (cr2, 250.0, 250.0, 157.0, 5.147, 3.432);
diff --git a/test/leaky-dashed-rectangle.c b/test/leaky-dashed-rectangle.c
index e4ba3e8b7..fad859a9f 100644
--- a/test/leaky-dashed-rectangle.c
+++ b/test/leaky-dashed-rectangle.c
@@ -27,7 +27,7 @@
 /* Test case for bug reported by Franz Schmid <Franz.Schmid at altmuehlnet.de>
  * https://lists.cairographics.org/archives/cairo/2008-April/013912.html
  *
- * See also: http://bugs.freedesktop.org/show_bug.cgi?id=17177
+ * See also: https://bugs.freedesktop.org/show_bug.cgi?id=17177
  */
 
 #include "cairo-test.h"
diff --git a/test/path-stroke-twice.c b/test/path-stroke-twice.c
index 10bbbf8b0..876352b0f 100644
--- a/test/path-stroke-twice.c
+++ b/test/path-stroke-twice.c
@@ -26,7 +26,7 @@
 #include "cairo-test.h"
 
 /* Exercises a bug found by alois at astro.ch:
- *   http://bugs.freedesktop.org/show_bug.cgi?id=26010
+ *   https://bugs.freedesktop.org/show_bug.cgi?id=26010
  *   cairo_line_to optimizes away path segment
  */
 
diff --git a/util/cairo.modules b/util/cairo.modules
index 71a3922fd..c099a037e 100644
--- a/util/cairo.modules
+++ b/util/cairo.modules
@@ -2,7 +2,7 @@
 <!DOCTYPE moduleset SYSTEM "moduleset.dtd">
 <?xml-stylesheet type="text/xsl" href="moduleset.xsl"?>
 <moduleset>
-  <include href="http://cgit.freedesktop.org/xorg/util/modular/plain/xorg.modules" />
+  <include href="https://cgit.freedesktop.org/xorg/util/modular/plain/xorg.modules" />
 
   <repository type="git" name="git.freedesktop.org" href="git://anongit.freedesktop.org/git/"/>
 
commit 15ad6ca3e1ae2f34da4de1c81ac085031e1de8d1
Author: Paul Menzel <pmenzel+cairo at molgen.mpg.de>
Date:   Tue Oct 16 12:02:48 2018 +0200

    Use HTTPS URLs for cairographics.org domains
    
    Run the command below suggested by geirha in ##sed at irc.freenode.net.
    
        git grep -l 'http://.*cairographics.org' | xargs sed -i 's|http\(://\([[:alnum:].-]*\.\)\{0,1\}cairographics\.org\)|https\1|g'
    
    Signed-off-by: Paul Menzel <pmenzel at molgen.mpg.de>

diff --git a/BUGS b/BUGS
index ef044046d..806353a4d 100644
--- a/BUGS
+++ b/BUGS
@@ -26,7 +26,7 @@ which you prefer:
    mailing list only allows posting from subscribers, so use the
    following page for subscription instructions:
 
-	http://cairographics.org/lists
+	https://cairographics.org/lists
 
    Again, we apologize for any inconvenience this subscription step
    might cause, but we've found it necessary to require this in order
@@ -52,7 +52,7 @@ in getting the bug fixed sooner):
    http://bugs.freedesktop.org bugzilla database. Another place to
    look for known bugs is the cairo ROADMAP:
 
-	http://cairographics.org/ROADMAP
+	https://cairographics.org/ROADMAP
 
    which shows a planned schedule of releases and which bug fixes are
    being planned for each release.
diff --git a/HACKING b/HACKING
index aba2c545b..d2b816c63 100644
--- a/HACKING
+++ b/HACKING
@@ -24,7 +24,7 @@ Contact
 Various ways to get in touch with other cairo developers and maintainers
 have been enumerated at:
 
-	http://cairographics.org/contact/
+	https://cairographics.org/contact/
 
 Most of that information is also reflected in the following sections.
 
@@ -35,7 +35,7 @@ Mailing Lists
 There are various mailing lists that are useful when developing cairo
 code.  A complete list is always available at:
 
-	http://cairographics.org/lists/
+	https://cairographics.org/lists/
 
 It is recommended that cairo developers subscribe to all those lists.
 The cairo list by itself generates much more traffic than the others
@@ -71,7 +71,7 @@ Version Control System
 
 We use /git/ for version control.  See:
 
-	http://cairographics.org/download/
+	https://cairographics.org/download/
 
 For more information on using git, see:
 
@@ -165,7 +165,7 @@ See doc/public/README for more information.
 For more documentation including frequently asked questions, tutorials,
 samples, roadmap, todo list, etc visit:
 
-	http://cairographics.org/documentation/
+	https://cairographics.org/documentation/
 
 Some of those should gradually be moved to doc/.
 
diff --git a/INSTALL b/INSTALL
index 9db68dee2..f25f8f34d 100644
--- a/INSTALL
+++ b/INSTALL
@@ -140,11 +140,11 @@ itself), then you're in the right place and should read on.
 However, if you don't need such a bleeding-edge version of cairo, then
 you might prefer to start by building the latest stable cairo release:
 
-	http://cairographics.org/releases
+	https://cairographics.org/releases
 
 or perhaps the latest (unstable) development snapshot:
 
-	http://cairographics.org/snapshots
+	https://cairographics.org/snapshots
 
 There you'll find nicely packaged tar files that include a configure
 script so you can go back the the simpler instructions above.
diff --git a/NEWS b/NEWS
index 3f20314b2..a2de60745 100644
--- a/NEWS
+++ b/NEWS
@@ -18,7 +18,7 @@ legitimate problems found and fixed.
 
 For a complete log of changes, please see
 
-    http://cairographics.org/releases/ChangeLog.1.15.12
+    https://cairographics.org/releases/ChangeLog.1.15.12
 
 Features and Enhancements
 -------------------------
@@ -68,7 +68,7 @@ a need of this backend.
 
 For a complete log of changes, please see
 
-    http://cairographics.org/releases/ChangeLog.1.15.12
+    https://cairographics.org/releases/ChangeLog.1.15.12
 
 Features and Enhancements
 -------------------------
@@ -111,7 +111,7 @@ test failures and related issues in the PDF and Postscript backends.
 
 For a complete log of changes, please see
 
-    http://cairographics.org/releases/ChangeLog.1.15.10
+    https://cairographics.org/releases/ChangeLog.1.15.10
 
 Features and Enhancements
 -------------------------
@@ -182,7 +182,7 @@ handful of minor fixes.
 
 For a complete log of changes, please see
 
-    http://cairographics.org/releases/ChangeLog.1.15.8
+    https://cairographics.org/releases/ChangeLog.1.15.8
 
 Features and Enhancements
 -------------------------
@@ -232,7 +232,7 @@ the release.
 
 For a complete log of changes, please see
 
-    http://cairographics.org/releases/ChangeLog.1.15.6
+    https://cairographics.org/releases/ChangeLog.1.15.6
 
 
 Features and Enhancements
@@ -293,7 +293,7 @@ by him and other contributors.
 
 For a complete log of changes since the last release, please see:
 
-    http://cairographics.org/releases/ChangeLog.1.15.4
+    https://cairographics.org/releases/ChangeLog.1.15.4
 
 Features
 --------
@@ -417,7 +417,7 @@ requested new API for Win32 surfaces.
 
 For a complete log of changes since the last release, please see:
 
-    http://cairographics.org/releases/ChangeLog.1.15.2
+    https://cairographics.org/releases/ChangeLog.1.15.2
 
 Features
 --------
@@ -475,7 +475,7 @@ Simple bugfix release to fix one Windows issue.
 
 For a complete log of changes since 1.14.4, please see:
 
-    http://cairographics.org/releases/ChangeLog.1.14.6
+    https://cairographics.org/releases/ChangeLog.1.14.6
 
 Features
 --------
@@ -511,7 +511,7 @@ updates to documentation, etc.
 
 For a complete log of changes since 1.14.2, please see:
  
-    http://cairographics.org/releases/ChangeLog.cairo-1.14.4
+    https://cairographics.org/releases/ChangeLog.cairo-1.14.4
 
 Features
 --------
@@ -2189,7 +2189,7 @@ Invalid referencing of patterns in the Quartz backend:
 Invalid references to glyphs after early culling, causing segmentation faults
 in the PDF backend:
 
-   http://lists.cairographics.org/archives/cairo/2008-December/015976.html
+   https://lists.cairographics.org/archives/cairo/2008-December/015976.html
 
 Check for XRender in the XCB backend, or else we may attempt an invalid memory
 access:
@@ -2241,7 +2241,7 @@ etc.).
 Be more tolerant of broken fonts when subsetting type1 fonts:
 
    Error handling in cairo_type1_font_subset_get_glyph_names_and_widths
-   http://lists.cairographics.org/archives/cairo/2008-October/015569.html
+   https://lists.cairographics.org/archives/cairo/2008-October/015569.html
 
 Fix cairo_fill_extents, cairo_stroke_extents, cairo_path_extents, to
 correctly allow NULL parameters as documented.
@@ -2916,7 +2916,7 @@ New dependency on external pixman library (Thanks, Søren!)
 As of cairo 1.6, cairo now depends on the pixman library, for which
 the latest release can be obtained alongside cairo:
 
-	http://cairographics.org/releases/pixman-0.10.0.tar.gz
+	https://cairographics.org/releases/pixman-0.10.0.tar.gz
 
 This library provides all software rendering for cairo, (the
 implementation of the image backend as well as any image fallbacks
@@ -3022,7 +3022,7 @@ Rendering with CAIRO_ANTIALIAS_NONE has been fixed to be more
 predictable, (previously image rendering and geometry rendering would
 be slightly misaligned with respect to each other).
 
-The reference manual at http://cairographics.org/manual now documents
+The reference manual at https://cairographics.org/manual now documents
 100% of the functions and types in cairo's public API.
 
 API additions
@@ -3259,7 +3259,7 @@ general
 Cairo now depends on pixman 0.10.0 which was recently released. The
 latest pixman release can always be found alongside cairo releases at:
 
-   http://cairographics.org/releases
+   https://cairographics.org/releases
 
 Increase the precision of color stops for gradients. This fixes a
 regression in gradient rendering that had been present since the
@@ -3559,7 +3559,7 @@ Add new API for efficiently using image data as a source:
 
 For full documentation, see:
 
-	http://cairographics.org/manual/cairo-Quartz-Surfaces.html#cairo-quartz-image-surface-create
+	https://cairographics.org/manual/cairo-Quartz-Surfaces.html#cairo-quartz-image-surface-create
 
 Several fixes for cairo_mask().
 
@@ -3934,14 +3934,14 @@ So users will need to acquire and build pixman before being able to
 build cairo. The current release is 0.9.6 and can be obtained from
 here:
 
-	http://cairographics.org/releases/pixman-0.9.6.tar.gz
+	https://cairographics.org/releases/pixman-0.9.6.tar.gz
 
  which can be verified with:
 
-	http://cairographics.org/releases/pixman-0.9.6.tar.gz.sha1
+	https://cairographics.org/releases/pixman-0.9.6.tar.gz.sha1
 	66f01a682c64403a3d7a855ba5aa609ed93bcb9e  pixman-0.9.6.tar.gz
 
-	http://cairographics.org/releases/pixman-0.9.6.tar.gz.sha1.asc
+	https://cairographics.org/releases/pixman-0.9.6.tar.gz.sha1.asc
 	(signed by Carl Worth)
 
 Major PDF/PostScript improvements
@@ -6107,7 +6107,7 @@ This is the third in a series of snapshots working toward the imminent
 1.2 release of cairo. For a list of items still needing work on the
 cairo 1.2 roadmap, please see:
 
-	http://cairographics.org/ROADMAP
+	https://cairographics.org/ROADMAP
 
 As can be seen in that list, there are no longer any API additions
 left on the roadmap. Instead, there is a feature (PDF type 3 fonts) a
@@ -6202,7 +6202,7 @@ This is the second in a series of snapshots working toward the
 upcoming 1.2 release of cairo. For a list of items still needing work
 on the cairo 1.2 roadmap, please see:
 
-	http://cairographics.org/ROADMAP
+	https://cairographics.org/ROADMAP
 
 The items included in this snapshot (since the 1.1.2 snapshot) are
 described below.
@@ -7369,7 +7369,7 @@ Owen Taylor has converted cairo's documentation system to gtk-doc and
 has begun some long-needed work on the documentation, which can now be
 viewed online here:
 
-	http://cairographics.org/manual/
+	https://cairographics.org/manual/
 
 New backend: win32
 ------------------
@@ -7401,7 +7401,7 @@ This is the first snapshot to include a functional win32 backend,
 
 And see also the documentation at:
 
-http://cairographics.org/manual/cairo-Microsoft-Windows-Backend.html
+https://cairographics.org/manual/cairo-Microsoft-Windows-Backend.html
 
 Disabled backend: quartz
 ------------------------
@@ -7430,14 +7430,14 @@ resolution. Further changes are described below.
  Added cairo_font_extents and cairo_font_glyph_extents. See
  documentation for details:
 
- http://cairographics.org/manual/cairo-cairo-t.html#cairo-font-extents
+ https://cairographics.org/manual/cairo-cairo-t.html#cairo-font-extents
 
  cairo-ft.h
  ----------
  The cairo_ft_font API changed considerably. Please see the
  documentation for details:
 
- http://cairographics.org/manual/cairo-FreeType-Fonts.html
+ https://cairographics.org/manual/cairo-FreeType-Fonts.html
 
 Performance
 -----------
@@ -7588,7 +7588,7 @@ is a port of Keith Packard's fdclock program originally written for
 the xlib backend. A screenshot of this program running on Mac OS X is
 available here:
 
-	http://cairographics.org/~cworth/images/fdclock-quartz.png
+	https://cairographics.org/~cworth/images/fdclock-quartz.png
 
 ATSUI font backend
 ------------------
diff --git a/README b/README
index 7ee2c1878..0e73a3967 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
 Cairo - Multi-platform 2D graphics library
-http://cairographics.org
+https://cairographics.org
 
 What is cairo
 =============
@@ -35,25 +35,25 @@ Where to get more information about cairo
 =========================================
 The primary source of information about cairo is:
 
-	http://cairographics.org/
+	https://cairographics.org/
 
 The latest versions of cairo can always be found at:
 
-	http://cairographics.org/download
+	https://cairographics.org/download
 
 Documentation on using cairo and frequently-asked questions:
 
-	http://cairographics.org/documentation
-	http://cairographics.org/FAQ
+	https://cairographics.org/documentation
+	https://cairographics.org/FAQ
 
 Mailing lists for contacting cairo users and developers:
 
-	http://cairographics.org/lists
+	https://cairographics.org/lists
 
 Roadmap and unscheduled things to do, (please feel free to help out):
 
-	http://cairographics.org/roadmap
-	http://cairographics.org/todo
+	https://cairographics.org/roadmap
+	https://cairographics.org/todo
 
 Dependencies
 ============
@@ -91,7 +91,7 @@ Supported, "standard" surface backends
 ------------------------------------
 	image backend (required)
 	------------------------
-	pixman >= 0.30.0	http://cairographics.org/releases
+	pixman >= 0.30.0	https://cairographics.org/releases
 
 	png support (can be left out if desired, but many
 	-----------  applications expect it to be present)
diff --git a/RELEASING b/RELEASING
index f66460464..8ac926e9b 100644
--- a/RELEASING
+++ b/RELEASING
@@ -104,7 +104,7 @@ Here are the steps to follow to create a new cairo release:
 	Include a link to the incremental ChangeLog for this release,
 	which we'll be uploading in a later step:
 
-		http://cairographics.org/releases/ChangeLog.cairo-${THIS_RELEASE}
+		https://cairographics.org/releases/ChangeLog.cairo-${THIS_RELEASE}
 
 4) Increment cairo_version_{minor|micro} in cairo-version.h:
 
@@ -147,10 +147,10 @@ Here are the steps to follow to create a new cairo release:
 	* Generate the final tar file
 	* Generate an sha1sum file
 	* Sign the sha1sum using your GPG setup (asks for your GPG password)
-	* scp the three files to appear on http://cairographics.org/releases
+	* scp the three files to appear on https://cairographics.org/releases
 	* Generate a versioned manual and upload it to appear as both:
-	  http://cairographics.org/manual-${THIS_RELEASE}
-	  http://cairographics.org/manual
+	  https://cairographics.org/manual-${THIS_RELEASE}
+	  https://cairographics.org/manual
 	* Place local copies of the three files in the releases directory
 	* Create a LATEST-package-version file (after deleting any old one)
 	* Tag the entire source tree with a ${THIS_RELEASE} tag, and sign
diff --git a/build/Makefile.am.releasing b/build/Makefile.am.releasing
index b17faabce..329d49c8c 100644
--- a/build/Makefile.am.releasing
+++ b/build/Makefile.am.releasing
@@ -31,7 +31,7 @@ RELEASE_OR_SNAPSHOT = $$(if test "x$(CAIRO_VERSION_MINOR)" = "x$$(echo "$(CAIRO_
 RELEASE_UPLOAD_HOST =   cairographics.org
 RELEASE_UPLOAD_BASE =	/srv/cairo.freedesktop.org/www
 RELEASE_UPLOAD_DIR =	$(RELEASE_UPLOAD_BASE)/$(RELEASE_OR_SNAPSHOT)s
-RELEASE_URL_BASE = 	http://cairographics.org/$(RELEASE_OR_SNAPSHOT)s
+RELEASE_URL_BASE = 	https://cairographics.org/$(RELEASE_OR_SNAPSHOT)s
 RELEASE_ANNOUNCE_LIST = cairo-announce at cairographics.org (and CC gnome-announce-list at gnome.org)
 
 MANUAL_VERSIONED =		manual-$(VERSION)
diff --git a/configure.ac b/configure.ac
index 5ee63a693..5d18327b8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@ AC_INIT([cairo],
 	[cairo_version_major.cairo_version_minor.cairo_version_micro],
 	[http://bugs.freedesktop.org/enter_bug.cgi?product=cairo],
 	[cairo],
-	[http://cairographics.org/])
+	[https://cairographics.org/])
 AC_CONFIG_AUX_DIR(build)
 AC_CONFIG_MACRO_DIR(build)
 AC_USE_SYSTEM_EXTENSIONS
@@ -712,7 +712,7 @@ dnl ===========================================================================
 CAIRO_ENABLE_SURFACE_BACKEND(image, image, always, [
   pixman_REQUIRES="pixman-1 >= 0.30.0"
   PKG_CHECK_MODULES(pixman, $pixman_REQUIRES, ,
-    [use_image="no (requires $pixman_REQUIRES http://cairographics.org/releases/)"])
+    [use_image="no (requires $pixman_REQUIRES https://cairographics.org/releases/)"])
   image_REQUIRES=$pixman_REQUIRES
   image_CFLAGS=$pixman_CFLAGS
   image_LIBS=$pixman_LIBS
diff --git a/doc/tutorial/slides/cairo-blank.svg b/doc/tutorial/slides/cairo-blank.svg
index ac91186fb..a338ee1b2 100644
--- a/doc/tutorial/slides/cairo-blank.svg
+++ b/doc/tutorial/slides/cairo-blank.svg
@@ -471,7 +471,7 @@
     </g>
     
     <!-- Footer -->
-    <text ss:variable="URL" x="1016" y="753" text-anchor="end" font-size="20">http://cairographics.org</text>
+    <text ss:variable="URL" x="1016" y="753" text-anchor="end" font-size="20">https://cairographics.org</text>
   </g>
 
 </svg>
diff --git a/doc/tutorial/slides/cairo-code.svg b/doc/tutorial/slides/cairo-code.svg
index 09e26bf3a..2204ffc92 100644
--- a/doc/tutorial/slides/cairo-code.svg
+++ b/doc/tutorial/slides/cairo-code.svg
@@ -907,7 +907,7 @@ C 42.942871662459936,	-24.939379331448624,
     </g>
     
     <!-- Footer -->
-    <text ss:variable="URL" x="1016" y="753" text-anchor="end" font-size="20">http://cairographics.org</text>
+    <text ss:variable="URL" x="1016" y="753" text-anchor="end" font-size="20">https://cairographics.org</text>
   </g>
 
 </svg>
diff --git a/doc/tutorial/slides/cairo-separator.svg b/doc/tutorial/slides/cairo-separator.svg
index 8d2c8406d..816223218 100644
--- a/doc/tutorial/slides/cairo-separator.svg
+++ b/doc/tutorial/slides/cairo-separator.svg
@@ -903,7 +903,7 @@ C 42.942871662459936,	-24.939379331448624,
     </g>
     
     <!-- Footer -->
-    <text ss:variable="URL" x="1016" y="753" text-anchor="end" font-size="20">http://cairographics.org</text>
+    <text ss:variable="URL" x="1016" y="753" text-anchor="end" font-size="20">https://cairographics.org</text>
   </g>
 
 </svg>
diff --git a/doc/tutorial/slides/cairo.svg b/doc/tutorial/slides/cairo.svg
index 3d96abc53..5823c29c1 100644
--- a/doc/tutorial/slides/cairo.svg
+++ b/doc/tutorial/slides/cairo.svg
@@ -892,7 +892,7 @@ Z" />
     </g>
     
     <!-- Footer -->
-    <text ss:variable="URL" x="1016" y="753" text-anchor="end" font-size="20">http://cairographics.org</text>
+    <text ss:variable="URL" x="1016" y="753" text-anchor="end" font-size="20">https://cairographics.org</text>
   </g>
 
 </svg>
diff --git a/doc/tutorial/slides/tutorial.xml b/doc/tutorial/slides/tutorial.xml
index 3224bea22..17470d464 100644
--- a/doc/tutorial/slides/tutorial.xml
+++ b/doc/tutorial/slides/tutorial.xml
@@ -8,14 +8,14 @@
   <slides theme="cairo"
 	  presentation="Drawing with cairo"
 	  presentation-subtitle="drawing with cairo"
-	  URL="http://cairographics.org"
+	  URL="https://cairographics.org"
 	  bullet="bullet">
 
     <slide title="Tutorial preparation" variant="blank" bullet="">
       <lc></lc>
-      <lc align="center">http://cairographics.org/tutorial</lc>
+      <lc align="center">https://cairographics.org/tutorial</lc>
       <lc></lc>
-      <li>wget http://cairographics.org/cairo-tutorial.tar.gz</li>
+      <li>wget https://cairographics.org/cairo-tutorial.tar.gz</li>
       <li>tar xzf cairo-tutorial.tar.gz</li>
       <li>cd cairo-tutorial</li>
       <li>make</li>
@@ -30,7 +30,7 @@
       <lc></lc>
       <lc>linux.conf.au</lc>
       <lc>2006-01-26</lc>
-      <lc>http://cairographics.org</lc>
+      <lc>https://cairographics.org</lc>
     </slide>
 
     <slide title="Ugly graphics" variant="separator">
@@ -199,8 +199,8 @@
 
     <slide title="Following along" >
       <lc></lc>
-      <lc align="center">http://cairographics.org/tutorial</lc>
-      <lc align="center">http://cairographics.org/cairo-tutorial.tar.gz</lc>
+      <lc align="center">https://cairographics.org/tutorial</lc>
+      <lc align="center">https://cairographics.org/cairo-tutorial.tar.gz</lc>
       <li>tar xzf cairo-tutorial.tar.gz</li>
       <li>cd cairo-tutorial</li>
       <li>make</li>
diff --git a/doc/tutorial/src/README b/doc/tutorial/src/README
index a2738da4e..4ce16d2f5 100644
--- a/doc/tutorial/src/README
+++ b/doc/tutorial/src/README
@@ -10,7 +10,7 @@ the examples. In order for you to make use of these files you will
 need to have cairo and its header files installed. You can find
 instructions for doing this at:
 
-	http://cairographics.org/tutorial
+	https://cairographics.org/tutorial
 
 Notice that there are a few .c files in this directory.
 
diff --git a/src/cairo-gl-composite.c b/src/cairo-gl-composite.c
index 8f05f7718..5477ef0d8 100644
--- a/src/cairo-gl-composite.c
+++ b/src/cairo-gl-composite.c
@@ -497,7 +497,7 @@ _cairo_gl_composite_begin_component_alpha  (cairo_gl_context_t *ctx,
     cairo_status_t status;
 
     /* For CLEAR, cairo's rendering equation (quoting Owen's description in:
-     * http://lists.cairographics.org/archives/cairo/2005-August/004992.html)
+     * https://lists.cairographics.org/archives/cairo/2005-August/004992.html)
      * is:
      *     mask IN clip ? src OP dest : dest
      * or more simply:
diff --git a/src/cairo-pdf-interchange.c b/src/cairo-pdf-interchange.c
index 9aa6934dc..7d8981b09 100644
--- a/src/cairo-pdf-interchange.c
+++ b/src/cairo-pdf-interchange.c
@@ -1047,7 +1047,7 @@ cairo_pdf_interchange_write_docinfo (cairo_pdf_surface_t *surface)
 
     _cairo_output_stream_printf (surface->output,
 				 "%d 0 obj\n"
-				 "<< /Producer (cairo %s (http://cairographics.org))\n",
+				 "<< /Producer (cairo %s (https://cairographics.org))\n",
 				 surface->docinfo_res.id,
 				 cairo_version_string ());
 
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 599eff4d4..0a17b81af 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -312,7 +312,7 @@ _cairo_ps_surface_emit_header (cairo_ps_surface_t *surface)
 
     _cairo_output_stream_printf (surface->final_stream,
 				 "%%!PS-Adobe-3.0%s\n"
-				 "%%%%Creator: cairo %s (http://cairographics.org)\n"
+				 "%%%%Creator: cairo %s (https://cairographics.org)\n"
 				 "%%%%CreationDate: %s"
 				 "%%%%Pages: %d\n",
 				 eps_header,
diff --git a/src/cairo.c b/src/cairo.c
index 92724a26b..ca0c91e8b 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -124,7 +124,7 @@
  *
  * For example:
  * <informalexample><programlisting>
- * cairo_tag_begin (cr, CAIRO_TAG_LINK, "uri='http://cairographics.org'");
+ * cairo_tag_begin (cr, CAIRO_TAG_LINK, "uri='https://cairographics.org'");
  * cairo_move_to (cr, 50, 50);
  * cairo_show_text (cr, "This is a link to the cairo website.");
  * cairo_tag_end (cr, CAIRO_TAG_LINK);
@@ -157,7 +157,7 @@
  * cairo_move_to (cr, 50, 70);
  * cairo_text_extents (cr, text2, &text2_extents);
  * sprintf (attribs,
- *          "rect=[%f %f %f %f %f %f %f %f] uri='http://cairographics.org'",
+ *          "rect=[%f %f %f %f %f %f %f %f] uri='https://cairographics.org'",
  *          text1_extents.x_bearing,
  *          text1_extents.y_bearing,
  *          text1_extents.width,
@@ -209,7 +209,7 @@
  *
  * An example of the link attributes to the cairo website:
  * <programlisting>
- * "uri='http://cairographics.org'"
+ * "uri='https://cairographics.org'"
  * </programlisting>
  *
  * ## File Links ## {#file-link}
diff --git a/src/cairo.h b/src/cairo.h
index 3b98f8344..e60ee8cde 100644
--- a/src/cairo.h
+++ b/src/cairo.h
@@ -606,7 +606,7 @@ cairo_pop_group_to_source (cairo_t *cr);
  * translucent layers too.
  * For a more detailed explanation of the effects of each operator, including
  * the mathematical definitions, see
- * <ulink url="http://cairographics.org/operators/">http://cairographics.org/operators/</ulink>.
+ * <ulink url="https://cairographics.org/operators/">https://cairographics.org/operators/</ulink>.
  *
  * Since: 1.0
  **/
diff --git a/test/api-special-cases.c b/test/api-special-cases.c
index c4a754dee..aa615f804 100644
--- a/test/api-special-cases.c
+++ b/test/api-special-cases.c
@@ -1095,7 +1095,7 @@ static cairo_test_status_t
 test_cairo_surface_set_mime_data (cairo_surface_t *surface)
 {
     const char *mimetype = "text/x-uri";
-    const char *data = "http://www.cairographics.org";
+    const char *data = "https://www.cairographics.org";
     cairo_status_t status;
 
     status = cairo_surface_set_mime_data (surface,
diff --git a/test/culled-glyphs.c b/test/culled-glyphs.c
index 28bee7e8c..eaa462b1c 100644
--- a/test/culled-glyphs.c
+++ b/test/culled-glyphs.c
@@ -33,7 +33,7 @@ draw (cairo_t *cr, int width, int height)
 "Ideally it should overflow the stack buffers, but do you really want to read "
 "a message that long. No. So we compromise with around 300 glyphs that is "
 "long enough to trigger the conditions as stated in "
-"http://lists.cairographics.org/archives/cairo/2008-December/015976.html. "
+"https://lists.cairographics.org/archives/cairo/2008-December/015976.html. "
 "Happy now?";
     cairo_text_extents_t extents;
 
diff --git a/test/dash-infinite-loop.c b/test/dash-infinite-loop.c
index a3d75442c..98ab62fe9 100644
--- a/test/dash-infinite-loop.c
+++ b/test/dash-infinite-loop.c
@@ -32,7 +32,7 @@
  * where the dash offset is advanced in a loop.
  *
  * Reported to the cairo mailing list by Hans Breuer.
- * http://lists.cairographics.org/archives/cairo/2009-June/017506.html
+ * https://lists.cairographics.org/archives/cairo/2009-June/017506.html
  */
 
 #define EPS 1e-30
diff --git a/test/degenerate-arc.c b/test/degenerate-arc.c
index ab6577421..081bfa523 100644
--- a/test/degenerate-arc.c
+++ b/test/degenerate-arc.c
@@ -25,7 +25,7 @@
 
 /* This test case exercises a "Potential division by zero in cairo_arc"
  * reported by Luiz Americo Pereira Camara <luizmed at oi.com.br>,
- * http://lists.cairographics.org/archives/cairo/2008-May/014054.html.
+ * https://lists.cairographics.org/archives/cairo/2008-May/014054.html.
  */
 
 #include "cairo-test.h"
diff --git a/test/degenerate-pen.c b/test/degenerate-pen.c
index ec8bd198a..4be0a998f 100644
--- a/test/degenerate-pen.c
+++ b/test/degenerate-pen.c
@@ -36,7 +36,7 @@
  * with various flash animations):
  *
  *	[cairo] Assertion `i < pen->num_vertices' failed in 1.4.10
- *	http://lists.cairographics.org/archives/cairo/2007-August/011282.html
+ *	https://lists.cairographics.org/archives/cairo/2007-August/011282.html
  *
  * The problem shows up with an extreme transformation matrix that
  * collapses the pen to a single line, (which means that
diff --git a/test/get-path-extents.c b/test/get-path-extents.c
index 3b80d1e03..f6a7d03f8 100644
--- a/test/get-path-extents.c
+++ b/test/get-path-extents.c
@@ -375,7 +375,7 @@ draw (cairo_t *cr, int width, int height)
     cairo_set_line_width (cr2, 2.0);
     /* XXX: We'd like to be able to use EQUALS here, but currently
      * when hinting is enabled freetype returns integer extents. See
-     * http://cairographics.org/todo */
+     * https://cairographics.org/todo */
     errors += !check_extents (ctx, phase, cr2, FILL, APPROX_EQUALS,
 			      0, 0, extents.width, extents.height);
     errors += !check_extents (ctx, phase, cr2, STROKE, APPROX_EQUALS,
diff --git a/test/leaky-dashed-rectangle.c b/test/leaky-dashed-rectangle.c
index 25f5674e9..e4ba3e8b7 100644
--- a/test/leaky-dashed-rectangle.c
+++ b/test/leaky-dashed-rectangle.c
@@ -25,7 +25,7 @@
  */
 
 /* Test case for bug reported by Franz Schmid <Franz.Schmid at altmuehlnet.de>
- * http://lists.cairographics.org/archives/cairo/2008-April/013912.html
+ * https://lists.cairographics.org/archives/cairo/2008-April/013912.html
  *
  * See also: http://bugs.freedesktop.org/show_bug.cgi?id=17177
  */
diff --git a/test/mime-surface-api.c b/test/mime-surface-api.c
index ce12653e1..8a8da826d 100644
--- a/test/mime-surface-api.c
+++ b/test/mime-surface-api.c
@@ -77,8 +77,8 @@ static cairo_test_status_t
 preamble (cairo_test_context_t *ctx)
 {
     const char *mimetype = "text/x-uri";
-    const char *data1 = "http://www.cairographics.org";
-    const char *data2 = "http://cairographics.org/examples/";
+    const char *data1 = "https://www.cairographics.org";
+    const char *data2 = "https://cairographics.org/examples/";
     cairo_bool_t destroy1_called = FALSE;
     cairo_bool_t destroy2_called = FALSE;
     cairo_surface_t *surface;
diff --git a/test/scale-offset-image.c b/test/scale-offset-image.c
index 7243a0669..9b4ba3f73 100644
--- a/test/scale-offset-image.c
+++ b/test/scale-offset-image.c
@@ -25,7 +25,7 @@
 
 /*
  * Test case derived from the bug report by Michel Iwaniec:
- * http://lists.cairographics.org/archives/cairo/2008-November/015660.html
+ * https://lists.cairographics.org/archives/cairo/2008-November/015660.html
  */
 
 #include "cairo-test.h"
diff --git a/test/scale-offset-similar.c b/test/scale-offset-similar.c
index e9e6a2bbe..32a083c49 100644
--- a/test/scale-offset-similar.c
+++ b/test/scale-offset-similar.c
@@ -25,7 +25,7 @@
 
 /*
  * Test case derived from the bug report by Michel Iwaniec:
- * http://lists.cairographics.org/archives/cairo/2008-November/015660.html
+ * https://lists.cairographics.org/archives/cairo/2008-November/015660.html
  */
 
 #include "cairo-test.h"
diff --git a/test/surface-pattern-scale-down-extend.c b/test/surface-pattern-scale-down-extend.c
index 191ab927f..785678daf 100644
--- a/test/surface-pattern-scale-down-extend.c
+++ b/test/surface-pattern-scale-down-extend.c
@@ -29,7 +29,7 @@
  * pattern.  Reported by Franz Schmid to the cairo mailing list as a
  * regression in 1.9.6:
  *
- * http://lists.cairographics.org/archives/cairo/2010-February/019492.html
+ * https://lists.cairographics.org/archives/cairo/2010-February/019492.html
  */
 
 static cairo_test_status_t
commit bf597b89288b6271f56031d5a20bfaf59f146d4c
Author: Bryce Harrington <bryce at bryceharrington.org>
Date:   Tue Oct 16 09:13:23 2018 -0700

    Revert "Correctly decode Adobe CMYK JPEGs in PDF export"
    
    From further testing and investigation it appears that many PDF viewers
    already have a workaround to invert Adobe CMYK JPEGs, so our generated
    PDFs display incorrectly with those viewers due to double-inversion.
    
    Further investigation will be needed to find a better solution that
    doesn't cause regression for some PDF viewers; perhaps PDF viewers that
    lack this inversion workaround should be changed to include it.  For now
    we'll drop the patch to avoid shipping the regression in 1.16.0.
    
    This reverts commit b207a932a2d3740984319dffd58a0791580597cd.
    
    Reference: https://bugs.freedesktop.org/show_bug.cgi?id=97612
    Fixes: https://gitlab.freedesktop.org/cairo/cairo/issues/156

diff --git a/src/cairo-image-info-private.h b/src/cairo-image-info-private.h
index 99cbbcc02..e64928e40 100644
--- a/src/cairo-image-info-private.h
+++ b/src/cairo-image-info-private.h
@@ -43,7 +43,6 @@ typedef struct _cairo_image_info {
     int		 height;
     int		 num_components;
     int		 bits_per_component;
-    int		 is_adobe_jpeg;
 } cairo_image_info_t;
 
 cairo_private cairo_int_status_t
diff --git a/src/cairo-image-info.c b/src/cairo-image-info.c
index 3b4cf6edb..d147e3723 100644
--- a/src/cairo-image-info.c
+++ b/src/cairo-image-info.c
@@ -67,9 +67,6 @@
 #define SOF14 0xce
 #define SOF15 0xcf
 
-/* Start of tag markers */
-#define APP14 0xee	/* Adobe */
-
 static const unsigned char *
 _jpeg_skip_segment (const unsigned char *p)
 {
@@ -97,8 +94,6 @@ _cairo_image_info_get_jpeg_info (cairo_image_info_t	*info,
 {
     const unsigned char *p = data;
 
-    info->is_adobe_jpeg = FALSE;
-
     while (p + 1 < data + length) {
 	if (*p != 0xff)
 	    return CAIRO_INT_STATUS_UNSUPPORTED;
@@ -136,18 +131,6 @@ _cairo_image_info_get_jpeg_info (cairo_image_info_t	*info,
 	    _jpeg_extract_info (info, p);
 	    return CAIRO_STATUS_SUCCESS;
 
-	case APP14:
-	    /* "Adobe" tags segment indicates inverted CMYK (in
-	     * CMYK images). */
-	    if (p + 12 > data + length)
-		return CAIRO_INT_STATUS_UNSUPPORTED;
-
-	    info->is_adobe_jpeg =
-		(0 == strncmp((const char *)(p + 3), "Adobe", 5));
-
-	    p = _jpeg_skip_segment(p);
-	    break;
-
 	default:
 	    if (*p >= RST_begin && *p <= RST_end) {
 		p++;
@@ -223,7 +206,6 @@ _jpx_extract_info (const unsigned char *p, cairo_image_info_t *info)
     info->width = get_unaligned_be32 (p + 4);
     info->num_components = (p[8] << 8) + p[9];
     info->bits_per_component = p[10];
-    info->is_adobe_jpeg = FALSE;
 }
 
 cairo_int_status_t
@@ -301,8 +283,6 @@ _cairo_image_info_get_png_info (cairo_image_info_t     *info,
     p += 4;
     info->height = get_unaligned_be32 (p);
 
-    info->is_adobe_jpeg = FALSE;
-
     return CAIRO_STATUS_SUCCESS;
 }
 
@@ -415,7 +395,6 @@ _jbig2_extract_info (cairo_image_info_t *info, const unsigned char *p)
     info->height = get_unaligned_be32 (p + 4);
     info->num_components = 1;
     info->bits_per_component = 1;
-    info->is_adobe_jpeg = FALSE;
 }
 
 cairo_int_status_t
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index ab6781340..7eb61aa1e 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -3169,7 +3169,6 @@ _cairo_pdf_surface_emit_jpeg_image (cairo_pdf_surface_t              *surface,
 						 "   /Height %d\n"
 						 "   /ColorSpace %s\n"
 						 "   /Interpolate %s\n"
-						 "%s"
 						 "   /BitsPerComponent %d\n"
 						 "%s"
 						 "   /Filter /DCTDecode\n",
@@ -3177,7 +3176,6 @@ _cairo_pdf_surface_emit_jpeg_image (cairo_pdf_surface_t              *surface,
 						 info.height,
 						 colorspace,
 						 surface_entry->interpolate ? "true" : "false",
-						 info.is_adobe_jpeg && info.num_components == 4 ? "   /Decode [ 1 0 1 0 1 0 1 0 ]\n" : "",
 						 info.bits_per_component,
 						 smask_buf);
     }


More information about the cairo-commit mailing list