head 1.2; access; symbols; locks; strict; comment @// @; 1.2 date 2014.05.30.10.22.05; author pho; state dead; branches; next 1.1; commitid pujOAy5YvcBW3yCx; 1.1 date 2014.05.28.15.11.29; author pho; state Exp; branches; next ; commitid TaefekdY7BfKJjCx; desc @@ 1.2 log @PR pkg/48840: Remove most patches that I have recently added The preprocessor macro XP_MACOSX is misused everywhere. They tend to say "#if defined(XP_MACOSX)" to actually mean "#if defined(MOZ_WIDGET_COCOA)". It's okay to equate XP_MACOSX with XP_DARWIN but equating it with MOZ_WIDGET_COCOA is just wrong. As a result, cairo-gtk2 build on Darwin is completely broken and needs heavy patching. Ideally they should be fixed individually but that will be an extremely hard work, so don't define XP_MACOSX for now. @ text @$NetBSD: patch-gfx_src_nsDeviceContext.cpp,v 1.1 2014/05/28 15:11:29 pho Exp $ * gfxPDFSurface.h must be included whenever MOZ_PDF_PRINTING is defined. In fact !defined(MOZ_WIDGET_COCOA) nearly equals to defined(MOZ_PDF_PRINTING) but it isn't the same as !defined(XP_MACOSX). In short cocoa toolkit is wrongly assumed here too. * Don't assume cocoa toolkit just because OS_ARCH is Darwin. --- gfx/src/nsDeviceContext.cpp.orig 2014-05-06 22:55:35.000000000 +0000 +++ gfx/src/nsDeviceContext.cpp @@@@ -35,7 +35,7 @@@@ #include "nsThreadUtils.h" // for NS_IsMainThread #include "nsTraceRefcnt.h" // for MOZ_COUNT_CTOR, etc -#if !XP_MACOSX +#if defined(MOZ_PDF_PRINTING) #include "gfxPDFSurface.h" #endif @@@@ -45,7 +45,7 @@@@ #include "gfxWindowsSurface.h" #elif defined(XP_OS2) #include "gfxOS2Surface.h" -#elif XP_MACOSX +#elif defined(MOZ_WIDGET_COCOA) #include "gfxQuartzSurface.h" #endif @@@@ -392,7 +392,7 @@@@ nsresult nsDeviceContext::CreateRenderingContext(nsRenderingContext *&aContext) { nsRefPtr printingSurface = mPrintingSurface; -#ifdef XP_MACOSX +#ifdef MOZ_WIDGET_COCOA // CreateRenderingContext() can be called (on reflow) after EndPage() // but before BeginPage(). On OS X (and only there) mPrintingSurface // will in this case be null, because OS X printing surfaces are @@@@ -551,7 +551,7 @@@@ nsDeviceContext::BeginPage(void) if (NS_FAILED(rv)) return rv; -#ifdef XP_MACOSX +#ifdef MOZ_WIDGET_COCOA // We need to get a new surface for each page on the Mac, as the // CGContextRefs are only good for one page. mDeviceContextSpec->GetSurfaceForPrinter(getter_AddRefs(mPrintingSurface)); @@@@ -567,7 +567,7 @@@@ nsDeviceContext::EndPage(void) { nsresult rv = mPrintingSurface->EndPage(); -#ifdef XP_MACOSX +#ifdef MOZ_WIDGET_COCOA // We need to release the CGContextRef in the surface here, plus it's // not something you would want anyway, as these CGContextRefs are only // good for one page. But we need to keep a cached reference to it, since @@@@ -674,7 +674,7 @@@@ nsDeviceContext::CalcPrintingSize() break; #endif -#ifdef XP_MACOSX +#ifdef MOZ_WIDGET_COCOA case gfxSurfaceType::Quartz: inPoints = true; // this is really only true when we're printing size = reinterpret_cast(mPrintingSurface.get())->GetSize(); @ 1.1 log @PR pkg/48840: Don't assume cocoa toolkit just because OS_ARCH is Darwin @ text @d1 1 a1 1 $NetBSD$ @