ROOT
v6-26
Reference Guide
Loading...
Searching...
No Matches
QuartzUtils.mm
Go to the documentation of this file.
1
// @(#)root/graf2d:$Id$
2
// Author: Timur Pocheptsov, 11/06/2012
3
4
/*************************************************************************
5
* Copyright (C) 1995-2011, Rene Brun and Fons Rademakers. *
6
* All rights reserved. *
7
* *
8
* For the licensing terms see $ROOTSYS/LICENSE. *
9
* For the list of contributors see $ROOTSYS/README/CREDITS. *
10
*************************************************************************/
11
12
#include <cassert>
13
14
#include "
QuartzUtils.h
"
15
16
namespace
ROOT
{
17
namespace
Quartz
{
18
19
//______________________________________________________________________________
20
CGStateGuard::CGStateGuard
(
MacOSX::Util::CFScopeGuard<CGContextRef>
&ctx)
21
: fCtx(ctx.Get())
22
{
23
assert(
fCtx
!= 0 &&
"CGStateGuard, ctx parameter is null"
);
24
CGContextSaveGState(
fCtx
);
25
}
26
27
//______________________________________________________________________________
28
CGStateGuard::CGStateGuard
(
CGContextRef
ctx)
29
: fCtx(ctx)
30
{
31
assert(ctx != 0 &&
"CGStateGuard, ctx parameter is null"
);
32
CGContextSaveGState(ctx);
33
}
34
35
//______________________________________________________________________________
36
CGStateGuard::~CGStateGuard
()
37
{
38
CGContextRestoreGState(
fCtx
);
39
}
40
41
//Actually, this class does any work only if you disable anti-aliasing, by default I have it on
42
//and there is nothing to do for a guard if you want it on.
43
44
//______________________________________________________________________________
45
CGAAStateGuard::CGAAStateGuard
(
CGContextRef
ctx,
bool
enable)
46
: fCtx(ctx),
47
fEnable(enable)
48
{
49
assert(ctx != 0 &&
"CGAAStateGuard, ctx parameter is null"
);
50
51
if
(!enable)
52
CGContextSetAllowsAntialiasing(ctx,
false
);
53
}
54
55
//______________________________________________________________________________
56
CGAAStateGuard::~CGAAStateGuard
()
57
{
58
//Enable it back:
59
if
(!
fEnable
)
60
CGContextSetAllowsAntialiasing(
fCtx
,
true
);
61
}
62
63
}
//Quartz
64
}
//ROOT
QuartzUtils.h
CGContextRef
ROOT::MacOSX::Util::CFScopeGuard
Definition
CocoaUtils.h:268
ROOT::Quartz::CGAAStateGuard::fCtx
CGContextRef fCtx
Definition
QuartzUtils.h:44
ROOT::Quartz::CGAAStateGuard::CGAAStateGuard
CGAAStateGuard(CGContextRef ctx, bool enable)
Definition
QuartzUtils.mm:45
ROOT::Quartz::CGAAStateGuard::fEnable
bool fEnable
Definition
QuartzUtils.h:45
ROOT::Quartz::CGAAStateGuard::~CGAAStateGuard
~CGAAStateGuard()
Definition
QuartzUtils.mm:56
ROOT::Quartz::CGStateGuard::CGStateGuard
CGStateGuard(MacOSX::Util::CFScopeGuard< CGContextRef > &ctx)
Definition
QuartzUtils.mm:20
ROOT::Quartz::CGStateGuard::fCtx
CGContextRef fCtx
Definition
QuartzUtils.h:30
ROOT::Quartz::CGStateGuard::~CGStateGuard
~CGStateGuard()
Definition
QuartzUtils.mm:36
ROOT::Quartz
Definition
QuartzFillArea.h:33
ROOT
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition
EExecutionPolicy.hxx:4
graf2d
quartz
src
QuartzUtils.mm
ROOT v6-26 - Reference Guide Generated on Mon Sep 11 2023 21:02:21 (GVA Time) using Doxygen 1.9.8