From 1783d5834e8a32866d82b33f8fe7c3367d836a5b Mon Sep 17 00:00:00 2001 From: "vladimir%pobox.com" Date: Mon, 16 Aug 2004 03:29:26 +0000 Subject: [PATCH] cairo: fix drawing surface compilation --- gfx/src/cairo/nsCairoDrawingSurface.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gfx/src/cairo/nsCairoDrawingSurface.cpp b/gfx/src/cairo/nsCairoDrawingSurface.cpp index 127c45e5c46..380fb096cbd 100644 --- a/gfx/src/cairo/nsCairoDrawingSurface.cpp +++ b/gfx/src/cairo/nsCairoDrawingSurface.cpp @@ -37,6 +37,7 @@ * ***** END LICENSE BLOCK ***** */ #include "nsCairoDrawingSurface.h" +#include "nsCairoDeviceContext.h" #if defined(MOZ_ENABLE_GTK2) #include @@ -110,7 +111,7 @@ nsCairoDrawingSurface::Init (nsCairoDeviceContext *aDC, nsIWidget *aWidget) nsNativeWidget nativeWidget = aWidget->GetNativeData(NS_NATIVE_WIDGET); #ifdef MOZ_ENABLE_GTK2 - NS_ASSERTION (GDK_IS_WINDOW(aNativeWidget), "unsupported native widget type!"); + NS_ASSERTION (GDK_IS_WINDOW(nativeWidget), "unsupported native widget type!"); mSurface = cairo_xlib_surface_create (GDK_WINDOW_XDISPLAY(GDK_DRAWABLE(nativeWidget)), GDK_WINDOW_XWINDOW(GDK_DRAWABLE(nativeWidget)), @@ -119,8 +120,8 @@ nsCairoDrawingSurface::Init (nsCairoDeviceContext *aDC, nsIWidget *aWidget) GDK_COLORMAP_XCOLORMAP(gdk_drawable_get_colormap(GDK_DRAWABLE(nativeWidget)))); Window root_ignore; - int x_ignore, y_ignore, bwidth_ignore; - int width, height, depth; + int x_ignore, y_ignore; + unsigned int bwidth_ignore, width, height, depth; XGetGeometry(GDK_WINDOW_XDISPLAY(GDK_DRAWABLE(nativeWidget)), GDK_WINDOW_XWINDOW(GDK_DRAWABLE(nativeWidget)), @@ -141,6 +142,8 @@ nsCairoDrawingSurface::Init (nsCairoDeviceContext *aDC, nsIWidget *aWidget) mPixmap = 0; mLockFlags = 0; + + return NS_OK; } NS_IMETHODIMP @@ -183,7 +186,7 @@ nsCairoDrawingSurface::Lock (PRInt32 aX, PRInt32 aY, PRUint32 aWidth, PRUint32 a NS_IMETHODIMP nsCairoDrawingSurface::Unlock (void) { - NS_ASSERT(mLockFlags != 0, "nsCairoDrawingSurface::Unlock on non-locked surface!"); + NS_ASSERTION(mLockFlags != 0, "nsCairoDrawingSurface::Unlock on non-locked surface!"); if (mFastAccess) { mLockFlags = 0; @@ -192,7 +195,7 @@ nsCairoDrawingSurface::Unlock (void) if (mLockFlags & NS_LOCK_SURFACE_WRITE_ONLY) { /* need to copy back */ - cairo_surface_set_image (mImageSurface); + cairo_surface_set_image (mSurface, mImageSurface); } cairo_surface_destroy (mImageSurface);