2006-02-22 01:44:31 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
2012-05-21 11:12:37 +00: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/. */
|
2006-02-22 01:44:31 +00:00
|
|
|
|
|
|
|
#ifndef GFX_QUARTZSURFACE_H
|
|
|
|
#define GFX_QUARTZSURFACE_H
|
|
|
|
|
|
|
|
#include "gfxASurface.h"
|
2013-10-07 23:15:59 +00:00
|
|
|
#include "nsSize.h"
|
|
|
|
#include "gfxPoint.h"
|
2006-02-22 01:44:31 +00:00
|
|
|
|
|
|
|
#include <Carbon/Carbon.h>
|
|
|
|
|
2010-04-06 02:28:54 +00:00
|
|
|
class gfxContext;
|
2013-10-07 23:15:59 +00:00
|
|
|
class gfxImageSurface;
|
2010-04-06 02:28:54 +00:00
|
|
|
|
2013-05-29 21:59:24 +00:00
|
|
|
class gfxQuartzSurface : public gfxASurface {
|
2006-02-22 01:44:31 +00:00
|
|
|
public:
|
2014-09-24 21:16:54 +00:00
|
|
|
gfxQuartzSurface(const gfxSize& size, gfxImageFormat format);
|
|
|
|
gfxQuartzSurface(CGContextRef context, const gfxSize& size);
|
2015-06-01 08:26:19 +00:00
|
|
|
gfxQuartzSurface(CGContextRef context, const mozilla::gfx::IntSize& size);
|
|
|
|
gfxQuartzSurface(cairo_surface_t *csurf, const mozilla::gfx::IntSize& aSize);
|
2014-09-24 21:16:54 +00:00
|
|
|
gfxQuartzSurface(unsigned char *data, const gfxSize& size, long stride, gfxImageFormat format);
|
2015-06-01 08:26:19 +00:00
|
|
|
gfxQuartzSurface(unsigned char *data, const mozilla::gfx::IntSize& size, long stride, gfxImageFormat format);
|
2006-02-22 01:44:31 +00:00
|
|
|
|
|
|
|
virtual ~gfxQuartzSurface();
|
|
|
|
|
2010-05-31 23:37:44 +00:00
|
|
|
virtual already_AddRefed<gfxASurface> CreateSimilarSurface(gfxContentType aType,
|
2015-06-01 08:26:19 +00:00
|
|
|
const mozilla::gfx::IntSize& aSize);
|
2010-05-31 23:37:44 +00:00
|
|
|
|
2015-06-01 08:26:19 +00:00
|
|
|
virtual const mozilla::gfx::IntSize GetSize() const { return mozilla::gfx::IntSize(mSize.width, mSize.height); }
|
2006-02-22 01:44:31 +00:00
|
|
|
|
|
|
|
CGContextRef GetCGContext() { return mCGContext; }
|
2006-11-28 21:10:05 +00:00
|
|
|
|
2010-04-06 02:28:54 +00:00
|
|
|
CGContextRef GetCGContextWithClip(gfxContext *ctx);
|
|
|
|
|
2010-11-11 20:31:23 +00:00
|
|
|
already_AddRefed<gfxImageSurface> GetAsImageSurface();
|
|
|
|
|
2006-02-22 01:44:31 +00:00
|
|
|
protected:
|
2011-09-13 14:49:01 +00:00
|
|
|
void MakeInvalid();
|
|
|
|
|
2006-02-22 01:44:31 +00:00
|
|
|
CGContextRef mCGContext;
|
2008-01-07 00:50:18 +00:00
|
|
|
gfxSize mSize;
|
2006-02-22 01:44:31 +00:00
|
|
|
};
|
2007-02-08 20:47:48 +00:00
|
|
|
|
2006-02-22 01:44:31 +00:00
|
|
|
#endif /* GFX_QUARTZSURFACE_H */
|