[cairo-commit] Branch '1.14' - 4 commits - boilerplate/cairo-boilerplate-win32.c cairo-version.h NEWS

Bryce Harrington bryce at kemper.freedesktop.org
Fri Dec 11 00:49:40 PST 2015


 NEWS                                  |   31 ++++
 boilerplate/cairo-boilerplate-win32.c |  242 +---------------------------------
 cairo-version.h                       |    2 
 3 files changed, 46 insertions(+), 229 deletions(-)

New commits:
commit 65499badb7205dfffba73dd7cb053ef0ac662e1c
Author: Bryce Harrington <bryce at osg.samsung.com>
Date:   Fri Dec 11 00:49:31 2015 -0800

    NEWS: Fix link to changelog

diff --git a/NEWS b/NEWS
index 3ec0e6c..f752a2d 100644
--- a/NEWS
+++ b/NEWS
@@ -4,7 +4,7 @@ Simple bugfix release to fix one Windows issue.
 
 For a complete log of changes since 1.14.4, please see:
 
-    http://cairographics.org/releases/ChangeLog.1.14.6
+    http://cairographics.org/releases/ChangeLog.cairo-1.14.6
 
 Features
 --------
commit 3f6dc36df1ec37fa33689404da5158927725174e
Author: Bryce Harrington <bryce at osg.samsung.com>
Date:   Wed Dec 9 14:20:36 2015 -0800

    Start 1.14.7 development.

diff --git a/cairo-version.h b/cairo-version.h
index 4c1de00..23eb640 100644
--- a/cairo-version.h
+++ b/cairo-version.h
@@ -3,6 +3,6 @@
 
 #define CAIRO_VERSION_MAJOR 1
 #define CAIRO_VERSION_MINOR 14
-#define CAIRO_VERSION_MICRO 6
+#define CAIRO_VERSION_MICRO 7
 
 #endif
commit 9d3191da6fae7dfd914c3516d6ba369c9ba1a576
Author: Bryce Harrington <bryce at osg.samsung.com>
Date:   Wed Dec 9 12:41:13 2015 -0800

    Release 1.14.6

