Bumping manifests a=b2g-bump
[gecko.git] / gfx / thebes / gfxQuartzSurface.h
blobec26184b7e504a5c9193319c326f5e0e9e7736f2
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef GFX_QUARTZSURFACE_H
7 #define GFX_QUARTZSURFACE_H
9 #include "gfxASurface.h"
10 #include "nsSize.h"
11 #include "gfxPoint.h"
13 #include <Carbon/Carbon.h>
15 class gfxContext;
16 class gfxImageSurface;
18 class gfxQuartzSurface : public gfxASurface {
19 public:
20 gfxQuartzSurface(const gfxSize& size, gfxImageFormat format, bool aForPrinting = false);
21 gfxQuartzSurface(CGContextRef context, const gfxSize& size, bool aForPrinting = false);
22 gfxQuartzSurface(CGContextRef context, const gfxIntSize& size, bool aForPrinting = false);
23 gfxQuartzSurface(cairo_surface_t *csurf, const gfxIntSize& aSize, bool aForPrinting = false);
24 gfxQuartzSurface(unsigned char *data, const gfxSize& size, long stride, gfxImageFormat format, bool aForPrinting = false);
25 gfxQuartzSurface(unsigned char *data, const gfxIntSize& size, long stride, gfxImageFormat format, bool aForPrinting = false);
27 virtual ~gfxQuartzSurface();
29 virtual already_AddRefed<gfxASurface> CreateSimilarSurface(gfxContentType aType,
30 const gfxIntSize& aSize);
32 virtual const gfxIntSize GetSize() const { return gfxIntSize(mSize.width, mSize.height); }
34 CGContextRef GetCGContext() { return mCGContext; }
36 CGContextRef GetCGContextWithClip(gfxContext *ctx);
38 virtual int32_t GetDefaultContextFlags() const;
40 already_AddRefed<gfxImageSurface> GetAsImageSurface();
42 protected:
43 void MakeInvalid();
45 CGContextRef mCGContext;
46 gfxSize mSize;
47 bool mForPrinting;
50 #endif /* GFX_QUARTZSURFACE_H */