<!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>[161389] 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/161389">161389</a></dd>
<dt>Author</dt> <dd>bfulgham@apple.com</dd>
<dt>Date</dt> <dd>2014-01-06 17:44:33 -0800 (Mon, 06 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WebGL] Be safer about toggling OpenGL state by using a scoped object to control setting lifetime.
https://bugs.webkit.org/show_bug.cgi?id=126548

Reviewed by Anders Carlsson.

No new tests since there is no change in behavior.

* GNUmakefile.list.am: Updated to build new TemporaryOpenGLSetting files.
* PlatformBlackBerry.cmake: Ditto
* PlatformEfl.cmake: Ditto
* PlatformGTK.cmake: Ditto
* PlatformNix.cmake: Ditto
* WebCore.vcxproj/WebCore.vcxproj: Ditto
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto
* WebCore.xcodeproj/project.pbxproj: Ditto
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary): Use new object.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::prepareTexture): Ditto
(WebCore::GraphicsContext3D::reshape): Ditto
* platform/graphics/opengl/TemporaryOpenGLSetting.cpp: Added.
(WebCore::TemporaryOpenGLSetting::TemporaryOpenGLSetting):
(WebCore::TemporaryOpenGLSetting::~TemporaryOpenGLSetting):
* platform/graphics/opengl/TemporaryOpenGLSetting.h: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefilelistam">trunk/Source/WebCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceWebCorePlatformBlackBerrycmake">trunk/Source/WebCore/PlatformBlackBerry.cmake</a></li>
<li><a href="#trunkSourceWebCorePlatformEflcmake">trunk/Source/WebCore/PlatformEfl.cmake</a></li>
<li><a href="#trunkSourceWebCorePlatformGTKcmake">trunk/Source/WebCore/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebCorePlatformNixcmake">trunk/Source/WebCore/PlatformNix.cmake</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLcpp">trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLCommoncpp">trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsopenglTemporaryOpenGLSettingcpp">trunk/Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopenglTemporaryOpenGLSettingh">trunk/Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161388 => 161389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-07 01:41:41 UTC (rev 161388)
+++ trunk/Source/WebCore/ChangeLog        2014-01-07 01:44:33 UTC (rev 161389)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2014-01-06  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+        [WebGL] Be safer about toggling OpenGL state by using a scoped object to control setting lifetime.
+        https://bugs.webkit.org/show_bug.cgi?id=126548
+
+        Reviewed by Anders Carlsson.
+
+        No new tests since there is no change in behavior.
+
+        * GNUmakefile.list.am: Updated to build new TemporaryOpenGLSetting files.
+        * PlatformBlackBerry.cmake: Ditto
+        * PlatformEfl.cmake: Ditto
+        * PlatformGTK.cmake: Ditto
+        * PlatformNix.cmake: Ditto
+        * WebCore.vcxproj/WebCore.vcxproj: Ditto
+        * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto
+        * WebCore.xcodeproj/project.pbxproj: Ditto
+        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
+        (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary): Use new object.
+        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
+        (WebCore::GraphicsContext3D::prepareTexture): Ditto
+        (WebCore::GraphicsContext3D::reshape): Ditto
+        * platform/graphics/opengl/TemporaryOpenGLSetting.cpp: Added.
+        (WebCore::TemporaryOpenGLSetting::TemporaryOpenGLSetting):
+        (WebCore::TemporaryOpenGLSetting::~TemporaryOpenGLSetting):
+        * platform/graphics/opengl/TemporaryOpenGLSetting.h: Added.
+
</ins><span class="cx"> 2014-01-06  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Hook up the RemoteScrollingCoordinator
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (161388 => 161389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2014-01-07 01:41:41 UTC (rev 161388)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2014-01-07 01:44:33 UTC (rev 161389)
</span><span class="lines">@@ -5385,6 +5385,8 @@
</span><span class="cx">         Source/WebCore/platform/graphics/MediaPlayer.h \
</span><span class="cx">         Source/WebCore/platform/graphics/MediaPlayerPrivate.h \
</span><span class="cx">         Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp \
</span><ins>+        Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.cpp \
+        Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.h \
</ins><span class="cx">         Source/WebCore/platform/graphics/transforms/PerspectiveTransformOperation.cpp \
</span><span class="cx">         Source/WebCore/platform/graphics/transforms/PerspectiveTransformOperation.h \
</span><span class="cx">         Source/WebCore/platform/graphics/transforms/TranslateTransformOperation.cpp \
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformBlackBerrycmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformBlackBerry.cmake (161388 => 161389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformBlackBerry.cmake        2014-01-07 01:41:41 UTC (rev 161388)
+++ trunk/Source/WebCore/PlatformBlackBerry.cmake        2014-01-07 01:44:33 UTC (rev 161389)
</span><span class="lines">@@ -177,6 +177,7 @@
</span><span class="cx">         platform/graphics/opengl/Extensions3DOpenGLES.cpp
</span><span class="cx">         platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
</span><span class="cx">         platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp
</span><ins>+        platform/graphics/opengl/TemporaryOpenGLSetting.cpp
</ins><span class="cx">     )
</span><span class="cx"> endif ()
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformEflcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformEfl.cmake (161388 => 161389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformEfl.cmake        2014-01-07 01:41:41 UTC (rev 161388)
+++ trunk/Source/WebCore/PlatformEfl.cmake        2014-01-07 01:44:33 UTC (rev 161389)
</span><span class="lines">@@ -310,6 +310,7 @@
</span><span class="cx">         platform/graphics/opengl/GLPlatformContext.cpp
</span><span class="cx">         platform/graphics/opengl/GLPlatformSurface.cpp
</span><span class="cx">         platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
</span><ins>+        platform/graphics/opengl/TemporaryOpenGLSetting.cpp
</ins><span class="cx"> 
</span><span class="cx">         platform/graphics/surfaces/GLTransportSurface.cpp
</span><span class="cx">         platform/graphics/surfaces/GraphicsSurface.cpp
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformGTK.cmake (161388 => 161389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformGTK.cmake        2014-01-07 01:41:41 UTC (rev 161388)
+++ trunk/Source/WebCore/PlatformGTK.cmake        2014-01-07 01:44:33 UTC (rev 161389)
</span><span class="lines">@@ -97,6 +97,7 @@
</span><span class="cx">     platform/graphics/opengl/Extensions3DOpenGLES.cpp
</span><span class="cx">     platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
</span><span class="cx">     platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
</span><ins>+    platform/graphics/opengl/TemporaryOpenGLSetting.cpp
</ins><span class="cx"> 
</span><span class="cx">     platform/graphics/opentype/OpenTypeVerticalData.cpp
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformNixcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformNix.cmake (161388 => 161389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformNix.cmake        2014-01-07 01:41:41 UTC (rev 161388)
+++ trunk/Source/WebCore/PlatformNix.cmake        2014-01-07 01:44:33 UTC (rev 161389)
</span><span class="lines">@@ -70,6 +70,7 @@
</span><span class="cx"> 
</span><span class="cx">     platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
</span><span class="cx">     platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
</span><ins>+    platform/graphics/opengl/TemporaryOpenGLSetting.cpp
</ins><span class="cx"> 
</span><span class="cx">     platform/graphics/opentype/OpenTypeVerticalData.cpp
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (161388 => 161389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-01-07 01:41:41 UTC (rev 161388)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-01-07 01:44:33 UTC (rev 161389)
</span><span class="lines">@@ -7433,6 +7433,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\opengl\GLPlatformSurface.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\opengl\GraphicsContext3DOpenGLCommon.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\opengl\GraphicsContext3DOpenGLES.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\platform\graphics\opengl\TemporaryOpenGLSetting.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\texmap\coordinated\AreaAllocator.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\texmap\coordinated\CompositingCoordinator.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\texmap\coordinated\CoordinatedBackingStore.cpp&quot; /&gt;
</span><span class="lines">@@ -21135,4 +21136,4 @@
</span><span class="cx">   &lt;ImportGroup Label=&quot;ExtensionTargets&quot;&gt;
</span><span class="cx">     &lt;Import Project=&quot;$(VCTargetsPath)\BuildCustomizations\masm.targets&quot; /&gt;
</span><span class="cx">   &lt;/ImportGroup&gt;
</span><del>-&lt;/Project&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+&lt;/Project&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (161388 => 161389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-01-07 01:41:41 UTC (rev 161388)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-01-07 01:44:33 UTC (rev 161389)
</span><span class="lines">@@ -6814,6 +6814,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\opengl\GraphicsContext3DOpenGLCommon.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;platform\graphics\opengl&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\platform\graphics\opengl\TemporaryOpenGLSetting.cpp&quot;&gt;
+      &lt;Filter&gt;platform\graphics\opengl&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\page\CaptionUserPreferencesMediaAF.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;page&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (161388 => 161389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-07 01:41:41 UTC (rev 161388)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-07 01:44:33 UTC (rev 161389)
</span><span class="lines">@@ -1966,9 +1966,9 @@
</span><span class="cx">                 5DF7F5C20F01F92A00526B4B /* CSSPropertyNames.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 656580EF09D12B20000E61D7 /* CSSPropertyNames.h */; };
</span><span class="cx">                 5DFE8F560D16477B0076E937 /* ScheduledAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA378BA0D15F64200B793D6 /* ScheduledAction.cpp */; };
</span><span class="cx">                 5DFE8F570D16477C0076E937 /* ScheduledAction.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA378BB0D15F64200B793D6 /* ScheduledAction.h */; };
</span><ins>+                5DFEBAB718592B6D00C75BEB /* WebKitAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DFEBAB618592B6D00C75BEB /* WebKitAvailability.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 5F2DBBE9178E3C8100141486 /* CertificateInfoMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5F2DBBE7178E332D00141486 /* CertificateInfoMac.mm */; };
</span><span class="cx">                 5FA904CA178E61F5004C8A2D /* CertificateInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 5F2DBBE8178E336900141486 /* CertificateInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                5DFEBAB718592B6D00C75BEB /* WebKitAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DFEBAB618592B6D00C75BEB /* WebKitAvailability.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">                 5FC7DC26CFE2563200B85AE4 /* JSEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 5FC7DC26CFE2563200B85AE5 /* JSEventTarget.h */; };
</span><span class="cx">                 5FE1D292178FD1F3001AA3C3 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5FE1D291178FD1F3001AA3C3 /* Security.framework */; };
</span><span class="cx">                 626CDE0E1140424C001E5A68 /* SpatialNavigation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */; };
</span><span class="lines">@@ -2205,6 +2205,7 @@
</span><span class="cx">                 7A1F2B52126C61B20006A7E6 /* InspectorClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A1F2B51126C61B20006A7E6 /* InspectorClient.cpp */; };
</span><span class="cx">                 7A24587B1021EAF4000A00AA /* InspectorDOMAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A2458791021EAF4000A00AA /* InspectorDOMAgent.cpp */; };
</span><span class="cx">                 7A24587C1021EAF4000A00AA /* InspectorDOMAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A24587A1021EAF4000A00AA /* InspectorDOMAgent.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                7A29BA6A187B7C1D00F29CEB /* TemporaryOpenGLSetting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A29BA69187B781C00F29CEB /* TemporaryOpenGLSetting.cpp */; };
</ins><span class="cx">                 7A54857F14E02D51006AE05A /* InspectorHistory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A54857D14E02D51006AE05A /* InspectorHistory.cpp */; };
</span><span class="cx">                 7A54858014E02D51006AE05A /* InspectorHistory.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A54857E14E02D51006AE05A /* InspectorHistory.h */; };
</span><span class="cx">                 7A54881714E432A1006AE05A /* DOMPatchSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A54881514E432A1006AE05A /* DOMPatchSupport.h */; };
</span><span class="lines">@@ -8767,9 +8768,9 @@
</span><span class="cx">                 5DA97ECC168E787B000E3676 /* SystemVersionMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SystemVersionMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5DB1BC6810715A6400EFAA49 /* TransformSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransformSource.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5DB1BC6910715A6400EFAA49 /* TransformSourceLibxslt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransformSourceLibxslt.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                5DFEBAB618592B6D00C75BEB /* WebKitAvailability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitAvailability.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 5F2DBBE7178E332D00141486 /* CertificateInfoMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CertificateInfoMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5F2DBBE8178E336900141486 /* CertificateInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CertificateInfo.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                5DFEBAB618592B6D00C75BEB /* WebKitAvailability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitAvailability.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 5FC7DC26CFE2563200B85AE5 /* JSEventTarget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSEventTarget.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5FE1D291178FD1F3001AA3C3 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
</span><span class="cx">                 626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpatialNavigation.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -9036,6 +9037,8 @@
</span><span class="cx">                 7A1F2B51126C61B20006A7E6 /* InspectorClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorClient.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7A2458791021EAF4000A00AA /* InspectorDOMAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDOMAgent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7A24587A1021EAF4000A00AA /* InspectorDOMAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDOMAgent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7A29BA67187B732200F29CEB /* TemporaryOpenGLSetting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemporaryOpenGLSetting.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7A29BA69187B781C00F29CEB /* TemporaryOpenGLSetting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TemporaryOpenGLSetting.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7A54857D14E02D51006AE05A /* InspectorHistory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorHistory.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7A54857E14E02D51006AE05A /* InspectorHistory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorHistory.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7A54881514E432A1006AE05A /* DOMPatchSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMPatchSupport.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -21863,6 +21866,8 @@
</span><span class="cx">                 FBC220DD1237FBEB00BCF788 /* opengl */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                7A29BA69187B781C00F29CEB /* TemporaryOpenGLSetting.cpp */,
+                                7A29BA67187B732200F29CEB /* TemporaryOpenGLSetting.h */,
</ins><span class="cx">                                 6E67D2A41280E8A4008758F7 /* Extensions3DOpenGL.cpp */,
</span><span class="cx">                                 6E67D2A51280E8A4008758F7 /* Extensions3DOpenGL.h */,
</span><span class="cx">                                 44DAB5AF15A623580097C1E4 /* Extensions3DOpenGLCommon.cpp */,
</span><span class="lines">@@ -25850,6 +25855,7 @@
</span><span class="cx">                         isa = PBXSourcesBuildPhase;
</span><span class="cx">                         buildActionMask = 2147483647;
</span><span class="cx">                         files = (
</span><ins>+                                7A29BA6A187B7C1D00F29CEB /* TemporaryOpenGLSetting.cpp in Sources */,
</ins><span class="cx">                                 41E1B1D00FF5986900576B3B /* AbstractWorker.cpp in Sources */,
</span><span class="cx">                                 0F29C16E1300C2E2002D794E /* AccessibilityAllInOne.cpp in Sources */,
</span><span class="cx">                                 76CDD2F21103DA6600680521 /* AccessibilityMenuList.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp (161388 => 161389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp        2014-01-07 01:41:41 UTC (rev 161388)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp        2014-01-07 01:44:33 UTC (rev 161389)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010, 2013 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2011 Google Inc. All rights reserved.
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &quot;IntRect.h&quot;
</span><span class="cx"> #include &quot;IntSize.h&quot;
</span><span class="cx"> #include &quot;NotImplemented.h&quot;
</span><ins>+#include &quot;TemporaryOpenGLSetting.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #include &lt;algorithm&gt;
</span><span class="cx"> #include &lt;cstring&gt;
</span><span class="lines">@@ -161,11 +162,9 @@
</span><span class="cx"> 
</span><span class="cx"> void GraphicsContext3D::resolveMultisamplingIfNecessary(const IntRect&amp; rect)
</span><span class="cx"> {
</span><del>-    GLboolean isScissorEnabled = ::glIsEnabled(GL_SCISSOR_TEST);
-    ::glDisable(GL_SCISSOR_TEST);
-    GLboolean isDitherEnabled = ::glIsEnabled(GL_DITHER);
-    ::glDisable(GL_DITHER);
-    
</del><ins>+    TemporaryOpenGLSetting scopedScissor(GL_SCISSOR_TEST, GL_FALSE);
+    TemporaryOpenGLSetting scopedDither(GL_SCISSOR_TEST, GL_FALSE);
+
</ins><span class="cx">     ::glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
</span><span class="cx">     ::glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
</span><span class="cx"> 
</span><span class="lines">@@ -174,11 +173,6 @@
</span><span class="cx">         resolveRect = IntRect(0, 0, m_currentWidth, m_currentHeight);
</span><span class="cx"> 
</span><span class="cx">     ::glBlitFramebufferEXT(resolveRect.x(), resolveRect.y(), resolveRect.maxX(), resolveRect.maxY(), resolveRect.x(), resolveRect.y(), resolveRect.maxX(), resolveRect.maxY(), GL_COLOR_BUFFER_BIT, GL_LINEAR);
</span><del>-
-    if (isScissorEnabled)
-        ::glEnable(GL_SCISSOR_TEST);
-    if (isDitherEnabled)
-        ::glEnable(GL_DITHER);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GraphicsContext3D::renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLCommoncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp (161388 => 161389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp        2014-01-07 01:41:41 UTC (rev 161388)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp        2014-01-07 01:44:33 UTC (rev 161389)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> #include &quot;IntSize.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;NotImplemented.h&quot;
</span><ins>+#include &quot;TemporaryOpenGLSetting.h&quot;
</ins><span class="cx"> #include &lt;cstring&gt;
</span><span class="cx"> #include &lt;runtime/ArrayBuffer.h&gt;
</span><span class="cx"> #include &lt;runtime/ArrayBufferView.h&gt;
</span><span class="lines">@@ -196,10 +197,8 @@
</span><span class="cx"> 
</span><span class="cx">     makeContextCurrent();
</span><span class="cx"> 
</span><del>-    GLboolean isScissorEnabled = ::glIsEnabled(GL_SCISSOR_TEST);
-    ::glDisable(GL_SCISSOR_TEST);
-    GLboolean isDitherEnabled = ::glIsEnabled(GL_DITHER);
-    ::glDisable(GL_DITHER);
</del><ins>+    TemporaryOpenGLSetting scopedScissor(GL_SCISSOR_TEST, GL_FALSE);
+    TemporaryOpenGLSetting scopedDither(GL_SCISSOR_TEST, GL_FALSE);
</ins><span class="cx">     
</span><span class="cx">     if (m_attrs.antialias)
</span><span class="cx">         resolveMultisamplingIfNecessary();
</span><span class="lines">@@ -214,11 +213,6 @@
</span><span class="cx">         ::glBindFramebufferEXT(GraphicsContext3D::FRAMEBUFFER, m_state.boundFBO);
</span><span class="cx">     ::glFinish();
</span><span class="cx">     m_layerComposited = true;
</span><del>-
-    if (isScissorEnabled)
-        ::glEnable(GL_SCISSOR_TEST);
-    if (isDitherEnabled)
-        ::glEnable(GL_DITHER);
</del><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -284,8 +278,6 @@
</span><span class="cx">     GLint clearStencil = 0;
</span><span class="cx">     GLboolean colorMask[] = {GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE}, depthMask = GL_TRUE;
</span><span class="cx">     GLuint stencilMask = 0xffffffff;
</span><del>-    GLboolean isScissorEnabled = GL_FALSE;
-    GLboolean isDitherEnabled = GL_FALSE;
</del><span class="cx">     GLbitfield clearMask = GL_COLOR_BUFFER_BIT;
</span><span class="cx">     ::glGetFloatv(GL_COLOR_CLEAR_VALUE, clearColor);
</span><span class="cx">     ::glClearColor(0, 0, 0, 0);
</span><span class="lines">@@ -305,11 +297,10 @@
</span><span class="cx">         ::glStencilMaskSeparate(GL_FRONT, 0xffffffff);
</span><span class="cx">         clearMask |= GL_STENCIL_BUFFER_BIT;
</span><span class="cx">     }
</span><del>-    isScissorEnabled = ::glIsEnabled(GL_SCISSOR_TEST);
-    ::glDisable(GL_SCISSOR_TEST);
-    isDitherEnabled = ::glIsEnabled(GL_DITHER);
-    ::glDisable(GL_DITHER);
</del><span class="cx"> 
</span><ins>+    TemporaryOpenGLSetting scopedScissor(GL_SCISSOR_TEST, GL_FALSE);
+    TemporaryOpenGLSetting scopedDither(GL_SCISSOR_TEST, GL_FALSE);
+
</ins><span class="cx">     ::glClear(clearMask);
</span><span class="cx"> 
</span><span class="cx">     ::glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
</span><span class="lines">@@ -322,14 +313,6 @@
</span><span class="cx">         ::glClearStencil(clearStencil);
</span><span class="cx">         ::glStencilMaskSeparate(GL_FRONT, stencilMask);
</span><span class="cx">     }
</span><del>-    if (isScissorEnabled)
-        ::glEnable(GL_SCISSOR_TEST);
-    else
-        ::glDisable(GL_SCISSOR_TEST);
-    if (isDitherEnabled)
-        ::glEnable(GL_DITHER);
-    else
-        ::glDisable(GL_DITHER);
</del><span class="cx"> 
</span><span class="cx">     if (mustRestoreFBO)
</span><span class="cx">         ::glBindFramebufferEXT(GraphicsContext3D::FRAMEBUFFER, m_state.boundFBO);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopenglTemporaryOpenGLSettingcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.cpp (0 => 161389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.cpp        2014-01-07 01:44:33 UTC (rev 161389)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+
+#if USE(3D_GRAPHICS)
+#include &quot;TemporaryOpenGLSetting.h&quot;
+
+#if USE(OPENGL_ES_2)
+#include &quot;OpenGLESShims.h&quot;
+#elif PLATFORM(MAC)
+#include &lt;OpenGL/gl.h&gt;
+#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)
+#include &quot;OpenGLShims.h&quot;
+#endif
+
+namespace WebCore {
+
+TemporaryOpenGLSetting::TemporaryOpenGLSetting(GLenum capability, GLenum scopedState)
+    : m_capability(capability)
+    , m_scopedState(scopedState)
+{
+    m_originalState = ::glIsEnabled(m_capability);
+    if (m_originalState == m_scopedState)
+        return;
+
+    if (GL_TRUE == m_scopedState)
+        ::glEnable(m_capability);
+    else
+        ::glDisable(m_capability);
+}
+
+TemporaryOpenGLSetting::~TemporaryOpenGLSetting()
+{
+    if (m_originalState == m_scopedState)
+        return;
+
+    if (GL_TRUE == m_originalState)
+        ::glEnable(m_capability);
+    else
+        ::glDisable(m_capability);
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopenglTemporaryOpenGLSettingh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.h (0 => 161389)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.h        2014-01-07 01:44:33 UTC (rev 161389)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TemporaryOpenGLSetting_h
+#define TemporaryOpenGLSetting_h
+
+#include &quot;GraphicsTypes3D.h&quot;
+
+#include &lt;wtf/Noncopyable.h&gt;
+
+namespace WebCore {
+
+// TemporaryOpenGLSetting&lt;&gt; is useful for temporarily disabling (or enabling) a particular OpenGL
+// feature with a particular scope. A TemporaryOpenGLSetting&lt;&gt; object returns the flag to its original
+// value upon destruction, making it an alternative to checking, clearing, and resetting each flag
+// at all of a block's exit points.
+//
+// Based on WTF::TemporaryChange&lt;&gt;
+
+class TemporaryOpenGLSetting {
+    WTF_MAKE_NONCOPYABLE(TemporaryOpenGLSetting);
+public:
+    TemporaryOpenGLSetting(GC3Denum capability, GC3Denum scopedState);
+    ~TemporaryOpenGLSetting();
+
+private:
+    const GC3Denum m_capability;
+    const GC3Denum m_scopedState;
+    GC3Denum m_originalState;
+};
+
+}
+
+using WebCore::TemporaryOpenGLSetting;
+
+#endif
</ins></span></pre>
</div>
</div>

</body>
</html>