From 116e06407bc9a96436cee52330aa3bfedfbfd0aa Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 25 Sep 2014 15:13:59 -0600 Subject: [PATCH] racket/draw Windows: patch Cairo for clipped DC surface creation --- native-pkgs | 2 +- racket/src/native-libs/README.txt | 2 +- racket/src/native-libs/build.rkt | 6 ++- .../patches/win32cairofallback.patch | 38 +++++++++++++++++++ 4 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 racket/src/native-libs/patches/win32cairofallback.patch diff --git a/native-pkgs b/native-pkgs index 2648702ac3..4bc36e704d 160000 --- a/native-pkgs +++ b/native-pkgs @@ -1 +1 @@ -Subproject commit 2648702ac3b6bb553573d330ac8ad6e0a00251b7 +Subproject commit 4bc36e704d0ce4d84788e538ca49f71a8b73c07f diff --git a/racket/src/native-libs/README.txt b/racket/src/native-libs/README.txt index c82a2156b1..7f49923fea 100644 --- a/racket/src/native-libs/README.txt +++ b/racket/src/native-libs/README.txt @@ -30,7 +30,7 @@ versions: harfbuzz-0.9.27 fontconfig-2.11.1 freetype-2.5.3 - pango-1.36.6 (current Windows and PPC binaries are 1.36.3) + pango-1.36.6 (current PPC binaries are 1.36.3) poppler-0.24.5 mpfr-3.1.2 gmp-5.1.3 diff --git a/racket/src/native-libs/build.rkt b/racket/src/native-libs/build.rkt index 7a29aef1ac..128d0160dc 100644 --- a/racket/src/native-libs/build.rkt +++ b/racket/src/native-libs/build.rkt @@ -119,6 +119,9 @@ ;; Enable "symbol" fonts, and fix off-by-one: (define-runtime-path win32text-patch "patches/win32text.patch") +;; Fix a problem with a surface connected to a clipped drawing context +(define-runtime-path win32cairofallback-patch "patches/win32cairofallback.patch") + ;; Needed when building with old GCC, such as 4.0: (define-runtime-path gmp-weak-patch "patches/gmp-weak.patch") @@ -315,7 +318,8 @@ #:env path-flags #:configure '("--enable-xlib=no") #:patches (list cairo-coretext-patch - courier-new-patch))] + courier-new-patch + win32cairofallback-patch))] [("harfbuzz") (config #:depends '("fontconfig" "freetype" "cairo") #:configure '("--without-icu") #:patches (if win? diff --git a/racket/src/native-libs/patches/win32cairofallback.patch b/racket/src/native-libs/patches/win32cairofallback.patch new file mode 100644 index 0000000000..e56c5893b6 --- /dev/null +++ b/racket/src/native-libs/patches/win32cairofallback.patch @@ -0,0 +1,38 @@ +From 844455c14f8e9e4767fd661e475a9c6fdea9d22e Mon Sep 17 00:00:00 2001 +From: Massimo Valentini +Date: Wed, 11 Sep 2013 18:10:38 +0200 +Subject: [PATCH] Bug 53121 - My program runs successfully with... + +Cairo-1.10.2, but getting SIGSEGV with 1.12.2. +--- + src/win32/cairo-win32-display-surface.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/win32/cairo-win32-display-surface.c b/src/win32/cairo-win32-display-surface.c +index 5ecdbee..965f2c4 100644 +--- a/cairo/src/win32/cairo-win32-display-surface.c ++++ b/cairo/src/win32/cairo-win32-display-surface.c +@@ -455,17 +455,17 @@ _cairo_win32_display_surface_map_to_image (void *abstract_sur + surface->fallback = + _cairo_win32_display_surface_create_for_dc (surface->win32.dc, + surface->win32.format, +- surface->win32.extents.width, +- surface->win32.extents.height); ++ surface->win32.extents.x + surface->win32.extents.width, ++ surface->win32.extents.y + surface->win32.extents.height); + if (unlikely (status = surface->fallback->status)) + goto err; + + if (!BitBlt (to_win32_surface(surface->fallback)->dc, +- 0, 0, ++ surface->win32.extents.x, surface->win32.extents.y, + surface->win32.extents.width, + surface->win32.extents.height, + surface->win32.dc, +- 0, 0, ++ surface->win32.extents.x, surface->win32.extents.y, + SRCCOPY)) { + status = _cairo_error (CAIRO_STATUS_DEVICE_ERROR); + goto err; +-- +1.7.6.5