b=383960, moz cairo: win32-no-printer-bitblt.patch
authorvladimir@pobox.com
Tue, 24 Jul 2007 10:38:48 -0700
changeset 3842 aca1e8292e582b033fff0422f7b128548ed9440b
parent 3841 8e15c7eac7959a585a03bc631e7b745f736ac0b5
child 3843 5f784dc1e4e344202397ba8a026b00168194b3ee
push idunknown
push userunknown
push dateunknown
bugs383960
milestone1.9a7pre
b=383960, moz cairo: win32-no-printer-bitblt.patch
gfx/cairo/README
gfx/cairo/win32-no-printer-bitblt.patch
--- a/gfx/cairo/README
+++ b/gfx/cairo/README
@@ -25,9 +25,14 @@ Some specific things:
 max-font-size.patch: Clamp freetype font size to 1000 to avoid overflow issues
 
 win32-scaled-font-size.patch: Add cairo_win32_font_face_create_for_logfontw_hfont,
 allow win32 scaled_fonts to rescale themselves properly to the required CTM
 and only use the font_face's hfont if we're sure it's appropriate
 
 win32-logical-font-scale.patch: set CAIRO_WIN32_LOGICAL_FONT_SCALE to 1
 
+win32-no-printer-bitblt.patch: If we need to BitBlt from a DC (to do
+fallback), only bother trying if the IS_DISPLAY flag is set -- many
+printers lie about their support for BitBlt, and we end up getting
+black instead of what we want.
+
 nonfatal-assertions.patch: Make assertions non-fatal
new file mode 100644
--- /dev/null
+++ b/gfx/cairo/win32-no-printer-bitblt.patch
@@ -0,0 +1,17 @@
+diff -r 0a3ea2430215 gfx/cairo/cairo/src/cairo-win32-surface.c
+--- a/gfx/cairo/cairo/src/cairo-win32-surface.c	Fri Jun 08 18:04:18 2007 -0700
++++ b/gfx/cairo/cairo/src/cairo-win32-surface.c	Fri Jun 08 18:06:00 2007 -0700
+@@ -476,7 +476,12 @@ _cairo_win32_surface_get_subimage (cairo
+ 
+     status = CAIRO_INT_STATUS_UNSUPPORTED;
+ 
+-    if ((local->flags & CAIRO_WIN32_SURFACE_CAN_BITBLT) &&
++    /* Check for SURFACE_IS_DISPLAY here, because there are a lot
++     * of printer drivers that lie and say they can BitBlt, but
++     * just spit out black instead.
++     */
++    if ((local->flags & CAIRO_WIN32_SURFACE_IS_DISPLAY) &&
++	(local->flags & CAIRO_WIN32_SURFACE_CAN_BITBLT) &&
+ 	BitBlt (local->dc,
+ 		0, 0,
+ 		width, height,