diff --git a/gfx/src/cairo/Makefile.in b/gfx/src/cairo/Makefile.in index 44898fab9cd9..a126b4b5fe04 100644 --- a/gfx/src/cairo/Makefile.in +++ b/gfx/src/cairo/Makefile.in @@ -67,7 +67,7 @@ REQUIRES = xpcom \ dom \ debug \ imglib2 \ - $(ZLIB_REQUIRES) \ + $(ZLIB_REQUIRES) \ $(NULL) CPPSRCS = \ @@ -98,13 +98,21 @@ EXTRA_DSO_LDOPTS += \ $(MOZ_COMPONENT_LIBS) \ $(MOZ_UNICHARUTIL_LIBS) \ $(MOZ_JS_LIBS) \ + $(TK_LIBS) \ $(NULL) include $(topsrcdir)/config/rules.mk -ifdef MOZ_ENABLE_GTK2 -EXTRA_DSO_LDOPTS += $(MOZ_GTK_LDFLAGS) $(MOZ_XFT_LIBS) $(MOZ_GTK2_LIBS) -CXXFLAGS += $(MOZ_GTK_CFLAGS) $(MOZ_XFT_CFLAGS) $(MOZ_GTK2_CFLAGS) -DMOZ_ENABLE_GTK2 -DMOZ_ENABLE_XFT -CFLAGS += $(MOZ_GTK_CFLAGS) $(MOZ_XFT_CFLAGS) $(MOZ_GTK2_CFLAGS) -DMOZ_ENABLE_GTK2 -DMOZ_ENABLE_XFT +CXXFLAGS += $(TK_CFLAGS) +CFLAGS += $(TK_CFLAGS) + +ifdef MOZ_ENABLE_XFT +CXXFLAGS += $(MOZ_XFT_CFLAGS) +CFLAGS += $(MOZ_XFT_CFLAGS) +EXTRA_DSO_LDOPTS += $(MOZ_XFT_LIBS) +endif + +ifdef MOZ_ENABLE_GTK2 +DEFINES += -DMOZ_ENABLE_GTK2 endif diff --git a/gfx/src/cairo/nsCairoDeviceContext.cpp b/gfx/src/cairo/nsCairoDeviceContext.cpp index 61447884bd81..e5a82fbf7d7b 100644 --- a/gfx/src/cairo/nsCairoDeviceContext.cpp +++ b/gfx/src/cairo/nsCairoDeviceContext.cpp @@ -937,7 +937,7 @@ xlfd_from_pango_font_description(GtkWidget *aWidget, PangoXSubfont *subfont_ids; PangoFontMap *fontmap; int *subfont_charsets, i, count = 0; - char *tmp, *subfont; + char *subfont; char *encodings[] = { "ascii-0", "big5-0", diff --git a/gfx/src/cairo/nsCairoDeviceContext.h b/gfx/src/cairo/nsCairoDeviceContext.h index ca9eefe7c614..3ab1c2a17486 100644 --- a/gfx/src/cairo/nsCairoDeviceContext.h +++ b/gfx/src/cairo/nsCairoDeviceContext.h @@ -46,6 +46,9 @@ #include "nsDeviceContext.h" #include +#ifdef MOZ_X11 +#include +#endif #ifdef MOZ_ENABLE_XLIB #include "xlibrgb.h" diff --git a/gfx/src/cairo/nsCairoDrawingSurface.cpp b/gfx/src/cairo/nsCairoDrawingSurface.cpp index 0bccae09cb20..5fda2b3ec66b 100644 --- a/gfx/src/cairo/nsCairoDrawingSurface.cpp +++ b/gfx/src/cairo/nsCairoDrawingSurface.cpp @@ -220,6 +220,7 @@ nsCairoDrawingSurface::Lock (PRInt32 aX, PRInt32 aY, PRUint32 aWidth, PRUint32 a NS_ASSERTION(aY + aHeight <= mHeight, "Invalid aY/aHeight"); NS_ASSERTION(mLockFlags == 0, "nsCairoDrawingSurface::Lock while surface is already locked!"); +#if 0 if (!mFastAccess) { mImageSurface = cairo_surface_get_image (mSurface); } @@ -238,13 +239,13 @@ nsCairoDrawingSurface::Lock (PRInt32 aX, PRInt32 aY, PRUint32 aWidth, PRUint32 a } return NS_ERROR_FAILURE; } - *aBits = data + (stride * aY) + (aX * (depth / 8)); *aStride = stride; *aWidthBytes = width * (depth / 8); mLockFlags = 0; +#endif return NS_OK; } @@ -260,7 +261,7 @@ nsCairoDrawingSurface::Unlock (void) if (mLockFlags & NS_LOCK_SURFACE_WRITE_ONLY) { /* need to copy back */ - cairo_surface_set_image (mSurface, mImageSurface); + //cairo_surface_set_image (mSurface, mImageSurface); } cairo_surface_destroy (mImageSurface); diff --git a/gfx/src/cairo/nsCairoImage.cpp b/gfx/src/cairo/nsCairoImage.cpp index dff7dca7df4a..0f97b989754e 100644 --- a/gfx/src/cairo/nsCairoImage.cpp +++ b/gfx/src/cairo/nsCairoImage.cpp @@ -65,7 +65,7 @@ nsCairoImage::~nsCairoImage() nsMemory::Free(mImageSurfaceAlpha); } -NS_IMPL_ISUPPORTS1(nsCairoImage, nsIImage); +NS_IMPL_ISUPPORTS1(nsCairoImage, nsIImage) ////////////////////////////////////////////// //// nsIImage diff --git a/gfx/src/cairo/nsCairoRenderingContext.cpp b/gfx/src/cairo/nsCairoRenderingContext.cpp index 658e66408584..8d310a40f53e 100644 --- a/gfx/src/cairo/nsCairoRenderingContext.cpp +++ b/gfx/src/cairo/nsCairoRenderingContext.cpp @@ -739,7 +739,6 @@ nsCairoRenderingContext::CopyOffScreenBits(nsIDrawingSurface *aSrcSurf, PRUint32 aCopyFlags) { nsCairoDrawingSurface *cds = (nsCairoDrawingSurface *) aSrcSurf; - cairo_surface_t *src = cds->GetCairoSurface(); fprintf (stderr, "***** nsCairoRenderingContext::CopyOffScreenBits: [%p] %d,%d -> %d,%d %dx%d\n", aSrcSurf, aSrcX, aSrcY, aDestBounds.x, aDestBounds.y, aDestBounds.width, aDestBounds.height); @@ -1012,7 +1011,7 @@ nsCairoRenderingContext::SetFont(const nsFont& aFont, nsIAtom* aLangGroup) NS_IMETHODIMP nsCairoRenderingContext::SetFont(nsIFontMetrics *aFontMetrics) { - mFontMetrics = aFontMetrics; + mFontMetrics = NS_STATIC_CAST(nsICairoFontMetrics*, aFontMetrics); return NS_OK; } @@ -1186,7 +1185,7 @@ nsCairoRenderingContext::DrawString(const nsString& aString, } NS_IMETHODIMP -nsCairoRenderingContext:: RenderPostScriptDataFragment(const unsigned char *psdata, unsigned long psdatalen) +nsCairoRenderingContext::RenderEPS(const nsRect& aRect, FILE *aDataFile) { - return NS_OK; + return NS_ERROR_NOT_IMPLEMENTED; } diff --git a/gfx/src/cairo/nsCairoRenderingContext.h b/gfx/src/cairo/nsCairoRenderingContext.h index 5e491eeb28a9..360c3f4856f0 100644 --- a/gfx/src/cairo/nsCairoRenderingContext.h +++ b/gfx/src/cairo/nsCairoRenderingContext.h @@ -187,7 +187,6 @@ public: NS_IMETHOD ReleaseBackbuffer(void); NS_IMETHOD DestroyCachedBackbuffer(void); NS_IMETHOD UseBackbuffer(PRBool* aUseBackbuffer); - NS_IMETHOD RenderPostScriptDataFragment(const unsigned char *psdata, unsigned long psdatalen); #ifdef MOZ_MATHML NS_IMETHOD GetBoundingMetrics(const char* aString, PRUint32 aLength, nsBoundingMetrics& aBoundingMetrics); NS_IMETHOD GetBoundingMetrics(const PRUnichar* aString, PRUint32 aLength, @@ -205,6 +204,8 @@ public: NS_IMETHOD SetRightToLeftText(PRBool aIsRTL) { return NS_OK; } + NS_IMETHOD RenderEPS(const nsRect& aRect, FILE *aDataFile); + // Cairo specific stuff cairo_t *GetCairo() { return mCairo; } diff --git a/gfx/src/cairo/nsFontMetricsXft.cpp b/gfx/src/cairo/nsFontMetricsXft.cpp index 91f5902d5f4a..151176f1781f 100644 --- a/gfx/src/cairo/nsFontMetricsXft.cpp +++ b/gfx/src/cairo/nsFontMetricsXft.cpp @@ -348,8 +348,6 @@ nsFontMetricsXft::nsFontMetricsXft(): mMiniFont(nsnull) nsFontMetricsXft::~nsFontMetricsXft() { - delete mFont; - if (mDeviceContext) mDeviceContext->FontMetricsDeleted(this);