diff options
author | Steve Block <steveblock@google.com> | 2011-05-25 19:08:45 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-06-08 13:51:31 +0100 |
commit | 2bde8e466a4451c7319e3a072d118917957d6554 (patch) | |
tree | 28f4a1b869a513e565c7760d0e6a06e7cf1fe95a /Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h | |
parent | 6939c99b71d9372d14a0c74a772108052e8c48c8 (diff) | |
download | external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.zip external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.gz external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.bz2 |
Merge WebKit at r82507: Initial merge by git
Change-Id: I60ce9d780725b58b45e54165733a8ffee23b683e
Diffstat (limited to 'Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h')
-rw-r--r-- | Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h | 30 |
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 |