[packages/crossmingw32-cairo] - updated to 1.14.4 - added missing include fix to mingw32 patch - added add-cairo-API-to-setup-Win3
qboosh
qboosh at pld-linux.org
Fri Oct 30 17:48:31 CET 2015
commit ff93a0afb444d55ecf9adcb433442142de0fc6bd
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Fri Oct 30 17:48:30 2015 +0100
- updated to 1.14.4
- added missing include fix to mingw32 patch
- added add-cairo-API-to-setup-Win32-surface-for-HDC patch from mingw project
...-cairo-API-to-setup-Win32-surface-for-HDC.patch | 138 +++++++++++++++++++++
cairo-mingw32.patch | 10 ++
crossmingw32-cairo.spec | 8 +-
3 files changed, 153 insertions(+), 3 deletions(-)
---
diff --git a/crossmingw32-cairo.spec b/crossmingw32-cairo.spec
index 07276f3..2edf04b 100644
--- a/crossmingw32-cairo.spec
+++ b/crossmingw32-cairo.spec
@@ -2,14 +2,15 @@ Summary: Cairo - multi-platform 2D graphics library - cross MinGW32 version
Summary(pl.UTF-8): Cairo - wieloplatformowa biblioteka graficzna 2D - skrośna wersja MinGW32
%define realname cairo
Name: crossmingw32-%{realname}
-Version: 1.14.2
-Release: 3
+Version: 1.14.4
+Release: 1
License: LGPL v2.1 or MPL v1.1
Group: Development/Libraries
Source0: http://cairographics.org/releases/%{realname}-%{version}.tar.xz
-# Source0-md5: e1cdfaf1c6c995c4d4c54e07215b0118
+# Source0-md5: 90a929e8fe66fb5d19b5adaaea1e9a12
Patch0: cairo-link.patch
Patch1: cairo-mingw32.patch
+Patch2: cairo-add-cairo-API-to-setup-Win32-surface-for-HDC.patch
URL: http://cairographics.org/
BuildRequires: autoconf >= 2.63
BuildRequires: automake >= 1:1.11
@@ -153,6 +154,7 @@ Biblioteka DLL Cairo GObject dla Windows.
%setup -q -n %{realname}-%{version}
%patch0 -p1
%patch1 -p1
+%patch2 -p1
%build
export PKG_CONFIG_LIBDIR=%{_prefix}/lib/pkgconfig
diff --git a/cairo-add-cairo-API-to-setup-Win32-surface-for-HDC.patch b/cairo-add-cairo-API-to-setup-Win32-surface-for-HDC.patch
new file mode 100644
index 0000000..70d90ff
--- /dev/null
+++ b/cairo-add-cairo-API-to-setup-Win32-surface-for-HDC.patch
@@ -0,0 +1,138 @@
+From 16898ba11b4d6e9e2e64bb2d02d0fb5adbe266e2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?=
+ =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <lrn1986 at gmail.com>
+Date: Thu, 26 Mar 2015 19:33:43 +0000
+Subject: win32: Add cairo API to set up a Win32 surface for an HDC with an
+ alpha channel.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Руслан Ижбулатов <lrn1986 at gmail.com>
+Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
+
+diff --git a/src/cairo-win32.h b/src/cairo-win32.h
+index 3d2e1c6..db4cac6 100644
+--- a/src/cairo-win32.h
++++ b/src/cairo-win32.h
+@@ -49,6 +49,10 @@ cairo_public cairo_surface_t *
+ cairo_win32_surface_create (HDC hdc);
+
+ cairo_public cairo_surface_t *
++cairo_win32_surface_create_with_format (HDC hdc,
++ cairo_format_t format);
++
++cairo_public cairo_surface_t *
+ cairo_win32_printing_surface_create (HDC hdc);
+
+ cairo_public cairo_surface_t *
+diff --git a/src/win32/cairo-win32-display-surface.c b/src/win32/cairo-win32-display-surface.c
+index 965f2c4..1571480 100644
+--- a/src/win32/cairo-win32-display-surface.c
++++ b/src/win32/cairo-win32-display-surface.c
+@@ -917,31 +917,41 @@ static const cairo_surface_backend_t cairo_win32_display_surface_backend = {
+ */
+
+ /**
+- * cairo_win32_surface_create:
++ * cairo_win32_surface_create_with_format:
+ * @hdc: the DC to create a surface for
++ * @format: format of pixels in the surface to create
+ *
+ * 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().
++ * size of the cairo surface.
+ *
+- * Return value: the newly created surface
++ * Supported formats are:
++ * %CAIRO_FORMAT_ARGB32
++ * %CAIRO_FORMAT_RGB24
+ *
+- * Since: 1.0
++ * Note: @format only tells cairo how to draw on the surface, not what
++ * the format of the surface is. Namely, cairo does not (and cannot)
++ * check that @hdc actually supports alpha-transparency.
++ *
++ * Return value: the newly created surface, NULL on failure
++ *
++ * Since: 1.14.3
+ **/
+ cairo_surface_t *
+-cairo_win32_surface_create (HDC hdc)
++cairo_win32_surface_create_with_format (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;
++ switch (format) {
++ default:
++ return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT));
++ case CAIRO_FORMAT_ARGB32:
++ case CAIRO_FORMAT_RGB24:
++ break;
++ }
+
+ surface = malloc (sizeof (*surface));
+ if (surface == NULL)
+@@ -977,6 +987,28 @@ cairo_win32_surface_create (HDC hdc)
+ }
+
+ /**
++ * 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_format() or
++ * cairo_win32_surface_create_with_dib().
++ *
++ * Return value: the newly created surface, NULL on failure
++ *
++ * Since: 1.0
++ **/
++cairo_surface_t *
++cairo_win32_surface_create (HDC hdc)
++{
++ return cairo_win32_surface_create_with_format (hdc, CAIRO_FORMAT_RGB24);
++}
++
++/**
+ * cairo_win32_surface_create_with_dib:
+ * @format: format of pixels in the surface to create
+ * @width: width of the surface, in pixels
+@@ -1027,12 +1059,16 @@ cairo_win32_surface_create_with_ddb (HDC hdc,
+ HDC screen_dc, ddb_dc;
+ HBITMAP saved_dc_bitmap;
+
+- if (format != CAIRO_FORMAT_RGB24)
++ switch (format) {
++ default:
++/* XXX handle these eventually */
++ case CAIRO_FORMAT_A8:
++ case CAIRO_FORMAT_A1:
+ return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT));
+-/* XXX handle these eventually
+- format != CAIRO_FORMAT_A8 ||
+- format != CAIRO_FORMAT_A1)
+-*/
++ case CAIRO_FORMAT_ARGB32:
++ case CAIRO_FORMAT_RGB24:
++ break;
++ }
+
+ if (!hdc) {
+ screen_dc = GetDC (NULL);
+--
+cgit v0.10.2
diff --git a/cairo-mingw32.patch b/cairo-mingw32.patch
index 1d15c69..d7cab86 100644
--- a/cairo-mingw32.patch
+++ b/cairo-mingw32.patch
@@ -9,3 +9,13 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
+--- cairo-1.14.4/boilerplate/cairo-boilerplate-win32.c.orig 2015-10-27 22:04:22.000000000 +0100
++++ cairo-1.14.4/boilerplate/cairo-boilerplate-win32.c 2015-10-30 17:16:38.317127499 +0100
+@@ -26,6 +26,7 @@
+
+ #include "cairo-boilerplate-private.h"
+
++#include <limits.h>
+ #include <cairo-win32.h>
+
+ static const cairo_user_data_key_t win32_closure_key;
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/crossmingw32-cairo.git/commitdiff/ff93a0afb444d55ecf9adcb433442142de0fc6bd
More information about the pld-cvs-commit
mailing list