20 CGStateGuard::CGStateGuard(MacOSX::Util::CFScopeGuard<CGContextRef> &ctx)
23 assert(fCtx != 0 &&
"CGStateGuard, ctx parameter is null");
24 CGContextSaveGState(fCtx);
28 CGStateGuard::CGStateGuard(CGContextRef ctx)
31 assert(ctx != 0 &&
"CGStateGuard, ctx parameter is null");
32 CGContextSaveGState(ctx);
36 CGStateGuard::~CGStateGuard()
38 CGContextRestoreGState(fCtx);
45 CGAAStateGuard::CGAAStateGuard(CGContextRef ctx,
bool enable)
49 assert(ctx != 0 &&
"CGAAStateGuard, ctx parameter is null");
52 CGContextSetAllowsAntialiasing(ctx,
false);
56 CGAAStateGuard::~CGAAStateGuard()
60 CGContextSetAllowsAntialiasing(fCtx,
true);