backing out 412396 in an attempt to fix linux orange

This commit is contained in:
vladimir%pobox.com 2008-01-28 03:04:41 +00:00
Родитель 1d66a589ff
Коммит 4ca17a6979
10 изменённых файлов: 9 добавлений и 98 удалений

Просмотреть файл

@ -28,5 +28,3 @@ nonfatal-assertions.patch: Make assertions non-fatal
endian.patch: include cairo-platform.h for endian macros
fixed-24-8.patch: Switch fixed point mode from 16.16 to 24.8
quartz-get-image-surface.patch: Add cairo_quartz_get_image_surface API analogous to the win32 one

Просмотреть файл

@ -48,8 +48,6 @@ typedef struct cairo_quartz_surface {
void *imageData;
cairo_surface_t *imageSurfaceEquiv;
CGContextRef cgContext;
CGAffineTransform cgContextBaseCTM;

Просмотреть файл

@ -937,11 +937,6 @@ _cairo_quartz_get_image (cairo_quartz_surface_t *surface,
return CAIRO_STATUS_SUCCESS;
}
if (surface->imageSurfaceEquiv) {
*image_out = (cairo_image_surface_t*) cairo_surface_reference(surface->imageSurfaceEquiv);
return CAIRO_STATUS_SUCCESS;
}
if (CGBitmapContextGetBitsPerPixel(surface->cgContext) != 0) {
unsigned int stride;
unsigned int bitinfo;
@ -950,7 +945,6 @@ _cairo_quartz_get_image (cairo_quartz_surface_t *surface,
unsigned int color_comps;
imageData = (unsigned char *) CGBitmapContextGetData(surface->cgContext);
#ifdef USE_10_3_WORKAROUNDS
bitinfo = CGBitmapContextGetAlphaInfo (surface->cgContext);
#else
@ -1035,11 +1029,6 @@ _cairo_quartz_surface_finish (void *abstract_surface)
surface->cgContext = NULL;
if (surface->imageSurfaceEquiv) {
cairo_surface_destroy (surface->imageSurfaceEquiv);
surface->imageSurfaceEquiv = NULL;
}
if (surface->imageData) {
free (surface->imageData);
surface->imageData = NULL;
@ -1882,7 +1871,6 @@ _cairo_quartz_surface_create_internal (CGContextRef cgContext,
surface->cgContextBaseCTM = CGContextGetCTM (cgContext);
surface->imageData = NULL;
surface->imageSurfaceEquiv = NULL;
return surface;
}
@ -2037,7 +2025,6 @@ cairo_quartz_surface_create (cairo_format_t format,
}
surf->imageData = imageData;
surf->imageSurfaceEquiv = cairo_image_surface_create_for_data (imageData, format, width, height, stride);
return (cairo_surface_t *) surf;
}
@ -2165,14 +2152,3 @@ quartz_surface_to_png (cairo_quartz_surface_t *nq, char *dest)
#endif
}
cairo_surface_t *
cairo_quartz_surface_get_image (cairo_surface_t *surface)
{
cairo_quartz_surface_t *quartz = (cairo_quartz_surface_t*)surface;
if (cairo_surface_get_type(surface) != CAIRO_SURFACE_TYPE_QUARTZ)
return NULL;
return quartz->imageSurfaceEquiv;
}

Просмотреть файл

@ -57,9 +57,6 @@ cairo_quartz_surface_create_for_cg_context (CGContextRef cgContext,
cairo_public CGContextRef
cairo_quartz_surface_get_cg_context (cairo_surface_t *surface);
cairo_public cairo_surface_t *
cairo_quartz_surface_get_image (cairo_surface_t *surface);
CAIRO_END_DECLS
#else /* CAIRO_HAS_QUARTZ_SURFACE */

Просмотреть файл

@ -169,7 +169,6 @@
#define cairo_quartz_surface_create _moz_cairo_quartz_surface_create
#define cairo_quartz_surface_create_for_cg_context _moz_cairo_quartz_surface_create_for_cg_context
#define cairo_quartz_surface_get_cg_context _moz_cairo_quartz_surface_get_cg_context
#define cairo_quartz_surface_get_image _moz_cairo_quartz_surface_get_image
#define cairo_rectangle _moz_cairo_rectangle
#define cairo_rectangle_list_destroy _moz_cairo_rectangle_list_destroy
#define cairo_reference _moz_cairo_reference

Просмотреть файл

@ -111,7 +111,7 @@ nsThebesImage::Init(PRInt32 aWidth, PRInt32 aHeight, PRInt32 aDepth, nsMaskRequi
mFormat = format;
#if defined(XP_WIN)
#ifdef XP_WIN
if (!ShouldUseImageSurfaces()) {
mWinSurface = new gfxWindowsSurface(gfxIntSize(mWidth, mHeight), format);
if (mWinSurface && mWinSurface->CairoStatus() == 0) {
@ -120,22 +120,13 @@ nsThebesImage::Init(PRInt32 aWidth, PRInt32 aHeight, PRInt32 aDepth, nsMaskRequi
}
}
if (!mImageSurface)
if (!mImageSurface) {
mWinSurface = nsnull;
#elif defined(XP_MACOSX)
if (!ShouldUseImageSurfaces()) {
mQuartzSurface = new gfxQuartzSurface(gfxSize(mWidth, mHeight), format);
if (mQuartzSurface && mQuartzSurface->CairoStatus() == 0) {
mImageSurface = mQuartzSurface->GetImageSurface();
}
}
if (!mImageSurface)
mQuartzSurface = nsnull;
#endif
if (!mImageSurface)
mImageSurface = new gfxImageSurface(gfxIntSize(mWidth, mHeight), format);
}
#else
mImageSurface = new gfxImageSurface(gfxIntSize(mWidth, mHeight), format);
#endif
if (!mImageSurface || mImageSurface->CairoStatus()) {
mImageSurface = nsnull;
@ -307,11 +298,6 @@ nsThebesImage::Optimize(nsIDeviceContext* aContext)
}
#endif
#ifdef XP_MACOSX
if (mQuartzSurface && !mFormatChanged)
mOptSurface = mQuartzSurface;
#endif
if (mOptSurface == nsnull)
mOptSurface = gfxPlatform::GetPlatform()->OptimizeImage(mImageSurface, mFormat);
@ -319,9 +305,6 @@ nsThebesImage::Optimize(nsIDeviceContext* aContext)
mImageSurface = nsnull;
#ifdef XP_WIN
mWinSurface = nsnull;
#endif
#ifdef XP_MACOSX
mQuartzSurface = nsnull;
#endif
}

Просмотреть файл

@ -44,10 +44,8 @@
#include "gfxColor.h"
#include "gfxASurface.h"
#include "gfxImageSurface.h"
#if defined(XP_WIN)
#ifdef XP_WIN
#include "gfxWindowsSurface.h"
#elif defined(XP_MACOSX)
#include "gfxQuartzSurface.h"
#endif
class nsThebesImage : public nsIImage
@ -99,13 +97,7 @@ public:
gfxASurface* ThebesSurface() {
if (mOptSurface)
return mOptSurface;
#if defined(XP_WIN)
if (mWinSurface)
return mWinSurface;
#elif defined(XP_MACOSX)
if (mQuartzSurface)
return mQuartzSurface;
#endif
return mImageSurface;
}
@ -159,10 +151,8 @@ protected:
nsRefPtr<gfxImageSurface> mImageSurface;
nsRefPtr<gfxASurface> mOptSurface;
#if defined(XP_WIN)
#ifdef XP_WIN
nsRefPtr<gfxWindowsSurface> mWinSurface;
#elif defined(XP_MACOSX)
nsRefPtr<gfxQuartzSurface> mQuartzSurface;
#endif
PRUint8 mAlphaDepth;

Просмотреть файл

@ -40,7 +40,6 @@
#define GFX_QUARTZSURFACE_H
#include "gfxASurface.h"
#include "gfxImageSurface.h"
#include <Carbon/Carbon.h>
@ -58,8 +57,6 @@ public:
virtual PRInt32 GetDefaultContextFlags() const;
already_AddRefed<gfxImageSurface> GetImageSurface();
protected:
CGContextRef mCGContext;
gfxSize mSize;

Просмотреть файл

@ -94,23 +94,3 @@ gfxQuartzSurface::~gfxQuartzSurface()
{
CGContextRelease(mCGContext);
}
already_AddRefed<gfxImageSurface>
gfxQuartzSurface::GetImageSurface()
{
if (!mSurfaceValid) {
NS_WARNING ("GetImageSurface on an invalid (null) surface; who's calling this without checking for surface errors?");
return nsnull;
}
NS_ASSERTION(CairoSurface() != nsnull, "CairoSurface() shouldn't be nsnull when mSurfaceValid is TRUE!");
cairo_surface_t *isurf = cairo_quartz_surface_get_image(CairoSurface());
if (!isurf)
return nsnull;
nsRefPtr<gfxASurface> asurf = gfxASurface::Wrap(isurf);
gfxImageSurface *imgsurf = (gfxImageSurface*) asurf.get();
NS_ADDREF(imgsurf);
return imgsurf;
}

Просмотреть файл

@ -125,13 +125,6 @@ gfxWindowsSurface::~gfxWindowsSurface()
already_AddRefed<gfxImageSurface>
gfxWindowsSurface::GetImageSurface()
{
if (!mSurfaceValid) {
NS_WARNING ("GetImageSurface on an invalid (null) surface; who's calling this without checking for surface errors?");
return nsnull;
}
NS_ASSERTION(CairoSurface() != nsnull, "CairoSurface() shouldn't be nsnull when mSurfaceValid is TRUE!");
if (mForPrinting)
return nsnull;