summaryrefslogtreecommitdiffstats
path: root/gfx/cairo/win32-transparent-surface.patch
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /gfx/cairo/win32-transparent-surface.patch
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'gfx/cairo/win32-transparent-surface.patch')
-rw-r--r--gfx/cairo/win32-transparent-surface.patch129
1 files changed, 129 insertions, 0 deletions
diff --git a/gfx/cairo/win32-transparent-surface.patch b/gfx/cairo/win32-transparent-surface.patch
new file mode 100644
index 000000000..c8765cf28
--- /dev/null
+++ b/gfx/cairo/win32-transparent-surface.patch
@@ -0,0 +1,129 @@
+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
+@@ -1709,40 +1709,23 @@ _cairo_win32_surface_show_glyphs (void
+ }
+ #else
+ return CAIRO_INT_STATUS_UNSUPPORTED;
+ #endif
+ }
+
+ #undef STACK_GLYPH_SIZE
+
+-/**
+- * 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_dib().
+- *
+- * Return value: the newly created surface
+- **/
+-cairo_surface_t *
+-cairo_win32_surface_create (HDC hdc)
++static cairo_surface_t *
++cairo_win32_surface_create_internal (HDC hdc, cairo_format_t format)
+ {
+ cairo_win32_surface_t *surface;
+
+- cairo_format_t format;
+ RECT rect;
+
+- /* Assume that everything coming in as a HDC is RGB24 */
+- format = CAIRO_FORMAT_RGB24;
+-
+ surface = malloc (sizeof (cairo_win32_surface_t));
+ if (surface == NULL)
+ return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
+
+ if (_cairo_win32_save_initial_clip (hdc, surface) != CAIRO_STATUS_SUCCESS) {
+ free (surface);
+ return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
+ }
+@@ -1765,17 +1748,58 @@ cairo_win32_surface_create (HDC hdc)
+ surface->extents.width = rect.right - rect.left;
+ surface->extents.height = rect.bottom - rect.top;
+
+ surface->flags = _cairo_win32_flags_for_dc (surface->dc);
+
+ _cairo_surface_init (&surface->base, &cairo_win32_surface_backend,
+ _cairo_content_from_format (format));
+
+- return (cairo_surface_t *)surface;
++ return &surface->base;
++}
++
++/**
++ * 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_dib() or call
++ * cairo_win32_surface_create_with_alpha.
++ *
++ * Return value: the newly created surface
++ **/
++cairo_surface_t *
++cairo_win32_surface_create (HDC hdc)
++{
++ /* Assume everything comes in as RGB24 */
++ return cairo_win32_surface_create_internal(hdc, CAIRO_FORMAT_RGB24);
++}
++
++/**
++ * cairo_win32_surface_create_with_alpha:
++ * @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_ARGB32; this format is used when drawing into
++ * transparent windows.
++ *
++ * Return value: the newly created surface
++ *
++ * Since: 1.10
++ **/
++cairo_surface_t *
++cairo_win32_surface_create_with_alpha (HDC hdc)
++{
++ return cairo_win32_surface_create_internal(hdc, CAIRO_FORMAT_ARGB32);
+ }
+
+ /**
+ * cairo_win32_surface_create_with_dib:
+ * @format: format of pixels in the surface to create
+ * @width: width of the surface, in pixels
+ * @height: height of the surface, in pixels
+ *
+diff --git a/gfx/cairo/cairo/src/cairo-win32.h b/gfx/cairo/cairo/src/cairo-win32.h
+--- a/gfx/cairo/cairo/src/cairo-win32.h
++++ b/gfx/cairo/cairo/src/cairo-win32.h
+@@ -44,16 +44,19 @@
+ #include <windows.h>
+
+ CAIRO_BEGIN_DECLS
+
+ cairo_public cairo_surface_t *
+ cairo_win32_surface_create (HDC hdc);
+
+ cairo_public cairo_surface_t *
++cairo_win32_surface_create_with_alpha (HDC hdc);
++
++cairo_public cairo_surface_t *
+ cairo_win32_printing_surface_create (HDC hdc);
+
+ cairo_public cairo_surface_t *
+ cairo_win32_surface_create_with_ddb (HDC hdc,
+ cairo_format_t format,
+ int width,
+ int height);
+