<!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>[212529] branches/safari-603-branch</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/212529">212529</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2017-02-16 21:28:16 -0800 (Thu, 16 Feb 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/212316">r212316</a>. rdar://problem/30504444</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari603branchLayoutTestsChangeLog">branches/safari-603-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari603branchLayoutTestsfastcanvaswebglcontextcreationattributesexpectedtxt">branches/safari-603-branch/LayoutTests/fast/canvas/webgl/context-creation-attributes-expected.txt</a></li>
<li><a href="#branchessafari603branchLayoutTestsfastcanvaswebglcontextcreationattributeshtml">branches/safari-603-branch/LayoutTests/fast/canvas/webgl/context-creation-attributes.html</a></li>
<li><a href="#branchessafari603branchSourceWebCoreChangeLog">branches/safari-603-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari603branchSourceWebCorehtmlcanvasWebGLContextAttributesh">branches/safari-603-branch/Source/WebCore/html/canvas/WebGLContextAttributes.h</a></li>
<li><a href="#branchessafari603branchSourceWebCorehtmlcanvasWebGLContextAttributesidl">branches/safari-603-branch/Source/WebCore/html/canvas/WebGLContextAttributes.idl</a></li>
<li><a href="#branchessafari603branchSourceWebCorehtmlcanvasWebGLRenderingContextBasecpp">branches/safari-603-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp</a></li>
<li><a href="#branchessafari603branchSourceWebCoreplatformWebGLStateTrackercpp">branches/safari-603-branch/Source/WebCore/platform/WebGLStateTracker.cpp</a></li>
<li><a href="#branchessafari603branchSourceWebCoreplatformWebGLStateTrackerh">branches/safari-603-branch/Source/WebCore/platform/WebGLStateTracker.h</a></li>
<li><a href="#branchessafari603branchSourceWebCoreplatformgraphicsGraphicsContext3DAttributesh">branches/safari-603-branch/Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h</a></li>
<li><a href="#branchessafari603branchSourceWebCoreplatformgraphicsmacGraphicsContext3DMacmm">branches/safari-603-branch/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari603branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/ChangeLog (212528 => 212529)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/ChangeLog        2017-02-17 05:28:11 UTC (rev 212528)
+++ branches/safari-603-branch/LayoutTests/ChangeLog        2017-02-17 05:28:16 UTC (rev 212529)
</span><span class="lines">@@ -1,5 +1,25 @@
</span><span class="cx"> 2017-02-16  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r212316. rdar://problem/30504444
+
+    2017-02-13  Dean Jackson  &lt;dino@apple.com&gt;
+
+            Rename preferLowPowerToHighPerformance to powerPreference
+            https://bugs.webkit.org/show_bug.cgi?id=168269
+            &lt;rdar://problem/30504444&gt;
+
+            Reviewed by Chris Dumez.
+
+            Handle the rename in the test case. Since Settings.in has
+            preferLowPowerWebGLRendering initial=true
+            we will override the incoming request and set the value to
+            &quot;low-power&quot;. This behaviour will change in a subsequent bug.
+
+            * fast/canvas/webgl/context-creation-attributes-expected.txt:
+            * fast/canvas/webgl/context-creation-attributes.html:
+
+2017-02-16  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r212314. rdar://problem/27685077
</span><span class="cx"> 
</span><span class="cx">     2017-02-14  Jeremy Jones  &lt;jeremyj@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari603branchLayoutTestsfastcanvaswebglcontextcreationattributesexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/fast/canvas/webgl/context-creation-attributes-expected.txt (212528 => 212529)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/canvas/webgl/context-creation-attributes-expected.txt        2017-02-17 05:28:11 UTC (rev 212528)
+++ branches/safari-603-branch/LayoutTests/fast/canvas/webgl/context-creation-attributes-expected.txt        2017-02-17 05:28:16 UTC (rev 212529)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> Note that some of the values tested here might not be supported, and thus should return the default values.
</span><span class="cx"> 
</span><del>-{&quot;alpha&quot;:true,&quot;antialias&quot;:true,&quot;depth&quot;:true,&quot;failIfMajorPerformanceCaveat&quot;:false,&quot;preferLowPowerToHighPerformance&quot;:true,&quot;premultipliedAlpha&quot;:true,&quot;preserveDrawingBuffer&quot;:false,&quot;stencil&quot;:false}
-{&quot;alpha&quot;:true,&quot;antialias&quot;:true,&quot;depth&quot;:true,&quot;failIfMajorPerformanceCaveat&quot;:false,&quot;preferLowPowerToHighPerformance&quot;:true,&quot;premultipliedAlpha&quot;:true,&quot;preserveDrawingBuffer&quot;:false,&quot;stencil&quot;:true}
-{&quot;alpha&quot;:true,&quot;antialias&quot;:true,&quot;depth&quot;:true,&quot;failIfMajorPerformanceCaveat&quot;:false,&quot;preferLowPowerToHighPerformance&quot;:true,&quot;premultipliedAlpha&quot;:true,&quot;preserveDrawingBuffer&quot;:false,&quot;stencil&quot;:false}
-{&quot;alpha&quot;:true,&quot;antialias&quot;:true,&quot;depth&quot;:true,&quot;failIfMajorPerformanceCaveat&quot;:true,&quot;preferLowPowerToHighPerformance&quot;:true,&quot;premultipliedAlpha&quot;:true,&quot;preserveDrawingBuffer&quot;:false,&quot;stencil&quot;:false}
</del><ins>+{&quot;alpha&quot;:true,&quot;antialias&quot;:true,&quot;depth&quot;:true,&quot;failIfMajorPerformanceCaveat&quot;:false,&quot;powerPreference&quot;:&quot;low-power&quot;,&quot;premultipliedAlpha&quot;:true,&quot;preserveDrawingBuffer&quot;:false,&quot;stencil&quot;:false}
+{&quot;alpha&quot;:true,&quot;antialias&quot;:true,&quot;depth&quot;:true,&quot;failIfMajorPerformanceCaveat&quot;:false,&quot;powerPreference&quot;:&quot;low-power&quot;,&quot;premultipliedAlpha&quot;:true,&quot;preserveDrawingBuffer&quot;:false,&quot;stencil&quot;:true}
+{&quot;alpha&quot;:true,&quot;antialias&quot;:true,&quot;depth&quot;:true,&quot;failIfMajorPerformanceCaveat&quot;:false,&quot;powerPreference&quot;:&quot;low-power&quot;,&quot;premultipliedAlpha&quot;:true,&quot;preserveDrawingBuffer&quot;:false,&quot;stencil&quot;:false}
+{&quot;alpha&quot;:true,&quot;antialias&quot;:true,&quot;depth&quot;:true,&quot;failIfMajorPerformanceCaveat&quot;:true,&quot;powerPreference&quot;:&quot;low-power&quot;,&quot;premultipliedAlpha&quot;:true,&quot;preserveDrawingBuffer&quot;:false,&quot;stencil&quot;:false}
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsfastcanvaswebglcontextcreationattributeshtml"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/fast/canvas/webgl/context-creation-attributes.html (212528 => 212529)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/fast/canvas/webgl/context-creation-attributes.html        2017-02-17 05:28:11 UTC (rev 212528)
+++ branches/safari-603-branch/LayoutTests/fast/canvas/webgl/context-creation-attributes.html        2017-02-17 05:28:16 UTC (rev 212529)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> function run() {
</span><span class="cx">     testContextCreation({});
</span><span class="cx">     testContextCreation({stencil: true});
</span><del>-    testContextCreation({preferLowPowerToHighPerformance: true});
</del><ins>+    testContextCreation({powerPreference: &quot;default&quot;});
</ins><span class="cx">     testContextCreation({failIfMajorPerformanceCaveat: true});
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/ChangeLog (212528 => 212529)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/ChangeLog        2017-02-17 05:28:11 UTC (rev 212528)
+++ branches/safari-603-branch/Source/WebCore/ChangeLog        2017-02-17 05:28:16 UTC (rev 212529)
</span><span class="lines">@@ -1,5 +1,40 @@
</span><span class="cx"> 2017-02-16  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r212316. rdar://problem/30504444
+
+    2017-02-13  Dean Jackson  &lt;dino@apple.com&gt;
+
+            Rename preferLowPowerToHighPerformance to powerPreference
+            https://bugs.webkit.org/show_bug.cgi?id=168269
+            &lt;rdar://problem/30504444&gt;
+
+            Reviewed by Chris Dumez.
+
+            Based on the discussion in https://github.com/KhronosGroup/WebGL/pull/2283.
+
+            Change WebGLContextAttributes's preferLowPowerToHighPerformance boolean
+            into a powerPreference enum taking three values. The implementation
+            of the enum is in GraphicsContext3DAttributes.
+
+            While the name and values have changed, there should be no change in
+            behaviour caused by this patch.
+
+            * html/canvas/WebGLContextAttributes.h: Use GraphicsContext3DAttributes
+            enum GraphicsContext3DPowerPreference.
+            * html/canvas/WebGLContextAttributes.idl: Rename and add the WebIDL enum.
+            * html/canvas/WebGLRenderingContextBase.cpp: Use the new values.
+            (WebCore::WebGLRenderingContextBase::create):
+            (WebCore::WebGLRenderingContextBase::registerWithWebGLStateTracker):
+            * platform/WebGLStateTracker.cpp:
+            * platform/WebGLStateTracker.h: Update the state tracker to use the new
+            values.
+            * platform/graphics/GraphicsContext3DAttributes.h:
+            * platform/graphics/mac/GraphicsContext3DMac.mm:
+            (WebCore::setPixelFormat): Accept GraphicsContext3DPowerPreference as a parameter.
+            (WebCore::GraphicsContext3D::GraphicsContext3D):
+
+2017-02-16  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r212314. rdar://problem/27685077
</span><span class="cx"> 
</span><span class="cx">     2017-02-14  Jeremy Jones  &lt;jeremyj@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCorehtmlcanvasWebGLContextAttributesh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/html/canvas/WebGLContextAttributes.h (212528 => 212529)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/html/canvas/WebGLContextAttributes.h        2017-02-17 05:28:11 UTC (rev 212528)
+++ branches/safari-603-branch/Source/WebCore/html/canvas/WebGLContextAttributes.h        2017-02-17 05:28:16 UTC (rev 212529)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+using WebGLPowerPreference = GraphicsContext3DPowerPreference;
</ins><span class="cx"> using WebGLContextAttributes = GraphicsContext3DAttributes;
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCorehtmlcanvasWebGLContextAttributesidl"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/html/canvas/WebGLContextAttributes.idl (212528 => 212529)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/html/canvas/WebGLContextAttributes.idl        2017-02-17 05:28:11 UTC (rev 212528)
+++ branches/safari-603-branch/Source/WebCore/html/canvas/WebGLContextAttributes.idl        2017-02-17 05:28:16 UTC (rev 212529)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (c) 2010, Google Inc. All rights reserved.
</span><ins>+ * Copyright (c) 2017, Apple, Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -26,6 +27,12 @@
</span><span class="cx"> 
</span><span class="cx"> typedef boolean GLboolean;
</span><span class="cx"> 
</span><ins>+enum WebGLPowerPreference {
+    &quot;default&quot;,
+    &quot;low-power&quot;,
+    &quot;high-performance&quot;
+};
+
</ins><span class="cx"> [
</span><span class="cx">     Conditional=WEBGL,
</span><span class="cx">     JSGenerateToJSObject
</span><span class="lines">@@ -36,6 +43,6 @@
</span><span class="cx">     GLboolean antialias = true;
</span><span class="cx">     GLboolean premultipliedAlpha = true;
</span><span class="cx">     GLboolean preserveDrawingBuffer = false;
</span><del>-    GLboolean preferLowPowerToHighPerformance = false;
</del><ins>+    WebGLPowerPreference powerPreference = &quot;default&quot;;
</ins><span class="cx">     GLboolean failIfMajorPerformanceCaveat = false;
</span><span class="cx"> };
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCorehtmlcanvasWebGLRenderingContextBasecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (212528 => 212529)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp        2017-02-17 05:28:11 UTC (rev 212528)
+++ branches/safari-603-branch/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp        2017-02-17 05:28:16 UTC (rev 212529)
</span><span class="lines">@@ -402,9 +402,9 @@
</span><span class="cx">     if (frame-&gt;settings().forceSoftwareWebGLRendering())
</span><span class="cx">         attributes.forceSoftwareRenderer = true;
</span><span class="cx"> 
</span><del>-    attributes.initialPreferLowPowerToHighPerformance = attributes.preferLowPowerToHighPerformance;
</del><ins>+    attributes.initialPowerPreference = attributes.powerPreference;
</ins><span class="cx">     if (frame-&gt;settings().preferLowPowerWebGLRendering())
</span><del>-        attributes.preferLowPowerToHighPerformance = true;
</del><ins>+        attributes.powerPreference = GraphicsContext3DPowerPreference::LowPower;
</ins><span class="cx"> 
</span><span class="cx">     if (page)
</span><span class="cx">         attributes.devicePixelRatio = page-&gt;deviceScaleFactor();
</span><span class="lines">@@ -536,7 +536,7 @@
</span><span class="cx">     if (!tracker)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_trackerToken = tracker-&gt;token(m_attributes.initialPreferLowPowerToHighPerformance);
</del><ins>+    m_trackerToken = tracker-&gt;token(m_attributes.initialPowerPreference);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebGLRenderingContextBase::initializeNewContext()
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreplatformWebGLStateTrackercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/platform/WebGLStateTracker.cpp (212528 => 212529)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/platform/WebGLStateTracker.cpp        2017-02-17 05:28:11 UTC (rev 212528)
+++ branches/safari-603-branch/Source/WebCore/platform/WebGLStateTracker.cpp        2017-02-17 05:28:16 UTC (rev 212529)
</span><span class="lines">@@ -34,10 +34,10 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-auto WebGLStateTracker::token(bool preferLowPower) -&gt; Token
</del><ins>+auto WebGLStateTracker::token(GraphicsContext3DPowerPreference powerPreference) -&gt; Token
</ins><span class="cx"> {
</span><span class="cx">     // We only track high performance WebGL contexts at the moment.
</span><del>-    if (preferLowPower)
</del><ins>+    if (powerPreference != GraphicsContext3DPowerPreference::HighPerformance)
</ins><span class="cx">         return { };
</span><span class="cx">     return m_webGLContextCounter.count();
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreplatformWebGLStateTrackerh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/platform/WebGLStateTracker.h (212528 => 212529)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/platform/WebGLStateTracker.h        2017-02-17 05:28:11 UTC (rev 212528)
+++ branches/safari-603-branch/Source/WebCore/platform/WebGLStateTracker.h        2017-02-17 05:28:16 UTC (rev 212529)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#include &quot;GraphicsContext3DAttributes.h&quot;
</ins><span class="cx"> #include &lt;wtf/Function.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounter.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -39,7 +40,7 @@
</span><span class="cx">     using WebGLContextCounter = RefCounter&lt;WebGLContextCounterType&gt;;
</span><span class="cx">     using Token = WebGLContextCounter::Token;
</span><span class="cx"> 
</span><del>-    Token token(bool preferLowPower);
</del><ins>+    Token token(GraphicsContext3DPowerPreference);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     void updateWebGLState();
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreplatformgraphicsGraphicsContext3DAttributesh"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h (212528 => 212529)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h        2017-02-17 05:28:11 UTC (rev 212528)
+++ branches/safari-603-branch/Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h        2017-02-17 05:28:16 UTC (rev 212529)
</span><span class="lines">@@ -27,6 +27,12 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+enum class GraphicsContext3DPowerPreference {
+    Default,
+    LowPower,
+    HighPerformance
+};
+
</ins><span class="cx"> struct GraphicsContext3DAttributes {
</span><span class="cx">     // WebGLContextAttributes
</span><span class="cx">     bool alpha { true };
</span><span class="lines">@@ -35,8 +41,9 @@
</span><span class="cx">     bool antialias { true };
</span><span class="cx">     bool premultipliedAlpha { true };
</span><span class="cx">     bool preserveDrawingBuffer { false };
</span><del>-    bool preferLowPowerToHighPerformance { false };
</del><span class="cx">     bool failIfMajorPerformanceCaveat { false };
</span><ins>+    using PowerPreference = GraphicsContext3DPowerPreference;
+    PowerPreference powerPreference { PowerPreference::Default };
</ins><span class="cx"> 
</span><span class="cx">     // Additional attributes.
</span><span class="cx">     bool forceSoftwareRenderer { false };
</span><span class="lines">@@ -44,7 +51,7 @@
</span><span class="cx">     bool useGLES3 { false };
</span><span class="cx">     bool noExtensions { false };
</span><span class="cx">     float devicePixelRatio { 1 };
</span><del>-    bool initialPreferLowPowerToHighPerformance { false };
</del><ins>+    PowerPreference initialPowerPreference { PowerPreference::Default };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreplatformgraphicsmacGraphicsContext3DMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm (212528 => 212529)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm        2017-02-17 05:28:11 UTC (rev 212528)
+++ branches/safari-603-branch/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm        2017-02-17 05:28:16 UTC (rev 212529)
</span><span class="lines">@@ -195,8 +195,10 @@
</span><span class="cx">     return canMux;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void setPixelFormat(Vector&lt;CGLPixelFormatAttribute&gt;&amp; attribs, int colorBits, int depthBits, bool accelerated, bool supersample, bool closest, bool antialias, bool allowOffline, bool useGLES3)
</del><ins>+static void setPixelFormat(Vector&lt;CGLPixelFormatAttribute&gt;&amp; attribs, int colorBits, int depthBits, bool accelerated, bool supersample, bool closest, bool antialias, GraphicsContext3DPowerPreference powerPreference, bool useGLES3)
</ins><span class="cx"> {
</span><ins>+    bool allowOffline = powerPreference != GraphicsContext3DPowerPreference::HighPerformance;
+
</ins><span class="cx">     attribs.clear();
</span><span class="cx">     
</span><span class="cx">     attribs.append(kCGLPFAColorSize);
</span><span class="lines">@@ -317,19 +319,19 @@
</span><span class="cx"> 
</span><span class="cx">     bool useMultisampling = m_attrs.antialias;
</span><span class="cx"> 
</span><del>-    setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, true, false, useMultisampling, attrs.preferLowPowerToHighPerformance, attrs.useGLES3);
</del><ins>+    setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, true, false, useMultisampling, attrs.powerPreference, attrs.useGLES3);
</ins><span class="cx">     CGLChoosePixelFormat(attribs.data(), &amp;pixelFormatObj, &amp;numPixelFormats);
</span><span class="cx"> 
</span><span class="cx">     if (!numPixelFormats) {
</span><del>-        setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.preferLowPowerToHighPerformance, attrs.useGLES3);
</del><ins>+        setPixelFormat(attribs, 32, 32, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.powerPreference, attrs.useGLES3);
</ins><span class="cx">         CGLChoosePixelFormat(attribs.data(), &amp;pixelFormatObj, &amp;numPixelFormats);
</span><span class="cx"> 
</span><span class="cx">         if (!numPixelFormats) {
</span><del>-            setPixelFormat(attribs, 32, 16, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.preferLowPowerToHighPerformance, attrs.useGLES3);
</del><ins>+            setPixelFormat(attribs, 32, 16, !attrs.forceSoftwareRenderer, false, false, useMultisampling, attrs.powerPreference, attrs.useGLES3);
</ins><span class="cx">             CGLChoosePixelFormat(attribs.data(), &amp;pixelFormatObj, &amp;numPixelFormats);
</span><span class="cx"> 
</span><span class="cx">             if (!attrs.forceSoftwareRenderer &amp;&amp; !numPixelFormats) {
</span><del>-                setPixelFormat(attribs, 32, 16, false, false, true, false, false, attrs.useGLES3);
</del><ins>+                setPixelFormat(attribs, 32, 16, false, false, true, false, GraphicsContext3DPowerPreference::Default, attrs.useGLES3);
</ins><span class="cx">                 CGLChoosePixelFormat(attribs.data(), &amp;pixelFormatObj, &amp;numPixelFormats);
</span><span class="cx">                 useMultisampling = false;
</span><span class="cx">             }
</span></span></pre>
</div>
</div>

</body>
</html>