diff --git a/gfx/thebes/gfxQuartzSurface.cpp b/gfx/thebes/gfxQuartzSurface.cpp index 71e4c001ad21..385da7e8ec00 100644 --- a/gfx/thebes/gfxQuartzSurface.cpp +++ b/gfx/thebes/gfxQuartzSurface.cpp @@ -81,6 +81,26 @@ gfxQuartzSurface::gfxQuartzSurface(CGContextRef context, unsigned int width = static_cast(mSize.width); unsigned int height = static_cast(mSize.height); + cairo_surface_t *surf = + cairo_quartz_surface_create_for_cg_context(context, + width, height); + + CGContextRetain(mCGContext); + + Init(surf); +} + +gfxQuartzSurface::gfxQuartzSurface(CGContextRef context, + const gfxIntSize& size, + bool aForPrinting) + : mCGContext(context), mSize(size), mForPrinting(aForPrinting) +{ + if (!CheckSurfaceSize(size)) + MakeInvalid(); + + unsigned int width = static_cast(mSize.width); + unsigned int height = static_cast(mSize.height); + cairo_surface_t *surf = cairo_quartz_surface_create_for_cg_context(context, width, height); diff --git a/gfx/thebes/gfxQuartzSurface.h b/gfx/thebes/gfxQuartzSurface.h index 1165cc75d740..ee61900cf158 100644 --- a/gfx/thebes/gfxQuartzSurface.h +++ b/gfx/thebes/gfxQuartzSurface.h @@ -50,6 +50,7 @@ class THEBES_API gfxQuartzSurface : public gfxASurface { public: gfxQuartzSurface(const gfxSize& size, gfxImageFormat format, bool aForPrinting = false); gfxQuartzSurface(CGContextRef context, const gfxSize& size, bool aForPrinting = false); + gfxQuartzSurface(CGContextRef context, const gfxIntSize& size, bool aForPrinting = false); gfxQuartzSurface(cairo_surface_t *csurf, bool aForPrinting = false); gfxQuartzSurface(unsigned char *data, const gfxSize& size, long stride, gfxImageFormat format, bool aForPrinting = false);