From c1023d97c64deff3394a224e484f2ad2597457c3 Mon Sep 17 00:00:00 2001 From: "cbiesinger%web.de" Date: Sat, 21 Jan 2006 15:58:24 +0000 Subject: [PATCH] bug 323551 make the in-tree cairo compile on beos (if a system-installed freetype and fontconfig is present) r=bsmedberg,vlad --- config/autoconf.mk.in | 3 +++ configure.in | 11 ++++++++++- .../canvas/src/nsCanvasRenderingContext2D.cpp | 2 +- .../html/content/src/nsHTMLCanvasElement.cpp | 2 +- gfx/cairo/cairo/src/Makefile.in | 17 +++++++++++++---- gfx/src/Makefile.in | 8 ++++---- 6 files changed, 32 insertions(+), 11 deletions(-) diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in index d569dba19f8..651003c7c07 100644 --- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in @@ -437,7 +437,10 @@ MOZ_TOOLKIT_REGISTRY_CFLAGS = \ -DGFXWIN_DLL=@GFXWIN_DLL@ \ $(TK_CFLAGS) +CAIRO_FT_CFLAGS = @CAIRO_FT_CFLAGS@ + MOZ_ENABLE_CAIRO_GFX = @MOZ_ENABLE_CAIRO_GFX@ +MOZ_ENABLE_CAIRO_FT = @MOZ_ENABLE_CAIRO_FT@ MOZ_ENABLE_GLITZ = @MOZ_ENABLE_GLITZ@ MOZ_ENABLE_GTK = @MOZ_ENABLE_GTK@ MOZ_ENABLE_GTK2 = @MOZ_ENABLE_GTK2@ diff --git a/configure.in b/configure.in index 44f60060e81..1d61990598e 100644 --- a/configure.in +++ b/configure.in @@ -6585,6 +6585,7 @@ if test "$MOZ_SVG_RENDERER_CAIRO" -o "$MOZ_ENABLE_CANVAS" -o "$MOZ_ENABLE_CAIRO_ if test "$MOZ_X11"; then XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1" FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1" + MOZ_ENABLE_CAIRO_FT=1 fi if test "$MOZ_WIDGET_TOOLKIT" = "mac" -o "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1" @@ -6597,6 +6598,14 @@ if test "$MOZ_SVG_RENDERER_CAIRO" -o "$MOZ_ENABLE_CANVAS" -o "$MOZ_ENABLE_CAIRO_ if test "$MOZ_ENABLE_GLITZ"; then GLITZ_SURFACE_FEATURE="#define CAIRO_HAS_GLITZ_SURFACE 1" fi + if test "$MOZ_WIDGET_TOOLKIT" = "beos"; then + PKG_CHECK_MODULES(CAIRO_FT, fontconfig freetype2) + BEOS_SURFACE_FEATURE="#define CAIRO_HAS_BEOS_SURFACE 1" + FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1" + MOZ_ENABLE_CAIRO_FT=1 + fi + AC_SUBST(MOZ_ENABLE_CAIRO_FT) + AC_SUBST(CAIRO_FT_CFLAGS) if test "$MOZ_DEBUG"; then SANITY_CHECKING_FEATURE="#define CAIRO_DO_SANITY_CHECKING 1" @@ -6627,7 +6636,7 @@ if test "$MOZ_SVG_RENDERER_CAIRO" -o "$MOZ_ENABLE_CANVAS" -o "$MOZ_ENABLE_CAIRO_ MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $(DIST)/lib/mozglitz.lib $(DIST)/lib/mozglitzwgl.lib" fi else - MOZ_CAIRO_LIBS="-lmozcairo -lmozlibpixman" + MOZ_CAIRO_LIBS="-lmozcairo -lmozlibpixman $CAIRO_FT_LIBS" if test "$MOZ_X11"; then MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender -lfreetype -lfontconfig" diff --git a/content/canvas/src/nsCanvasRenderingContext2D.cpp b/content/canvas/src/nsCanvasRenderingContext2D.cpp index 7b8a6a8caaa..21169a5af92 100644 --- a/content/canvas/src/nsCanvasRenderingContext2D.cpp +++ b/content/canvas/src/nsCanvasRenderingContext2D.cpp @@ -651,7 +651,7 @@ nsCanvasRenderingContext2D::UpdateImageFrame() *outrowrgb++ = 0; #endif -#ifdef XP_WIN +#if defined(XP_WIN) || defined(XP_OS2) || defined(XP_BEOS) || defined(MOZ_WIDGET_PHOTON) // On windows, RGB_A8 is really BGR_A8. // in fact, BGR_A8 is also BGR_A8. *outrowrgb++ = b; diff --git a/content/html/content/src/nsHTMLCanvasElement.cpp b/content/html/content/src/nsHTMLCanvasElement.cpp index 95b0b1f674f..d4780438c05 100644 --- a/content/html/content/src/nsHTMLCanvasElement.cpp +++ b/content/html/content/src/nsHTMLCanvasElement.cpp @@ -422,7 +422,7 @@ nsHTMLCanvasElement::UpdateImageContainer(PRBool forceCreate) if (!mImageFrame) return NS_ERROR_FAILURE; -#ifdef XP_WIN +#if defined(XP_WIN) || defined(XP_OS2) || defined(XP_BEOS) || defined(MOZ_WIDGET_PHOTON) rv = mImageFrame->Init(0, 0, sz.width, sz.height, gfxIFormats::BGR_A8, 24); #else rv = mImageFrame->Init(0, 0, sz.width, sz.height, gfxIFormats::RGB_A8, 24); diff --git a/gfx/cairo/cairo/src/Makefile.in b/gfx/cairo/cairo/src/Makefile.in index fe1605652be..3d5e5b38fb6 100644 --- a/gfx/cairo/cairo/src/Makefile.in +++ b/gfx/cairo/cairo/src/Makefile.in @@ -107,6 +107,10 @@ CSRCS += cairo-quartz-surface.c \ EXPORTS += cairo-quartz.h cairo-atsui.h endif +ifeq ($(MOZ_GFX_TOOLKIT),beos) +CPPSRCS += cairo-beos-surface.cpp +EXPORTS += cairo-beos.h +endif ifdef BUILD_CAIRO_PDF CSRCS += cairo-font-subset.c \ @@ -122,12 +126,17 @@ endif ifdef MOZ_X11 CSRCS += cairo-xlib-surface.c \ - cairo-xlib-screen.c \ - cairo-ft-font.c -EXPORTS += cairo-xlib.h cairo-xlib-xrender.h cairo-ft.h -LOCAL_INCLUDES += $(FT2_CFLAGS) + cairo-xlib-screen.c +EXPORTS += cairo-xlib.h cairo-xlib-xrender.h endif +ifdef MOZ_ENABLE_CAIRO_FT +CSRCS += cairo-ft-font.c +EXPORTS += cairo-ft.h +LOCAL_INCLUDES += $(CAIRO_FT_CFLAGS) +endif + + ifdef MOZ_ENABLE_GLITZ REQUIRES += glitz CSRCS += cairo-glitz-surface.c diff --git a/gfx/src/Makefile.in b/gfx/src/Makefile.in index 4c49ebb409b..fca766b6b57 100644 --- a/gfx/src/Makefile.in +++ b/gfx/src/Makefile.in @@ -75,10 +75,6 @@ ifeq ($(MOZ_GFX_TOOLKIT),cocoa) DIRS += mac endif -ifneq (,$(filter beos os2 mac,$(MOZ_GFX_TOOLKIT))) -DIRS += $(MOZ_GFX_TOOLKIT) -endif - # Build xlibrgb only for X toolkits and/or Xprint ifneq (,$(filter xlib,$(MOZ_WIDGET_TOOLKIT))$(MOZ_ENABLE_XLIB)$(MOZ_ENABLE_XPRINT)) DIRS += xlibrgb @@ -109,6 +105,10 @@ else ifeq ($(MOZ_GFX_TOOLKIT),windows) DIRS += windows endif + ifneq (,$(filter beos os2 mac,$(MOZ_GFX_TOOLKIT))) + DIRS += $(MOZ_GFX_TOOLKIT) + endif + endif CPPSRCS = \