Author: spouliot
Date: 2006-05-11 22:35:51 -0400 (Thu, 11 May 2006)
New Revision: 60615
Modified:
trunk/libgdiplus/src/ChangeLog
trunk/libgdiplus/src/graphics-path.c
trunk/libgdiplus/src/graphics.c
Log:
2006-05-11 Sebastien Pouliot <[EMAIL PROTECTED]>
* graphics.c: (GdipCreateFromHDC) check for memory allocation failure
before using the pointer. (GdipSetClipGraphics) honor the combineMode
parameter (in this case by reusing the GdipSetClipRegion function).
* graphics-path.c: (GdipAddString) it is possible that some memory is
allocated by cairo even if the *_create call fails - so we must call
the corresponding *_destroy function on failure to create.
Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog 2006-05-12 00:35:28 UTC (rev 60614)
+++ trunk/libgdiplus/src/ChangeLog 2006-05-12 02:35:51 UTC (rev 60615)
@@ -1,5 +1,11 @@
-2006-05-11 Sebastien Pouliot <[EMAIL PROTECTED]>
+2006-05-11 Sebastien Pouliot <[EMAIL PROTECTED]>
+ * graphics.c: (GdipCreateFromHDC) check for memory allocation failure
+ before using the pointer. (GdipSetClipGraphics) honor the combineMode
+ parameter (in this case by reusing the GdipSetClipRegion function).
+ * graphics-path.c: (GdipAddString) it is possible that some memory is
+ allocated by cairo even if the *_create call fails - so we must call
+ the corresponding *_destroy function on failure to create.
* matrix.c: (GdipCreateMatrix3) Ensure we call GdipFree in case of an
error (where we do not return the allocated matrix).
Modified: trunk/libgdiplus/src/graphics-path.c
===================================================================
--- trunk/libgdiplus/src/graphics-path.c 2006-05-12 00:35:28 UTC (rev
60614)
+++ trunk/libgdiplus/src/graphics-path.c 2006-05-12 02:35:51 UTC (rev
60615)
@@ -1014,11 +1014,14 @@
return InvalidParameter;
cs = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1, 1);
- if (cairo_surface_status (cs) != CAIRO_STATUS_SUCCESS)
+ if (cairo_surface_status (cs) != CAIRO_STATUS_SUCCESS) {
+ cairo_surface_destroy (cs);
return OutOfMemory;
+ }
cr = cairo_create (cs);
if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) {
+ cairo_destroy (cr);
cairo_surface_destroy (cs);
return OutOfMemory;
}
Modified: trunk/libgdiplus/src/graphics.c
===================================================================
--- trunk/libgdiplus/src/graphics.c 2006-05-12 00:35:28 UTC (rev 60614)
+++ trunk/libgdiplus/src/graphics.c 2006-05-12 02:35:51 UTC (rev 60615)
@@ -469,12 +469,12 @@
w, h);
*graphics = gdip_graphics_new (surface);
- (*graphics)->dpi_x = (*graphics)->dpi_y = gdip_get_display_dpi ();
- cairo_surface_destroy (surface);
-
if (!*graphics)
return OutOfMemory;
+ (*graphics)->dpi_x = (*graphics)->dpi_y = gdip_get_display_dpi ();
+ cairo_surface_destroy (surface);
+
return Ok;
}
@@ -4069,13 +4069,8 @@
{
if (!graphics || !srcgraphics)
return InvalidParameter;
-
- GdipDeleteRegion (graphics->clip);
- GdipCloneRegion (srcgraphics->clip, &graphics->clip);
- gdip_set_cairo_clipping (graphics);
- gdip_cairo_matrix_copy (graphics->clip_matrix,
srcgraphics->clip_matrix);
- return Ok;
+ return GdipSetClipRegion (graphics, srcgraphics->clip, combineMode);
}
GpStatus
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches