зеркало из https://github.com/mozilla/pjs.git
b=367618, initial win32 8bpp bits, r=stuart
This commit is contained in:
Родитель
fedf5af84f
Коммит
b3ce7ea750
|
@ -30,3 +30,8 @@ endian.patch: include cairo-platform.h for endian macros
|
|||
fixed-24-8.patch: Switch fixed point mode from 16.16 to 24.8
|
||||
|
||||
quartz-get-image-surface.patch: Add cairo_quartz_get_image_surface API analogous to the win32 one
|
||||
|
||||
buggy-repeat.patch: Unconditionally turn on buggy-repeat handling to bandaid bug 413583.
|
||||
|
||||
windows-8bit.patch: Initial important bits to get something drawing on 8bpp win32
|
||||
|
||||
|
|
|
@ -1677,9 +1677,9 @@ _cairo_win32_surface_show_glyphs (void *surface,
|
|||
*
|
||||
* 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. Also, if the DC is a raster DC, it will
|
||||
* be queried for its pixel format and the cairo surface format will
|
||||
* be set appropriately.
|
||||
* size of the cairo surface. The resulting surface will always
|
||||
* be of format CAIRO_FORMAT_RGB24; should you need an ARGB32 surface,
|
||||
* you will need to create one through cairo_win32_surface_create_with_dib.
|
||||
*
|
||||
* Return value: the newly created surface
|
||||
**/
|
||||
|
@ -1692,25 +1692,8 @@ cairo_win32_surface_create (HDC hdc)
|
|||
cairo_format_t format;
|
||||
RECT rect;
|
||||
|
||||
if (GetDeviceCaps(hdc, TECHNOLOGY) == DT_RASDISPLAY) {
|
||||
depth = GetDeviceCaps(hdc, BITSPIXEL);
|
||||
if (depth == 32)
|
||||
format = CAIRO_FORMAT_RGB24;
|
||||
else if (depth == 24)
|
||||
format = CAIRO_FORMAT_RGB24;
|
||||
else if (depth == 16)
|
||||
format = CAIRO_FORMAT_RGB24;
|
||||
else if (depth == 8)
|
||||
format = CAIRO_FORMAT_A8;
|
||||
else if (depth == 1)
|
||||
format = CAIRO_FORMAT_A1;
|
||||
else {
|
||||
_cairo_win32_print_gdi_error("cairo_win32_surface_create(bad BITSPIXEL)");
|
||||
return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT));
|
||||
}
|
||||
} else {
|
||||
format = CAIRO_FORMAT_RGB24;
|
||||
}
|
||||
/* Assume that everything coming in as a HDC is RGB24 */
|
||||
format = CAIRO_FORMAT_RGB24;
|
||||
|
||||
surface = malloc (sizeof (cairo_win32_surface_t));
|
||||
if (surface == NULL)
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
# HG changeset patch
|
||||
# User Vladimir Vukicevic <vladimir@pobox.com>
|
||||
# Date 1201565841 28800
|
||||
# Node ID 114e54eaf3df3b8b8666d831ab48312735bb04b1
|
||||
# Parent 86a787b2874770fa96503a7e513b362fd2c76ba4
|
||||
b=367618, can't run in 8bpp mode on win32
|
||||
|
||||
diff --git a/gfx/cairo/cairo/src/cairo-win32-surface.c b/gfx/cairo/cairo/src/cairo-win32-surface.c
|
||||
--- a/gfx/cairo/cairo/src/cairo-win32-surface.c
|
||||
+++ b/gfx/cairo/cairo/src/cairo-win32-surface.c
|
||||
@@ -1677,9 +1677,9 @@ _cairo_win32_surface_show_glyphs (void
|
||||
*
|
||||
* 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. Also, if the DC is a raster DC, it will
|
||||
- * be queried for its pixel format and the cairo surface format will
|
||||
- * be set appropriately.
|
||||
+ * size of the cairo surface. The resulting surface will always
|
||||
+ * be of format CAIRO_FORMAT_RGB24; should you need an ARGB32 surface,
|
||||
+ * you will need to create one through cairo_win32_surface_create_with_dib.
|
||||
*
|
||||
* Return value: the newly created surface
|
||||
**/
|
||||
@@ -1692,25 +1692,8 @@ cairo_win32_surface_create (HDC hdc)
|
||||
cairo_format_t format;
|
||||
RECT rect;
|
||||
|
||||
- if (GetDeviceCaps(hdc, TECHNOLOGY) == DT_RASDISPLAY) {
|
||||
- depth = GetDeviceCaps(hdc, BITSPIXEL);
|
||||
- if (depth == 32)
|
||||
- format = CAIRO_FORMAT_RGB24;
|
||||
- else if (depth == 24)
|
||||
- format = CAIRO_FORMAT_RGB24;
|
||||
- else if (depth == 16)
|
||||
- format = CAIRO_FORMAT_RGB24;
|
||||
- else if (depth == 8)
|
||||
- format = CAIRO_FORMAT_A8;
|
||||
- else if (depth == 1)
|
||||
- format = CAIRO_FORMAT_A1;
|
||||
- else {
|
||||
- _cairo_win32_print_gdi_error("cairo_win32_surface_create(bad BITSPIXEL)");
|
||||
- return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT));
|
||||
- }
|
||||
- } else {
|
||||
- format = CAIRO_FORMAT_RGB24;
|
||||
- }
|
||||
+ /* Assume that everything coming in as a HDC is RGB24 */
|
||||
+ format = CAIRO_FORMAT_RGB24;
|
||||
|
||||
surface = malloc (sizeof (cairo_win32_surface_t));
|
||||
if (surface == NULL)
|
Загрузка…
Ссылка в новой задаче