diff --git a/NEWS b/NEWS
index 5959b67..3ec0e6c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,34 @@
+Release 1.14.6    (2015-12-09  Bryce Harrington <bryce at osg.samsung.com>)
+========================================================================
+Simple bugfix release to fix one Windows issue.
+
+For a complete log of changes since 1.14.4, please see:
+
+    http://cairographics.org/releases/ChangeLog.1.14.6
+
+Features
+--------
+None
+
+API Changes
+-----------
+None
+
+Dependency Changes
+------------------
+None
+
+Performance Optimizations
+-------------------------
+None
+
+Bug Fixes
+---------
+* Fix failure on Windows due to reference of the function
+  cairo_win32_surface_create_with_format(), which isn't included in the
+  1.14.4 release. (Bug #92771)
+
+
 Release 1.14.4    (2015-10-28  Bryce Harrington <bryce at osg.samsung.com>)
 ========================================================================
 Just in time for Halloween we see another bug-fix release for Cairo.
diff --git a/cairo-version.h b/cairo-version.h
index 55f7e5b..4c1de00 100644
--- a/cairo-version.h
+++ b/cairo-version.h
@@ -3,6 +3,6 @@
 
 #define CAIRO_VERSION_MAJOR 1
 #define CAIRO_VERSION_MINOR 14
-#define CAIRO_VERSION_MICRO 5
+#define CAIRO_VERSION_MICRO 6
 
 #endif
commit 3372181a17c196af0644abe1b9c63a4b57815c9a
Author: Bryce Harrington <bryce at osg.samsung.com>
Date:   Wed Dec 9 11:02:43 2015 -0800

    Revert "win32: Add a win32 boilerplate that uses a real window"
    
    This reverts commit 549e511814c4ebb476b6e45871ab7734f7ca915d.
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=92771

diff --git a/boilerplate/cairo-boilerplate-win32.c b/boilerplate/cairo-boilerplate-win32.c
index 4fd0a10..7469cc7 100644
--- a/boilerplate/cairo-boilerplate-win32.c
+++ b/boilerplate/cairo-boilerplate-win32.c
@@ -28,191 +28,15 @@
 
 #include <cairo-win32.h>
 
-static const cairo_user_data_key_t win32_closure_key;
-
-typedef struct _win32_target_closure {
-    HWND wnd;
-    HDC dc;
-    ATOM bpl_atom;
-    cairo_surface_t *surface;
-} win32_target_closure_t;
-
-static void
-_cairo_boilerplate_win32_cleanup_window_surface (void *closure)
-{
-    win32_target_closure_t *win32tc = closure;
-
-    if (win32tc != NULL)
-    {
-	if (win32tc->wnd != NULL &&
-	    ReleaseDC (win32tc->wnd, win32tc->dc) != 1)
-	    fprintf (stderr,
-		     "Failed to release DC of a test window when cleaning up.\n");
-	if (win32tc->wnd != NULL &&
-	    DestroyWindow (win32tc->wnd) == 0)
-	    fprintf (stderr,
-		     "Failed to destroy a test window when cleaning up, GLE is %lu.\n",
-		     GetLastError ());
-	if (win32tc->bpl_atom != 0 &&
-	    UnregisterClassA ((LPCSTR) MAKELPARAM (win32tc->bpl_atom, 0), GetModuleHandle (NULL)) == 0 &&
-	    GetLastError () != ERROR_CLASS_DOES_NOT_EXIST)
-	    fprintf (stderr,
-		     "Failed to unregister boilerplate window class, GLE is %lu.\n",
-		     GetLastError ());
-
-	free (win32tc);
-    }
-}
-
-static win32_target_closure_t *
-_cairo_boilerplate_win32_create_window (int width,
-					int height)
-{
-    WNDCLASSEXA wincl;
-    win32_target_closure_t *win32tc;
-    LPCSTR window_class_name;
-
-    ZeroMemory (&wincl, sizeof (WNDCLASSEXA));
-    wincl.cbSize = sizeof (WNDCLASSEXA);
-    wincl.hInstance = GetModuleHandle (0);
-    wincl.lpszClassName = "cairo_boilerplate_win32_dummy";
-    wincl.lpfnWndProc = DefWindowProcA;
-    wincl.style = CS_OWNDC;
-
-    win32tc = calloc (1, sizeof (win32_target_closure_t));
-
-    if (win32tc == NULL)
-    {
-	int error = errno;
-	fprintf (stderr, "Ran out of memory: %d.\n", error);
-	return NULL;
-    }
-
-    ZeroMemory (win32tc, sizeof (win32_target_closure_t));
-
-    win32tc->bpl_atom = RegisterClassExA (&wincl);
-
-    if (win32tc->bpl_atom == 0 && GetLastError () != ERROR_CLASS_ALREADY_EXISTS)
-    {
-	fprintf (stderr,
-		 "Failed to register a boilerplate window class, GLE is %lu.\n",
-		 GetLastError ());
-	_cairo_boilerplate_win32_cleanup_window_surface (win32tc);
-	return NULL;
-    }
-
-    if (win32tc->bpl_atom == 0)
-	window_class_name = wincl.lpszClassName;
-    else
-	window_class_name = (LPCSTR) MAKELPARAM (win32tc->bpl_atom, 0);
-
-    win32tc->wnd = CreateWindowExA (WS_EX_TOOLWINDOW,
-				    window_class_name,
-				    0,
-				    WS_POPUP,
-				    0,
-				    0,
-				    width,
-				    height,
-				    0,
-				    0,
-				    0,
-				    0);
-
-    if (win32tc->wnd == NULL)
-    {
-	fprintf (stderr,
-		 "Failed to create a test window, GLE is %lu.\n",
-		 GetLastError ());
-	_cairo_boilerplate_win32_cleanup_window_surface (win32tc);
-	return NULL;
-    }
-
-    win32tc->dc = GetDC (win32tc->wnd);
-
-    if (win32tc->dc == NULL)
-    {
-	fprintf (stderr, "Failed to get test window DC.\n");
-	_cairo_boilerplate_win32_cleanup_window_surface (win32tc);
-	return NULL;
-    }
-
-    SetWindowPos (win32tc->wnd,
-		  HWND_BOTTOM,
-		  INT_MIN,
-		  INT_MIN,
-		  width,
-		  height,
-		  SWP_NOACTIVATE | SWP_SHOWWINDOW);
-
-    return win32tc;
-}
-
 static cairo_surface_t *
-_cairo_boilerplate_win32_create_window_surface (const char		  *name,
-						cairo_content_t		   content,
-						double			   width,
-						double			   height,
-						double			   max_width,
-						double			   max_height,
-						cairo_boilerplate_mode_t   mode,
-						void			 **closure)
-{
-    win32_target_closure_t *win32tc;
-    cairo_surface_t *surface;
-    cairo_format_t format;
-    cairo_status_t status;
-
-    win32tc = _cairo_boilerplate_win32_create_window (width, height);
-
-    if (win32tc == NULL)
-	return NULL;
-
-    format = cairo_boilerplate_format_from_content (content);
-
-    surface = cairo_win32_surface_create_with_format (win32tc->dc, format);
-
-    win32tc->surface = surface;
-
-    status = cairo_surface_status (surface);
-
-    if (status != CAIRO_STATUS_SUCCESS)
-    {
-	fprintf (stderr,
-		 "Failed to create the test surface: %s [%d].\n",
-		 cairo_status_to_string (status), status);
-	_cairo_boilerplate_win32_cleanup_window_surface (win32tc);
-	return NULL;
-    }
-
-    status = cairo_surface_set_user_data (surface, &win32_closure_key, win32tc, NULL);
-
-    if (status != CAIRO_STATUS_SUCCESS)
-    {
-	fprintf (stderr,
-		 "Failed to set surface userdata: %s [%d].\n",
-		 cairo_status_to_string (status), status);
-
-	cairo_surface_destroy (surface);
-	_cairo_boilerplate_win32_cleanup_window_surface (win32tc);
-
-	return NULL;
-    }
-
-    *closure = win32tc;
-
-    return surface;
-}
-
-static cairo_surface_t *
-_cairo_boilerplate_win32_create_dib_surface (const char		       *name,
-					     cairo_content_t		content,
-					     double 			width,
-					     double 			height,
-					     double 			max_width,
-					     double 			max_height,
-					     cairo_boilerplate_mode_t   mode,
-					     void		      **closure)
+_cairo_boilerplate_win32_create_surface (const char		   *name,
+					 cairo_content_t	    content,
+					 double 		    width,
+					 double 		    height,
+					 double 		    max_width,
+					 double 		    max_height,
+					 cairo_boilerplate_mode_t   mode,
+					 void			  **closure)
 {
     cairo_format_t format;
 
@@ -228,16 +52,12 @@ static const cairo_boilerplate_target_t targets[] = {
 	"win32", "win32", NULL, NULL,
 	CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR, 0,
 	"cairo_win32_surface_create_with_dib",
-	_cairo_boilerplate_win32_create_dib_surface,
+	_cairo_boilerplate_win32_create_surface,
 	cairo_surface_create_similar,
-	NULL,
-	NULL,
+	NULL, NULL,
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
-	NULL,
-	NULL,
-	NULL,
-	TRUE, FALSE, FALSE
+	NULL, NULL, NULL, TRUE, FALSE, FALSE
     },
     /* Testing the win32 surface isn't interesting, since for
      * ARGB images it just chains to the image backend
@@ -246,46 +66,12 @@ static const cairo_boilerplate_target_t targets[] = {
 	"win32", "win32", NULL, NULL,
 	CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR_ALPHA, 0,
 	"cairo_win32_surface_create_with_dib",
-	_cairo_boilerplate_win32_create_dib_surface,
-	cairo_surface_create_similar,
-	NULL,
-	NULL,
-	_cairo_boilerplate_get_image_surface,
-	cairo_surface_write_to_png,
-	NULL,
-	NULL,
-	NULL,
-	FALSE, FALSE, FALSE
-    },
-    {
-	"win32-window-color", "win32", NULL, NULL,
-	CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR, 1,
-	"cairo_win32_surface_create",
-	_cairo_boilerplate_win32_create_window_surface,
-	cairo_surface_create_similar,
-	NULL,
-	NULL,
-	_cairo_boilerplate_get_image_surface,
-	cairo_surface_write_to_png,
-	_cairo_boilerplate_win32_cleanup_window_surface,
-	NULL,
-	NULL,
-	FALSE, FALSE, FALSE
-    },
-    {
-	"win32-window-coloralpha", "win32", NULL, NULL,
-	CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR_ALPHA, 1,
-	"cairo_win32_surface_create_with_format",
-	_cairo_boilerplate_win32_create_window_surface,
+	_cairo_boilerplate_win32_create_surface,
 	cairo_surface_create_similar,
-	NULL,
-	NULL,
+	NULL, NULL,
 	_cairo_boilerplate_get_image_surface,
 	cairo_surface_write_to_png,
-	_cairo_boilerplate_win32_cleanup_window_surface,
-	NULL,
-	NULL,
-	FALSE, FALSE, FALSE
+	NULL, NULL, NULL, FALSE, FALSE, FALSE
     },
 };
 CAIRO_BOILERPLATE (win32, targets)


More information about the cairo-commit mailing list