Bug 716639. Add a constructor for gfxQuartzSurface that takes a gfxIntSize. r=mwoodrow

--HG--
extra : rebase_source : ec2d4e1c76e504b794707d83e5f31580aee81fee
This commit is contained in:
Jeff Muizelaar 2011-12-13 09:58:11 -05:00
Родитель 6d5c14d658
Коммит 1b86e0c8e4
2 изменённых файлов: 21 добавлений и 0 удалений

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

@ -90,6 +90,26 @@ gfxQuartzSurface::gfxQuartzSurface(CGContextRef context,
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<unsigned int>(mSize.width);
unsigned int height = static_cast<unsigned int>(mSize.height);
cairo_surface_t *surf =
cairo_quartz_surface_create_for_cg_context(context,
width, height);
CGContextRetain(mCGContext);
Init(surf);
}
gfxQuartzSurface::gfxQuartzSurface(cairo_surface_t *csurf,
bool aForPrinting) :
mSize(-1.0, -1.0), mForPrinting(aForPrinting)

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

@ -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);