Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

This commit was manufactured by cvs2svn to create tag

'LIBGDIPLUS_1_0_2'.

svn path=/tags/LIBGDIPLUS_1_0_2/libgdiplus/; revision=34029
  • Loading branch information...
commit c05fda84f275db713dc772e93601a3e43f39a891 8 parents 6c32295 + 647c3ac + 1bc8bf9 + 7395001 + 0016047 + e5a4ff6 + 07b11a5 + 50d4a9e
nobody authored
View
4 ChangeLog
@@ -1,3 +1,7 @@
+2004-07-04 Peter Bartok <pbartok@novell.com>
+ * configure.in: Added fix for bug #60787, added dependency definitons
+ for pthreads (Mark Recht [recht at netbsd.org] verified the fix)
+
2004-05-27 Jordi Mas
* configure.in. make libpng optional depending on the user's system
View
74 configure.in
@@ -1,7 +1,7 @@
AC_INIT(README)
AC_CANONICAL_SYSTEM
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(libgdiplus,0.10)
+AM_INIT_AUTOMAKE(libgdiplus,1.0.2)
AM_MAINTAINER_MODE
AM_PROG_LIBTOOL
@@ -26,6 +26,78 @@ GDIPLUS_LIBS="`pkg-config --libs cairo glib-2.0 ` `freetype-config --libs`"
GDIPLUS_CFLAGS="`pkg-config --cflags cairo glib-2.0 ` `freetype-config --cflags`"
AC_CHECK_HEADERS(byteswap.h)
+AC_MSG_CHECKING([host threading settings])
+case "$host" in
+ *-*-mingw*|*-*-cygwin*)
+ AC_DEFINE_UNQUOTED(CYGWIN,1,[Win32])
+ AC_CHECK_LIB(intl, gettext)
+ ;;
+
+ *-*-*netbsd*)
+ AC_DEFINE_UNQUOTED(BSDOS,1,[NetBSD])
+ ;;
+
+ *-*-*freebsd*)
+ AC_DEFINE_UNQUOTED(BSDOS,1,[FreeBSD])
+ CFLAGS="-D_THREAD_SAFE $CFLAGS"
+ ;;
+
+ *-*-*openbsd*)
+ AC_DEFINE_UNQUOTED(BSDOS,1,[OpenBSD])
+ CFLAGS="$CFLAGS"
+ LIBS="$LIBS"
+ ;;
+
+ *-*-linux*)
+ AC_DEFINE_UNQUOTED(LINUX,1,[Linux])
+ AC_CHECK_LIB(pthread, pthread_create)
+ ;;
+
+ *-*-solaris*)
+ AC_DEFINE_UNQUOTED(SOLARIS,1,[Solaris])
+ AC_DEFINE_UNQUOTED(_REENTRANT,1,[For libc reentrancy])
+ CFLAGS="-pthreads $CFLAGS"
+ ;;
+
+ *-*-darwin*)
+ AC_DEFINE_UNQUOTED(OSX,1,[OS X])
+ CFLAGS="-no-cpp-precomp $CFLAGS"
+ LDFLAGS="-flat_namespace -undefined suppress $LDFLAGS"
+ ;;
+
+ *)
+ AC_MSG_RESULT(Unrecognized host $host)
+ AC_DEFINE_UNQUOTED(OTHEROS,1,[Unknown])
+ ;;
+esac
+
+# Apparently for BSD special handling needs to happen
+# See http://archives/neohapsis.com/archives/openbsd/2001-11/2142.html
+# by Miod Vallat <miod@online.fr>
+AC_CACHE_CHECK(
+ [if compiler recognizes -pthread],
+ myapp_cv_gcc_pthread,
+ ac_save_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS -pthread"
+ AC_LANG_SAVE
+ AC_LANG_C
+ AC_TRY_LINK([#include <pthread.h>],
+ [void *p = pthread_create;],
+ myapp_cv_gcc_pthread=yes,
+ myapp_cv_gcc_pthread=no)
+ AC_LANG_RESTORE
+ CFLAGS=$ac_save_CFLAGS
+)
+if test $myapp_cv_gcc_pthread = yes
+then
+ myapp_threads=""
+ CFLAGS="$CFLAGS -pthread"
+else
+ AC_CHECK_LIB(pthread,pthread_create,myapp_threads=-lpthread,
+ [AC_CHECK_LIB(c_r,pthread_create,myapp_threads=-lc_r)])
+fi
+
+
# sigsetjmp is a macro on some platforms, so can't use AC_CHECK_FUNCS
AC_MSG_CHECKING(for sigsetjmp)
AC_TRY_LINK([#include <setjmp.h>], [
View
34 src/ChangeLog
@@ -1,3 +1,37 @@
+2004-09-15 Ravindra <rkumar@novell.com>
+
+ * graphics.c: Applied a fix from David Mitchell for bug #65963
+ in GdipDeleteGraphics function.
+
+2004-09-10 Ravindra <rkumar@novell.com>
+
+ * gdip.h: Corrected a value in PathPointType enum.
+ * font.c: Fixed GdipGetEmHeight and GdipGetLineSpacing functions.
+ * image.c: In GdipDrawImageRect function, reset the cairo matrix
+ after drawing the image.
+
+2004-08-05 Ravindra <rkumar@novell.com>
+
+ * font.c: Fixed GdipDeleteFont function.
+
+2004-07-30 Ravindra <rkumar@novell.com>
+
+ * graphics.c: Commented out cairo_clip calls from GdipDrawString,
+ as these were causing problems. Thanks to Peter for suggesting this
+ fix. This fixes, bug #60386, #60663, #61414. These bugs were actually
+ because of some problem with Cairo clipping. And, these are not
+ reproducable with Cairo cvs, because Cairo seems to have some changes
+ which have solved the problem with clipping in Cairo.
+
+2004-07-07 Ravindra <rkumar@novell.com>
+
+ * pngcodec.c: Fixes bug #61156 and one perf improvement in
+ image loading.
+
+2004-06-29 Jordi Mas <jordi@ximian.com>
+
+ * pngcodec.c: fixes saving 24-bit images (it was saving corrupted files before)
+
2004-06-29 Jordi Mas <jordi@ximian.com>
* tiffcodec.c: fixes saving images to stream. It was giving an exception
View
29 src/font.c
@@ -349,10 +349,14 @@ GdipGetEmHeight (GDIPCONST GpFontFamily *family, GpFontStyle style, short *EmHei
GdipCreateFont (family, 0.0f, style, UnitPoint, &font);
- if (font){
+ if (font) {
TT_VertHeader *pVert = FT_Get_Sfnt_Table (font->cairofnt->face, ft_sfnt_vhea);
- rslt = pVert->yMax_Extent;
-
+ if (pVert)
+ rslt = pVert->yMax_Extent;
+ else if (font->cairofnt->face)
+ rslt = font->cairofnt->face->units_per_EM;
+ else
+ rslt = 0;
GdipDeleteFont (font);
}
@@ -371,7 +375,7 @@ GdipGetCellAscent (GDIPCONST GpFontFamily *family, GpFontStyle style, short *Cel
GdipCreateFont (family, 0.0f, style, UnitPoint, &font);
- if (font){
+ if (font) {
TT_HoriHeader *pHori = FT_Get_Sfnt_Table (font->cairofnt->face, ft_sfnt_hhea);
if (pHori)
@@ -397,7 +401,7 @@ GdipGetCellDescent (GDIPCONST GpFontFamily *family, GpFontStyle style, short *Ce
GdipCreateFont (family, 0.0f, style, UnitPoint, &font);
- if (font){
+ if (font) {
TT_HoriHeader *pHori = FT_Get_Sfnt_Table (font->cairofnt->face, ft_sfnt_hhea);
if (pHori)
@@ -421,9 +425,14 @@ GdipGetLineSpacing (GDIPCONST GpFontFamily *family, GpFontStyle style, short *Li
GdipCreateFont (family, 0.0f, style, UnitPoint, &font);
- if (font){
+ if (font) {
TT_HoriHeader *pHori = FT_Get_Sfnt_Table (font->cairofnt->face, ft_sfnt_hhea);
- rslt = pHori->Ascender + (-pHori->Descender) + pHori->Line_Gap;
+ if (pHori)
+ rslt = pHori->Ascender + (-pHori->Descender) + pHori->Line_Gap;
+ else if (font->cairofnt->face)
+ rslt = font->cairofnt->face->height;
+ else
+ rslt = 0;
GdipDeleteFont (font);
}
@@ -559,13 +568,13 @@ GdipDeleteFont (GpFont* font)
{
if (font) {
cairo_font_destroy ((cairo_font_t *)font->cairofnt);
- GdipFree ((void *)font);
if (font->wineHfont) {
DeleteWineFont(font->wineHfont);
}
- return Ok;
+ GdipFree ((void *)font);
+ return Ok;
}
- return InvalidParameter;
+ return InvalidParameter;
}
static GpStatus
View
2  src/gdip.h
@@ -328,7 +328,7 @@ typedef enum {
PathPointTypePathDashMode = 0x10,
PathPointTypePathMarker = 0x20,
PathPointTypeCloseSubpath = 0x80,
- PathPointTypeBezier3 = 0x30
+ PathPointTypeBezier3 = 0x03
} GpPathPointType, PathPointType;
typedef enum {
View
14 src/graphics.c
@@ -348,6 +348,9 @@ GdipDeleteGraphics (GpGraphics *graphics)
cairo_destroy (graphics->ct);
graphics->ct = NULL;
+ if (graphics->image)
+ ((GpImage*) graphics->image)->graphics = NULL;
+
GdipFree (graphics);
return Ok;
@@ -2155,9 +2158,13 @@ MeasureOrDrawString (GpGraphics *graphics, GDIPCONST WCHAR *stringUnicode, int l
#ifdef DRAWSTRING_DEBUG
printf("Setting clipping rectangle (%d, %d %dx%d)\n", rc->X, rc->Y, rc->Width, rc->Height);
#endif
- cairo_init_clip (graphics->ct);
+ /* Commented following clipping lines to fix DrawString bugs */
+ /* cairo cvs seems to have fixed something which lets us */
+ /* uncomment following clipping lines */
+
+ /* cairo_init_clip (graphics->ct); */
cairo_rectangle (graphics->ct, rc->X, rc->Y, rc->Width, rc->Height);
- cairo_clip (graphics->ct);
+ /* cairo_clip (graphics->ct); */
cairo_new_path (graphics->ct);
}
@@ -2307,7 +2314,8 @@ MeasureOrDrawString (GpGraphics *graphics, GDIPCONST WCHAR *stringUnicode, int l
Done:
/* We need to remove the clip region */
- cairo_init_clip (graphics->ct);
+ /* Following line is commented to fix the DrawString bugs */
+ /* cairo_init_clip (graphics->ct); */
/* Cleanup */
free (CleanString);
View
5 src/image.c
@@ -201,10 +201,11 @@ GdipDrawImageRect (GpGraphics *graphics, GpImage *image, float x, float y, float
(double) width / image->width,
(double) height / image->height);
cairo_fill (graphics->ct);
- cairo_default_matrix (graphics->ct);
} else
cairo_fill (graphics->ct);
-
+
+ cairo_default_matrix (graphics->ct);
+
return Ok;
}
View
59 src/pngcodec.c
@@ -174,28 +174,39 @@ gdip_load_png_image_from_file_or_stream (FILE *fp,
rawdata = GdipAlloc (stride * height);
rawptr = rawdata;
- for (i = 0; i < height; i++) {
- if (channels == 4) {
- memcpy (rawptr, row_pointers[i], stride);
- rawptr += stride;
- } else if (channels == 3) {
- png_bytep rowp = row_pointers[i];
- for (j = 0; j < width; j++) {
- *rawptr++ = *rowp++;
- *rawptr++ = *rowp++;
- *rawptr++ = *rowp++;
- *rawptr++ = 255; /* a */
- }
- } else if (channels == 1) {
- png_bytep rowp = row_pointers[i];
- for (j = 0; j < width; j++) {
- png_byte pix = *rowp++;
- *rawptr++ = pix;
- *rawptr++ = pix;
- *rawptr++ = pix;
- *rawptr++ = 255;
- }
- }
+ switch (channels) {
+
+ case 4:
+ for (i = 0; i < height; i++) {
+ memcpy (rawptr, row_pointers[i], stride);
+ rawptr += stride;
+ }
+ break;
+
+ case 3:
+ for (i = 0; i < height; i++) {
+ png_bytep rowp = row_pointers[i];
+ for (j = 0; j < width; j++) {
+ *rawptr++ = *rowp++;
+ *rawptr++ = *rowp++;
+ *rawptr++ = *rowp++;
+ *rawptr++ = 255; /* a */
+ }
+ }
+ break;
+
+ case 1:
+ for (i = 0; i < height; i++) {
+ png_bytep rowp = row_pointers[i];
+ for (j = 0; j < width; j++) {
+ png_byte pix = *rowp++;
+ *rawptr++ = pix;
+ *rawptr++ = pix;
+ *rawptr++ = pix;
+ *rawptr++ = 255;
+ }
+ }
+ break;
}
png_destroy_read_struct (&png_ptr, &info_ptr, &end_info_ptr);
@@ -348,10 +359,10 @@ gdip_save_png_image_to_file_or_stream (FILE *fp,
case Format32bppPArgb:
color_type = PNG_COLOR_TYPE_RGB_ALPHA;
break;
+
+ break;
case Format32bppRgb:
case Format24bppRgb:
- color_type = PNG_COLOR_TYPE_RGB;
- break;
case Format8bppIndexed:
color_type = PNG_COLOR_TYPE_RGB; /* XXX - we should be able to write grayscale PNGs */
break;
Please sign in to comment.
Something went wrong with that request. Please try again.