2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
2012-05-21 04:12:37 -07:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef GFX_QUARTZSURFACE_H
|
|
|
|
#define GFX_QUARTZSURFACE_H
|
|
|
|
|
|
|
|
#include "gfxASurface.h"
|
2013-10-07 16:15:59 -07:00
|
|
|
#include "nsSize.h"
|
|
|
|
#include "gfxPoint.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include <Carbon/Carbon.h>
|
|
|
|
|
2010-04-05 19:28:54 -07:00
|
|
|
class gfxContext;
|
2013-10-07 16:15:59 -07:00
|
|
|
class gfxImageSurface;
|
2010-04-05 19:28:54 -07:00
|
|
|
|
2013-05-29 14:59:24 -07:00
|
|
|
class gfxQuartzSurface : public gfxASurface {
|
2007-03-22 10:30:00 -07:00
|
|
|
public:
|
2014-09-24 14:16:54 -07:00
|
|
|
gfxQuartzSurface(const gfxSize& size, gfxImageFormat format);
|
|
|
|
gfxQuartzSurface(CGContextRef context, const gfxSize& size);
|
|
|
|
gfxQuartzSurface(CGContextRef context, const gfxIntSize& size);
|
|
|
|
gfxQuartzSurface(cairo_surface_t *csurf, const gfxIntSize& aSize);
|
|
|
|
gfxQuartzSurface(unsigned char *data, const gfxSize& size, long stride, gfxImageFormat format);
|
|
|
|
gfxQuartzSurface(unsigned char *data, const gfxIntSize& size, long stride, gfxImageFormat format);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
virtual ~gfxQuartzSurface();
|
|
|
|
|
2010-05-31 16:37:44 -07:00
|
|
|
virtual already_AddRefed<gfxASurface> CreateSimilarSurface(gfxContentType aType,
|
|
|
|
const gfxIntSize& aSize);
|
|
|
|
|
2010-09-07 17:36:57 -07:00
|
|
|
virtual const gfxIntSize GetSize() const { return gfxIntSize(mSize.width, mSize.height); }
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
CGContextRef GetCGContext() { return mCGContext; }
|
|
|
|
|
2010-04-05 19:28:54 -07:00
|
|
|
CGContextRef GetCGContextWithClip(gfxContext *ctx);
|
|
|
|
|
2010-11-11 12:31:23 -08:00
|
|
|
already_AddRefed<gfxImageSurface> GetAsImageSurface();
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
protected:
|
2011-09-13 07:49:01 -07:00
|
|
|
void MakeInvalid();
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
CGContextRef mCGContext;
|
2008-01-06 16:50:18 -08:00
|
|
|
gfxSize mSize;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* GFX_QUARTZSURFACE_H */
|