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