<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[190894] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/190894">190894</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2015-10-12 15:36:03 -0700 (Mon, 12 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add a CGContextStateSaver and use it
https://bugs.webkit.org/show_bug.cgi?id=150049

Reviewed by Tim Horton.

Add a stack-based graphics state save/restore class for CGContext,
like the one we have for GraphicsContext, and use it in GraphicsContextCG.

* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::drawLine):
(WebCore::GraphicsContext::drawJoinedLines):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
(WebCore::GraphicsContext::strokeRect):
* platform/graphics/cg/GraphicsContextCG.h:
(WebCore::CGContextStateSaver::CGContextStateSaver):
(WebCore::CGContextStateSaver::~CGContextStateSaver):
(WebCore::CGContextStateSaver::save):
(WebCore::CGContextStateSaver::restore):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgGraphicsContextCGcpp">trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgGraphicsContextCGh">trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (190893 => 190894)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-12 22:33:03 UTC (rev 190893)
+++ trunk/Source/WebCore/ChangeLog        2015-10-12 22:36:03 UTC (rev 190894)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2015-10-12  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Add a CGContextStateSaver and use it
+        https://bugs.webkit.org/show_bug.cgi?id=150049
+
+        Reviewed by Tim Horton.
+
+        Add a stack-based graphics state save/restore class for CGContext,
+        like the one we have for GraphicsContext, and use it in GraphicsContextCG.
+        
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::GraphicsContext::drawNativeImage):
+        (WebCore::GraphicsContext::drawLine):
+        (WebCore::GraphicsContext::drawJoinedLines):
+        (WebCore::GraphicsContext::fillPath):
+        (WebCore::GraphicsContext::strokePath):
+        (WebCore::GraphicsContext::fillRect):
+        (WebCore::GraphicsContext::platformFillRoundedRect):
+        (WebCore::GraphicsContext::fillRectWithRoundedHole):
+        (WebCore::GraphicsContext::strokeRect):
+        * platform/graphics/cg/GraphicsContextCG.h:
+        (WebCore::CGContextStateSaver::CGContextStateSaver):
+        (WebCore::CGContextStateSaver::~CGContextStateSaver):
+        (WebCore::CGContextStateSaver::save):
+        (WebCore::CGContextStateSaver::restore):
+
</ins><span class="cx"> 2015-10-12  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         display: table-cell; bug when resizing window
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgGraphicsContextCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (190893 => 190894)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp        2015-10-12 22:33:03 UTC (rev 190893)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp        2015-10-12 22:36:03 UTC (rev 190894)
</span><span class="lines">@@ -154,7 +154,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     CGContextRef context = platformContext();
</span><del>-    CGContextSaveGState(context);
</del><ins>+    CGContextStateSaver stateSaver(context);
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     // Anti-aliasing is on by default on the iPhone. Need to turn it off when drawing images.
</span><span class="lines">@@ -241,8 +241,6 @@
</span><span class="cx"> 
</span><span class="cx">     // Draw the image.
</span><span class="cx">     CGContextDrawImage(context, adjustedDestRect, image.get());
</span><del>-
-    CGContextRestoreGState(context);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Draws a filled rectangle with a stroked border.
</span><span class="lines">@@ -292,12 +290,13 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     CGContextRef context = platformContext();
</span><ins>+
</ins><span class="cx">     StrokeStyle strokeStyle = this-&gt;strokeStyle();
</span><span class="cx">     float cornerWidth = 0;
</span><span class="cx">     bool drawsDashedLine = strokeStyle == DottedStroke || strokeStyle == DashedStroke;
</span><span class="cx"> 
</span><ins>+    CGContextStateSaver stateSaver(context, drawsDashedLine);
</ins><span class="cx">     if (drawsDashedLine) {
</span><del>-        CGContextSaveGState(context);
</del><span class="cx">         // Figure out end points to ensure we always paint corners.
</span><span class="cx">         cornerWidth = strokeStyle == DottedStroke ? thickness : std::min(2 * thickness, std::max(thickness, strokeWidth / 3));
</span><span class="cx">         setCGFillColor(context, strokeColor(), strokeColorSpace());
</span><span class="lines">@@ -311,10 +310,8 @@
</span><span class="cx">         strokeWidth -= 2 * cornerWidth;
</span><span class="cx">         float patternWidth = strokeStyle == DottedStroke ? thickness : std::min(3 * thickness, std::max(thickness, strokeWidth / 3));
</span><span class="cx">         // Check if corner drawing sufficiently covers the line.
</span><del>-        if (strokeWidth &lt;= patternWidth + 1) {
-            CGContextRestoreGState(context);
</del><ins>+        if (strokeWidth &lt;= patternWidth + 1)
</ins><span class="cx">             return;
</span><del>-        }
</del><span class="cx"> 
</span><span class="cx">         // Pattern starts with full fill and ends with the empty fill.
</span><span class="cx">         // 1. Let's start with the empty phase after the corner.
</span><span class="lines">@@ -362,8 +359,6 @@
</span><span class="cx">     CGContextMoveToPoint(context, p1.x(), p1.y());
</span><span class="cx">     CGContextAddLineToPoint(context, p2.x(), p2.y());
</span><span class="cx">     CGContextStrokePath(context);
</span><del>-    if (drawsDashedLine)
-        CGContextRestoreGState(context);
</del><span class="cx">     if (shouldAntialias())
</span><span class="cx">         CGContextSetShouldAntialias(context, true);
</span><span class="cx"> }
</span><span class="lines">@@ -377,24 +372,18 @@
</span><span class="cx">     CGContextRef context = platformContext();
</span><span class="cx">     float width = CGContextGetLineWidth(context);
</span><span class="cx"> 
</span><del>-    CGContextSaveGState(context);
</del><ins>+    CGContextStateSaver stateSaver(context);
</ins><span class="cx">     
</span><span class="cx">     CGContextSetShouldAntialias(context, antialias);
</span><del>-
</del><span class="cx">     CGContextSetLineWidth(context, width &lt; 1 ? 1 : width);
</span><del>-
</del><span class="cx">     CGContextBeginPath(context);
</span><del>-    
</del><span class="cx">     CGContextSetLineCap(context, lineCap);
</span><del>-    
</del><span class="cx">     CGContextMoveToPoint(context, points[0].x, points[0].y);
</span><span class="cx">     
</span><span class="cx">     for (unsigned i = 1; i &lt; count; ++i)
</span><span class="cx">         CGContextAddLineToPoint(context, points[i].x, points[i].y);
</span><span class="cx"> 
</span><span class="cx">     CGContextStrokePath(context);
</span><del>-
-    CGContextRestoreGState(context);
</del><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -588,7 +577,7 @@
</span><span class="cx">         } else {
</span><span class="cx">             CGContextBeginPath(context);
</span><span class="cx">             CGContextAddPath(context, path.platformPath());
</span><del>-            CGContextSaveGState(context);
</del><ins>+            CGContextStateSaver stateSaver(context);
</ins><span class="cx">             CGContextConcatCTM(context, m_state.fillGradient-&gt;gradientSpaceTransform());
</span><span class="cx"> 
</span><span class="cx">             if (fillRule() == RULE_EVENODD)
</span><span class="lines">@@ -597,7 +586,6 @@
</span><span class="cx">                 CGContextClip(context);
</span><span class="cx"> 
</span><span class="cx">             m_state.fillGradient-&gt;paint(this);
</span><del>-            CGContextRestoreGState(context);
</del><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         return;
</span><span class="lines">@@ -654,12 +642,11 @@
</span><span class="cx">             CGContextDrawLayerInRect(context, CGRectMake(destinationX, destinationY, adjustedWidth, adjustedHeight), layer);
</span><span class="cx">             CGLayerRelease(layer);
</span><span class="cx">         } else {
</span><del>-            CGContextSaveGState(context);
</del><ins>+            CGContextStateSaver stateSaver(context);
</ins><span class="cx">             CGContextReplacePathWithStrokedPath(context);
</span><span class="cx">             CGContextClip(context);
</span><span class="cx">             CGContextConcatCTM(context, m_state.strokeGradient-&gt;gradientSpaceTransform());
</span><span class="cx">             m_state.strokeGradient-&gt;paint(this);
</span><del>-            CGContextRestoreGState(context);
</del><span class="cx">         }
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -677,7 +664,7 @@
</span><span class="cx">     CGContextRef context = platformContext();
</span><span class="cx"> 
</span><span class="cx">     if (m_state.fillGradient) {
</span><del>-        CGContextSaveGState(context);
</del><ins>+        CGContextStateSaver stateSaver(context);
</ins><span class="cx">         if (hasShadow()) {
</span><span class="cx">             FloatSize layerSize = getCTM().mapSize(rect.size());
</span><span class="cx"> 
</span><span class="lines">@@ -698,7 +685,6 @@
</span><span class="cx">             CGContextConcatCTM(context, m_state.fillGradient-&gt;gradientSpaceTransform());
</span><span class="cx">             m_state.fillGradient-&gt;paint(this);
</span><span class="cx">         }
</span><del>-        CGContextRestoreGState(context);
</del><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -706,9 +692,9 @@
</span><span class="cx">         applyFillPattern();
</span><span class="cx"> 
</span><span class="cx">     bool drawOwnShadow = !isAcceleratedContext() &amp;&amp; hasBlurredShadow() &amp;&amp; !m_state.shadowsIgnoreTransforms; // Don't use ShadowBlur for canvas yet.
</span><ins>+    CGContextStateSaver stateSaver(context, drawOwnShadow);
</ins><span class="cx">     if (drawOwnShadow) {
</span><span class="cx">         // Turn off CG shadows.
</span><del>-        CGContextSaveGState(context);
</del><span class="cx">         CGContextSetShadowWithColor(platformContext(), CGSizeZero, 0, 0);
</span><span class="cx"> 
</span><span class="cx">         ShadowBlur contextShadow(m_state);
</span><span class="lines">@@ -716,9 +702,6 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     CGContextFillRect(context, rect);
</span><del>-
-    if (drawOwnShadow)
-        CGContextRestoreGState(context);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GraphicsContext::fillRect(const FloatRect&amp; rect, const Color&amp; color, ColorSpace colorSpace)
</span><span class="lines">@@ -734,9 +717,9 @@
</span><span class="cx">         setCGFillColor(context, color, colorSpace);
</span><span class="cx"> 
</span><span class="cx">     bool drawOwnShadow = !isAcceleratedContext() &amp;&amp; hasBlurredShadow() &amp;&amp; !m_state.shadowsIgnoreTransforms; // Don't use ShadowBlur for canvas yet.
</span><ins>+    CGContextStateSaver stateSaver(context, drawOwnShadow);
</ins><span class="cx">     if (drawOwnShadow) {
</span><span class="cx">         // Turn off CG shadows.
</span><del>-        CGContextSaveGState(context);
</del><span class="cx">         CGContextSetShadowWithColor(platformContext(), CGSizeZero, 0, 0);
</span><span class="cx"> 
</span><span class="cx">         ShadowBlur contextShadow(m_state);
</span><span class="lines">@@ -746,7 +729,7 @@
</span><span class="cx">     CGContextFillRect(context, rect);
</span><span class="cx">     
</span><span class="cx">     if (drawOwnShadow)
</span><del>-        CGContextRestoreGState(context);
</del><ins>+        stateSaver.restore();
</ins><span class="cx"> 
</span><span class="cx">     if (oldFillColor != color || oldColorSpace != colorSpace)
</span><span class="cx">         setCGFillColor(context, oldFillColor, oldColorSpace);
</span><span class="lines">@@ -765,9 +748,9 @@
</span><span class="cx">         setCGFillColor(context, color, colorSpace);
</span><span class="cx"> 
</span><span class="cx">     bool drawOwnShadow = !isAcceleratedContext() &amp;&amp; hasBlurredShadow() &amp;&amp; !m_state.shadowsIgnoreTransforms; // Don't use ShadowBlur for canvas yet.
</span><ins>+    CGContextStateSaver stateSaver(context, drawOwnShadow);
</ins><span class="cx">     if (drawOwnShadow) {
</span><span class="cx">         // Turn off CG shadows.
</span><del>-        CGContextSaveGState(context);
</del><span class="cx">         CGContextSetShadowWithColor(platformContext(), CGSizeZero, 0, 0);
</span><span class="cx"> 
</span><span class="cx">         ShadowBlur contextShadow(m_state);
</span><span class="lines">@@ -788,7 +771,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (drawOwnShadow)
</span><del>-        CGContextRestoreGState(context);
</del><ins>+        stateSaver.restore();
</ins><span class="cx"> 
</span><span class="cx">     if (oldFillColor != color || oldColorSpace != colorSpace)
</span><span class="cx">         setCGFillColor(context, oldFillColor, oldColorSpace);
</span><span class="lines">@@ -818,9 +801,9 @@
</span><span class="cx"> 
</span><span class="cx">     // fillRectWithRoundedHole() assumes that the edges of rect are clipped out, so we only care about shadows cast around inside the hole.
</span><span class="cx">     bool drawOwnShadow = !isAcceleratedContext() &amp;&amp; hasBlurredShadow() &amp;&amp; !m_state.shadowsIgnoreTransforms;
</span><ins>+    CGContextStateSaver stateSaver(context, drawOwnShadow);
</ins><span class="cx">     if (drawOwnShadow) {
</span><span class="cx">         // Turn off CG shadows.
</span><del>-        CGContextSaveGState(context);
</del><span class="cx">         CGContextSetShadowWithColor(platformContext(), CGSizeZero, 0, 0);
</span><span class="cx"> 
</span><span class="cx">         ShadowBlur contextShadow(m_state);
</span><span class="lines">@@ -830,7 +813,7 @@
</span><span class="cx">     fillPath(path);
</span><span class="cx"> 
</span><span class="cx">     if (drawOwnShadow)
</span><del>-        CGContextRestoreGState(context);
</del><ins>+        stateSaver.restore();
</ins><span class="cx">     
</span><span class="cx">     setFillRule(oldFillRule);
</span><span class="cx">     setFillColor(oldFillColor, oldFillColorSpace);
</span><span class="lines">@@ -1046,14 +1029,13 @@
</span><span class="cx">             CGContextDrawLayerInRect(context, CGRectMake(destinationX, destinationY, adjustedWidth, adjustedHeight), layer);
</span><span class="cx">             CGLayerRelease(layer);
</span><span class="cx">         } else {
</span><del>-            CGContextSaveGState(context);
</del><ins>+            CGContextStateSaver stateSaver(context);
</ins><span class="cx">             setStrokeThickness(lineWidth);
</span><span class="cx">             CGContextAddRect(context, rect);
</span><span class="cx">             CGContextReplacePathWithStrokedPath(context);
</span><span class="cx">             CGContextClip(context);
</span><span class="cx">             CGContextConcatCTM(context, m_state.strokeGradient-&gt;gradientSpaceTransform());
</span><span class="cx">             m_state.strokeGradient-&gt;paint(this);
</span><del>-            CGContextRestoreGState(context);
</del><span class="cx">         }
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -1066,13 +1048,11 @@
</span><span class="cx">     // The convenience functions currently (in at least OSX 10.9.4) fail to
</span><span class="cx">     // apply some attributes of the graphics state in certain cases
</span><span class="cx">     // (as identified in https://bugs.webkit.org/show_bug.cgi?id=132948)
</span><del>-    CGContextSaveGState(context);
</del><ins>+    CGContextStateSaver stateSaver(context);
</ins><span class="cx">     setStrokeThickness(lineWidth);
</span><span class="cx"> 
</span><span class="cx">     CGContextAddRect(context, rect);
</span><span class="cx">     CGContextStrokePath(context);
</span><del>-
-    CGContextRestoreGState(context);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GraphicsContext::setLineCap(LineCap cap)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgGraphicsContextCGh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.h (190893 => 190894)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.h        2015-10-12 22:33:03 UTC (rev 190893)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.h        2015-10-12 22:36:03 UTC (rev 190894)
</span><span class="lines">@@ -50,6 +50,41 @@
</span><span class="cx">     return deviceRGBColorSpaceRef();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+class CGContextStateSaver {
+public:
+    CGContextStateSaver(CGContextRef context, bool saveAndRestore = true)
+        : m_context(context)
+        , m_saveAndRestore(saveAndRestore)
+    {
+        if (m_saveAndRestore)
+            CGContextSaveGState(m_context);
+    }
+    
+    ~CGContextStateSaver()
+    {
+        if (m_saveAndRestore)
+            CGContextRestoreGState(m_context);
+    }
+    
+    void save()
+    {
+        ASSERT(!m_saveAndRestore);
+        CGContextSaveGState(m_context);
+        m_saveAndRestore = true;
+    }
+
+    void restore()
+    {
+        ASSERT(m_saveAndRestore);
+        CGContextRestoreGState(m_context);
+        m_saveAndRestore = false;
+    }
+    
+private:
+    CGContextRef m_context;
+    bool m_saveAndRestore;
+};
+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>

</body>
</html>