diff options
author | Bryce Harrington <bryce@osg.samsung.com> | 2015-10-28 17:37:41 -0700 |
---|---|---|
committer | Bryce Harrington <bryce@osg.samsung.com> | 2015-10-28 17:37:41 -0700 |
commit | 6eba71d2170443fb33e4d64261607f39b37245d6 (patch) | |
tree | 3bda5fc0773497831232368515e77b55923270d3 | |
parent | b15e18fb9045b21d6ab2eb531ac62f3693fd302c (diff) | |
download | cairo-6eba71d2170443fb33e4d64261607f39b37245d6.tar.gz |
Revert "win32: Add cairo API to set up a Win32 surface for an HDC with an alpha channel."
This adds a new API call, which we generally avoid in micro releases.
This reverts commit 3d489616a2fc624dc5e94164f23a4c8536d466d0.
-rw-r--r-- | src/cairo-win32.h | 4 | ||||
-rw-r--r-- | src/win32/cairo-win32-display-surface.c | 68 |
2 files changed, 16 insertions, 56 deletions
diff --git a/src/cairo-win32.h b/src/cairo-win32.h index db4cac69f..3d2e1c601 100644 --- a/src/cairo-win32.h +++ b/src/cairo-win32.h @@ -49,10 +49,6 @@ 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 1571480a1..965f2c45d 100644 --- a/src/win32/cairo-win32-display-surface.c +++ b/src/win32/cairo-win32-display-surface.c @@ -917,41 +917,31 @@ static const cairo_surface_backend_t cairo_win32_display_surface_backend = { */ /** - * cairo_win32_surface_create_with_format: + * cairo_win32_surface_create: * @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. - * - * Supported formats are: - * %CAIRO_FORMAT_ARGB32 - * %CAIRO_FORMAT_RGB24 - * - * 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. + * 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, NULL on failure + * Return value: the newly created surface * - * Since: 1.14.3 + * Since: 1.0 **/ cairo_surface_t * -cairo_win32_surface_create_with_format (HDC hdc, cairo_format_t format) +cairo_win32_surface_create (HDC hdc) { cairo_win32_display_surface_t *surface; + cairo_format_t format; cairo_status_t status; cairo_device_t *device; - switch (format) { - default: - return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT)); - case CAIRO_FORMAT_ARGB32: - case CAIRO_FORMAT_RGB24: - break; - } + /* Assume that everything coming in as a HDC is RGB24 */ + format = CAIRO_FORMAT_RGB24; surface = malloc (sizeof (*surface)); if (surface == NULL) @@ -987,28 +977,6 @@ cairo_win32_surface_create_with_format (HDC hdc, cairo_format_t format) } /** - * 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 @@ -1059,16 +1027,12 @@ cairo_win32_surface_create_with_ddb (HDC hdc, HDC screen_dc, ddb_dc; HBITMAP saved_dc_bitmap; - switch (format) { - default: -/* XXX handle these eventually */ - case CAIRO_FORMAT_A8: - case CAIRO_FORMAT_A1: + if (format != CAIRO_FORMAT_RGB24) return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT)); - case CAIRO_FORMAT_ARGB32: - case CAIRO_FORMAT_RGB24: - break; - } +/* XXX handle these eventually + format != CAIRO_FORMAT_A8 || + format != CAIRO_FORMAT_A1) +*/ if (!hdc) { screen_dc = GetDC (NULL); |