diff --git a/gfx/cairo/cairo/src/cairo-win32.h b/gfx/cairo/cairo/src/cairo-win32.h --- a/src/cairo-win32.h +++ b/src/cairo-win32.h @@ -44,16 +44,19 @@ #include CAIRO_BEGIN_DECLS cairo_public cairo_surface_t * cairo_win32_surface_create (HDC hdc); cairo_public cairo_surface_t * +cairo_win32_surface_create_with_alpha (HDC hdc); + +cairo_public cairo_surface_t * cairo_win32_printing_surface_create (HDC hdc); cairo_public cairo_surface_t * cairo_win32_surface_create_with_ddb (HDC hdc, cairo_format_t format, int width, int height); --- cairo-1.12.16/src/win32/cairo-win32-display-surface.c.orig 2013-08-26 15:07:21.000000000 +0000 +++ cairo-1.12.16/src/win32/cairo-win32-display-surface.c 2014-03-27 00:04:01.097336000 +0000 @@ -916,33 +916,14 @@ * multiplied by all the src components. */ -/** - * cairo_win32_surface_create: - * @hdc: the DC to create a surface for - * - * Creates a cairo surface that targets the given DC. The DC will be - * queried for its initial clip extents, and this will be used as the - * size of the cairo surface. The resulting surface will always be of - * format %CAIRO_FORMAT_RGB24; should you need another surface format, - * you will need to create one through - * cairo_win32_surface_create_with_dib(). - * - * Return value: the newly created surface - * - * Since: 1.0 - **/ -cairo_surface_t * -cairo_win32_surface_create (HDC hdc) +static cairo_surface_t * +cairo_win32_surface_create_internal (HDC hdc, cairo_format_t format) { cairo_win32_display_surface_t *surface; - cairo_format_t format; cairo_status_t status; cairo_device_t *device; - /* Assume that everything coming in as a HDC is RGB24 */ - format = CAIRO_FORMAT_RGB24; - surface = malloc (sizeof (*surface)); if (surface == NULL) return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY)); @@ -977,6 +958,47 @@ } /** + * cairo_win32_surface_create: + * @hdc: the DC to create a surface for + * + * Creates a cairo surface that targets the given DC. The DC will be + * queried for its initial clip extents, and this will be used as the + * size of the cairo surface. The resulting surface will always be of + * format %CAIRO_FORMAT_RGB24; should you need another surface format, + * you will need to create one through + * cairo_win32_surface_create_with_dib(). + * + * Return value: the newly created surface + * + * Since: 1.0 + **/ +cairo_surface_t * +cairo_win32_surface_create (HDC hdc) +{ + return cairo_win32_surface_create_internal(hdc, CAIRO_FORMAT_RGB24); +} + +/** + * cairo_win32_surface_create_with_alpha: + * @hdc: the DC to create a surface for + * + * Creates a cairo surface that targets the given DC. The DC will be + * queried for its initial clip extents, and this will be used as the + * size of the cairo surface. The resulting surface will always be of + * format %CAIRO_FORMAT_ARGB32; this format is used when drawing into + * transparent windows. + * + * Return value: the newly created surface + * + * Since: 1.12 + **/ +cairo_surface_t * +cairo_win32_surface_create_with_alpha (HDC hdc) +{ + return cairo_win32_surface_create_internal(hdc, CAIRO_FORMAT_ARGB32); +} + +/** * cairo_win32_surface_create_with_dib: * @format: format of pixels in the surface to create * @width: width of the surface, in pixels