summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h')
-rw-r--r--Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h30
1 files changed, 23 insertions, 7 deletions
diff --git a/Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h b/Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h
index 924f69a..2bc290b 100644
--- a/Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h
+++ b/Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h
@@ -31,6 +31,7 @@
#include "GraphicsContext.h"
#include "ContextShadow.h"
+#include "PlatformContextCairo.h"
#include "RefPtrCairo.h"
#include <cairo.h>
#include <math.h>
@@ -67,8 +68,8 @@ private:
class GraphicsContextPlatformPrivate {
public:
- GraphicsContextPlatformPrivate()
- : cr(0)
+ GraphicsContextPlatformPrivate(PlatformContextCairo* newPlatformContext)
+ : platformContext(newPlatformContext)
#if PLATFORM(GTK)
, expose(0)
#elif PLATFORM(WIN)
@@ -82,7 +83,6 @@ public:
~GraphicsContextPlatformPrivate()
{
- cairo_destroy(cr);
}
#if PLATFORM(WIN)
@@ -99,7 +99,7 @@ public:
void setCTM(const AffineTransform&);
void beginTransparencyLayer() { m_transparencyCount++; }
void endTransparencyLayer() { m_transparencyCount--; }
- void syncContext(PlatformGraphicsContext* cr);
+ void syncContext(cairo_t* cr);
#else
// On everything else, we do nothing.
void save() {}
@@ -114,12 +114,11 @@ public:
void setCTM(const AffineTransform&) {}
void beginTransparencyLayer() {}
void endTransparencyLayer() {}
- void syncContext(PlatformGraphicsContext* cr) {}
+ void syncContext(cairo_t* cr) {}
#endif
- cairo_t* cr;
+ PlatformContextCairo* platformContext;
Vector<float> layers;
-
ContextShadow shadow;
Vector<ContextShadow> shadowStack;
Vector<ImageMaskInformation> maskImageStack;
@@ -133,6 +132,23 @@ public:
#endif
};
+// This is a specialized private section for the Cairo GraphicsContext, which knows how
+// to clean up the heap allocated PlatformContextCairo that we must use for the top-level
+// GraphicsContext.
+class GraphicsContextPlatformPrivateToplevel : public GraphicsContextPlatformPrivate {
+public:
+ GraphicsContextPlatformPrivateToplevel(PlatformContextCairo* platformContext)
+ : GraphicsContextPlatformPrivate(platformContext)
+ {
+ }
+
+ ~GraphicsContextPlatformPrivateToplevel()
+ {
+ delete platformContext;
+ }
+};
+
+
} // namespace WebCore
#endif // GraphicsContextPlatformPrivateCairo_h