GraphicsContextPlatformPrivateCG.h [plain text]
#ifndef GraphicsContextPlatformPrivateCG_h
#define GraphicsContextPlatformPrivateCG_h
#include <wtf/RetainPtr.h>
#include <CoreGraphics/CGContext.h>
namespace WebCore {
enum GraphicsContextCGFlag {
IsLayerCGContext = 1 << 0,
IsAcceleratedCGContext = 1 << 1
};
typedef unsigned GraphicsContextCGFlags;
class GraphicsContextPlatformPrivate {
WTF_MAKE_FAST_ALLOCATED;
public:
GraphicsContextPlatformPrivate(CGContextRef cgContext, GraphicsContextCGFlags flags = 0)
: m_cgContext(cgContext)
#if PLATFORM(WIN)
, m_hdc(0)
, m_shouldIncludeChildWindows(false)
#endif
, m_userToDeviceTransformKnownToBeIdentity(false)
, m_contextFlags(flags)
{
}
#if PLATFORM(COCOA)
void save() {}
void restore() {}
void flush() {}
void clip(const FloatRect&) {}
void clip(const Path&) {}
void scale(const FloatSize&) {}
void rotate(float) {}
void translate(float, float) {}
void concatCTM(const AffineTransform&) {}
void setCTM(const AffineTransform&) {}
#endif
#if PLATFORM(WIN)
void save();
void restore();
void flush();
void clip(const FloatRect&);
void clip(const Path&);
void scale(const FloatSize&);
void rotate(float);
void translate(float, float);
void concatCTM(const AffineTransform&);
void setCTM(const AffineTransform&);
HDC m_hdc;
bool m_shouldIncludeChildWindows;
#endif
RetainPtr<CGContextRef> m_cgContext;
bool m_userToDeviceTransformKnownToBeIdentity;
GraphicsContextCGFlags m_contextFlags;
};
}
#endif // GraphicsContextPlatformPrivateCG_h