<!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>[192975] branches/safari-601.1.46-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/192975">192975</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2015-12-02 15:04:16 -0800 (Wed, 02 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/190383">r190383</a>. rdar://problem/23432383</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601146branchLayoutTestsChangeLog">branches/safari-601.1.46-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreChangeLog">branches/safari-601.1.46-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari601146branchSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp">branches/safari-601.1.46-branch/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCorehtmlcanvasCanvasRenderingContext2Dh">branches/safari-601.1.46-branch/Source/WebCore/html/canvas/CanvasRenderingContext2D.h</a></li>
<li><a href="#branchessafari601146branchSourceWebCorehtmlcanvasCanvasRenderingContext2Didl">branches/safari-601.1.46-branch/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari601146branchLayoutTestsfastcanvascanvasimageSmoothingQualityexpectedtxt">branches/safari-601.1.46-branch/LayoutTests/fast/canvas/canvas-imageSmoothingQuality-expected.txt</a></li>
<li><a href="#branchessafari601146branchLayoutTestsfastcanvascanvasimageSmoothingQualityhtml">branches/safari-601.1.46-branch/LayoutTests/fast/canvas/canvas-imageSmoothingQuality.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601146branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/ChangeLog (192974 => 192975)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/ChangeLog        2015-12-02 23:04:11 UTC (rev 192974)
+++ branches/safari-601.1.46-branch/LayoutTests/ChangeLog        2015-12-02 23:04:16 UTC (rev 192975)
</span><span class="lines">@@ -1,5 +1,22 @@
</span><span class="cx"> 2015-12-01  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r190383. rdar://problem/23432383
+
+    2015-09-30  Katlyn Graff  &lt;kgraff@apple.com&gt;
+
+            Tests support for imageSmoothingQuality attribute of Canvas element.
+            https://bugs.webkit.org/show_bug.cgi?id=149541
+
+            Reviewed by Ryosuke Niwa.
+
+            Tests low, medium, high, and default values, value persistence when
+            imageSmoothingEnabled is changed, and invalid input.
+
+            * fast/canvas/canvas-imageSmoothingQuality-expected.txt: Added.
+            * fast/canvas/canvas-imageSmoothingQuality.html: Added.
+
+2015-12-01  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r188194. rdar://problem/23432383
</span><span class="cx"> 
</span><span class="cx">     2015-08-08  Dean Jackson  &lt;dino@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestsfastcanvascanvasimageSmoothingQualityexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-601.1.46-branch/LayoutTests/fast/canvas/canvas-imageSmoothingQuality-expected.txt (0 => 192975)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/fast/canvas/canvas-imageSmoothingQuality-expected.txt                                (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/canvas/canvas-imageSmoothingQuality-expected.txt        2015-12-02 23:04:16 UTC (rev 192975)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+Tests for the imageSmoothingQuality attribute.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+PASS lowContext.imageSmoothingQuality is 'low'
+PASS mediumContext.imageSmoothingQuality is 'medium'
+PASS highContext.imageSmoothingQuality is 'high'
+
+PASS lowData is not mediumData
+PASS mediumData is not highData
+PASS lowData is not highData
+
+PASS sampleAlpha(lowData) is &gt;= sampleAlpha(mediumData)
+PASS sampleAlpha(mediumData) is &gt;= sampleAlpha(highData)
+
+PASS defaultContext.imageSmoothingQuality is 'low'
+
+PASS highContext.imageSmoothingEnabled = false; highContext.imageSmoothingQuality is 'high'
+PASS highContext.imageSmoothingQuality = 'medium'; highContext.imageSmoothingQuality is 'medium'
+
+highContext.imageSmoothingEnabled = true; highContext.imageSmoothingQuality = 'high';
+PASS scaleImageData(highCanvas, '3223') did not throw exception.
+PASS highContext.imageSmoothingQuality is 'high'
+PASS scaleImageData(highCanvas, 'bad_input') did not throw exception.
+PASS highContext.imageSmoothingQuality is 'high'
+PASS scaleImageData(highCanvas, 'LOW') did not throw exception.
+PASS highContext.imageSmoothingQuality is 'high'
+PASS scaleImageData(highCanvas, 'Medium') did not throw exception.
+PASS highContext.imageSmoothingQuality is 'high'
+
+highContext.save(); highContext.imageSmoothingQuality = 'medium';
+PASS highContext.restore(); highContext.imageSmoothingQuality is 'high'
+PASS scaleImageData(highCanvas, highCanvas.imageSmoothingQuality); is highData
+
+PASS successfullyParsed is true
+
+TEST COMPLETE

</ins></span></pre></div>
<a id="branchessafari601146branchLayoutTestsfastcanvascanvasimageSmoothingQualityhtml"></a>
<div class="addfile"><h4>Added: branches/safari-601.1.46-branch/LayoutTests/fast/canvas/canvas-imageSmoothingQuality.html (0 => 192975)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/fast/canvas/canvas-imageSmoothingQuality.html                                (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/canvas/canvas-imageSmoothingQuality.html        2015-12-02 23:04:16 UTC (rev 192975)
</span><span class="lines">@@ -0,0 +1,114 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+
+&lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;canvas id=&quot;source&quot;&gt;&lt;/canvas&gt;
+
+&lt;script&gt;
+
+description(&quot;Tests for the imageSmoothingQuality attribute.&quot;);
+
+if (window.testRunner)
+   testRunner.overridePreference(&quot;WebKitCanvasUsesAcceleratedDrawing&quot;, 0);
+
+var source = document.getElementById(&quot;source&quot;);
+source.width = 60;
+source.height = 12;
+var sourceContext = source.getContext(&quot;2d&quot;);
+var sourceImage = sourceContext.createImageData(source.width, source.height);
+
+function drawBlackDot(x, y) {
+    var offset = y * 4 * source.width + x * 4;
+    sourceImage.data[offset + 0] = 0; // R
+    sourceImage.data[offset + 1] = 0; // G
+    sourceImage.data[offset + 2] = 0; // B
+    sourceImage.data[offset + 3] = 255; // Alpha
+}
+
+for (var x = 0; x &lt; source.width; x++) {
+    drawBlackDot(x, 1)
+    drawBlackDot(x, 2);
+}
+
+sourceContext.putImageData(sourceImage, 0, 0);
+
+function scaleTestResults(quality){
+        var canvas = document.createElement(&quot;canvas&quot;);
+        canvas.id = quality + &quot;Canvas&quot;;
+        document.body.appendChild(canvas);
+        canvas.width = sourceImage.width / 4;
+    canvas.height = sourceImage.height / 4;
+    return scaleImageData(canvas, quality);
+}
+
+function scaleImageData(destinationCanvas, quality) {
+    var context = destinationCanvas.getContext(&quot;2d&quot;);
+
+    if (quality)
+        context.imageSmoothingQuality = quality;
+
+    context.drawImage(source, 0, 0, destinationCanvas.width, destinationCanvas.height);
+    var data = context.getImageData(0, 0, 1, 1).data;
+    context.clearRect(0, 0, destinationCanvas.width, destinationCanvas.height);
+    return JSON.stringify(data);
+}
+
+function testInvalidInput(badInput){
+        shouldNotThrow(badInput);
+        shouldBe(&quot;highContext.imageSmoothingQuality&quot;, &quot;'high'&quot;);
+}
+
+function sampleAlpha(data){
+        return data[3];
+}
+
+debug(&quot;&quot;);
+
+var lowData = scaleTestResults(&quot;low&quot;);
+var lowContext = document.getElementById(&quot;lowCanvas&quot;).getContext('2d');
+shouldBe(&quot;lowContext.imageSmoothingQuality&quot;, &quot;'low'&quot;);
+
+var mediumData = scaleTestResults(&quot;medium&quot;);
+var mediumContext = document.getElementById(&quot;mediumCanvas&quot;).getContext('2d');
+shouldBe(&quot;mediumContext.imageSmoothingQuality&quot;, &quot;'medium'&quot;);
+
+var highData = scaleTestResults(&quot;high&quot;);
+var highContext = document.getElementById(&quot;highCanvas&quot;).getContext('2d');
+shouldBe(&quot;highContext.imageSmoothingQuality&quot;, &quot;'high'&quot;);
+
+debug(&quot;&quot;);
+shouldNotBe(&quot;lowData&quot;, &quot;mediumData&quot;);
+shouldNotBe(&quot;mediumData&quot;, &quot;highData&quot;);
+shouldNotBe(&quot;lowData&quot;, &quot;highData&quot;);
+
+debug(&quot;&quot;);
+shouldBeGreaterThanOrEqual(&quot;sampleAlpha(lowData)&quot;, &quot;sampleAlpha(mediumData)&quot;);
+shouldBeGreaterThanOrEqual(&quot;sampleAlpha(mediumData)&quot;, &quot;sampleAlpha(highData)&quot;);
+
+debug(&quot;&quot;);
+var defaultContext = sourceContext;
+shouldBe(&quot;defaultContext.imageSmoothingQuality&quot;, &quot;'low'&quot;);
+
+debug(&quot;&quot;);
+shouldBe(&quot;highContext.imageSmoothingEnabled = false; highContext.imageSmoothingQuality&quot;, &quot;'high'&quot;);
+shouldBe(&quot;highContext.imageSmoothingQuality = 'medium'; highContext.imageSmoothingQuality&quot;, &quot;'medium'&quot;);
+
+debug(&quot;&quot;);
+evalAndLog(&quot;highContext.imageSmoothingEnabled = true; highContext.imageSmoothingQuality = 'high';&quot;);
+var highCanvas = document.getElementById(&quot;highCanvas&quot;);
+testInvalidInput(&quot;scaleImageData(highCanvas, '3223')&quot;);
+testInvalidInput(&quot;scaleImageData(highCanvas, 'bad_input')&quot;);
+testInvalidInput(&quot;scaleImageData(highCanvas, 'LOW')&quot;);
+testInvalidInput(&quot;scaleImageData(highCanvas, 'Medium')&quot;);
+
+debug(&quot;&quot;);
+evalAndLog(&quot;highContext.save(); highContext.imageSmoothingQuality = 'medium';&quot;);
+shouldBe(&quot;highContext.restore(); highContext.imageSmoothingQuality&quot;, &quot;'high'&quot;);
+shouldBe(&quot;scaleImageData(highCanvas, highCanvas.imageSmoothingQuality);&quot;, &quot;highData&quot;);
+
+debug(&quot;&quot;);
+
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (192974 => 192975)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog        2015-12-02 23:04:11 UTC (rev 192974)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog        2015-12-02 23:04:16 UTC (rev 192975)
</span><span class="lines">@@ -1,5 +1,33 @@
</span><span class="cx"> 2015-12-01  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r190383. rdar://problem/23432383
+
+    2015-09-30  Katlyn Graff  &lt;kgraff@apple.com&gt;
+
+            Add support for the imageSmoothingQuality property for CanvasRenderingContext2D.
+            https://bugs.webkit.org/show_bug.cgi?id=149541
+
+            Reviewed by Ryosuke Niwa.
+
+            As documented here: https://html.spec.whatwg.org/multipage/scripting.html#image-smoothing
+            Exposes the smooothing quality of algorithms used for scaling images. Valid input
+            values are low, medium, and high: associated algorithms are expected to vary for
+            differing hardware. setImageSmoothingQuality provides a handle into CGInterpolationQuality.
+
+            Test: fast/canvas/canvas-imageSmoothingQuality.html
+
+            * html/canvas/CanvasRenderingContext2D.cpp:
+            (WebCore::CanvasRenderingContext2D::State::State):
+            (WebCore::CanvasRenderingContext2D::State::operator=):
+            (WebCore::smoothingToInterpolationQuality):
+            (WebCore::CanvasRenderingContext2D::imageSmoothingQuality):
+            (WebCore::CanvasRenderingContext2D::setImageSmoothingQuality):
+            (WebCore::CanvasRenderingContext2D::setImageSmoothingEnabled):
+            * html/canvas/CanvasRenderingContext2D.h:
+            * html/canvas/CanvasRenderingContext2D.idl:
+
+2015-12-01  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r188194. rdar://problem/23432383
</span><span class="cx"> 
</span><span class="cx">     2015-08-08  Dean Jackson  &lt;dino@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (192974 => 192975)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2015-12-02 23:04:11 UTC (rev 192974)
+++ branches/safari-601.1.46-branch/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2015-12-02 23:04:16 UTC (rev 192975)
</span><span class="lines">@@ -42,7 +42,6 @@
</span><span class="cx"> #include &quot;DOMPath.h&quot;
</span><span class="cx"> #include &quot;ExceptionCodePlaceholder.h&quot;
</span><span class="cx"> #include &quot;FloatQuad.h&quot;
</span><del>-#include &quot;GraphicsContext.h&quot;
</del><span class="cx"> #include &quot;HTMLImageElement.h&quot;
</span><span class="cx"> #include &quot;HTMLVideoElement.h&quot;
</span><span class="cx"> #include &quot;ImageData.h&quot;
</span><span class="lines">@@ -173,6 +172,7 @@
</span><span class="cx">     , hasInvertibleTransform(true)
</span><span class="cx">     , lineDashOffset(0)
</span><span class="cx">     , imageSmoothingEnabled(true)
</span><ins>+    , imageSmoothingQuality(SmoothingQuality::Low)
</ins><span class="cx">     , textAlign(StartTextAlign)
</span><span class="cx">     , textBaseline(AlphabeticTextBaseline)
</span><span class="cx">     , direction(Direction::Inherit)
</span><span class="lines">@@ -199,6 +199,7 @@
</span><span class="cx">     , hasInvertibleTransform(other.hasInvertibleTransform)
</span><span class="cx">     , lineDashOffset(other.lineDashOffset)
</span><span class="cx">     , imageSmoothingEnabled(other.imageSmoothingEnabled)
</span><ins>+    , imageSmoothingQuality(other.imageSmoothingQuality)
</ins><span class="cx">     , textAlign(other.textAlign)
</span><span class="cx">     , textBaseline(other.textBaseline)
</span><span class="cx">     , direction(other.direction)
</span><span class="lines">@@ -229,6 +230,7 @@
</span><span class="cx">     transform = other.transform;
</span><span class="cx">     hasInvertibleTransform = other.hasInvertibleTransform;
</span><span class="cx">     imageSmoothingEnabled = other.imageSmoothingEnabled;
</span><ins>+    imageSmoothingQuality = other.imageSmoothingQuality;
</ins><span class="cx">     textAlign = other.textAlign;
</span><span class="cx">     textBaseline = other.textBaseline;
</span><span class="cx">     direction = other.direction;
</span><span class="lines">@@ -2494,6 +2496,63 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+static InterpolationQuality smoothingToInterpolationQuality(CanvasRenderingContext2D::SmoothingQuality quality)
+{
+    switch (quality) {
+    case CanvasRenderingContext2D::SmoothingQuality::Low:
+        return InterpolationLow;
+    case CanvasRenderingContext2D::SmoothingQuality::Medium:
+        return InterpolationMedium;
+    case CanvasRenderingContext2D::SmoothingQuality::High:
+        return InterpolationHigh;
+    }
+
+    ASSERT_NOT_REACHED();
+    return InterpolationLow;
+};
+
+String CanvasRenderingContext2D::imageSmoothingQuality() const
+{
+    switch (state().imageSmoothingQuality) {
+    case SmoothingQuality::Low:
+        return ASCIILiteral(&quot;low&quot;);
+    case SmoothingQuality::Medium:
+        return ASCIILiteral(&quot;medium&quot;);
+    case SmoothingQuality::High:
+        return ASCIILiteral(&quot;high&quot;);
+    }
+
+    ASSERT_NOT_REACHED();
+    return ASCIILiteral(&quot;low&quot;);
+}
+
+void CanvasRenderingContext2D::setImageSmoothingQuality(const String&amp; smoothingQualityString)
+{
+    SmoothingQuality quality;
+    if (smoothingQualityString == &quot;low&quot;)
+        quality = SmoothingQuality::Low;
+    else if (smoothingQualityString == &quot;medium&quot;)
+        quality = SmoothingQuality::Medium;
+    else if (smoothingQualityString == &quot;high&quot;)
+        quality = SmoothingQuality::High;
+    else {
+        ASSERT_NOT_REACHED();
+        return;
+    }
+
+    if (quality == state().imageSmoothingQuality)
+        return;
+
+    realizeSaves();
+    modifiableState().imageSmoothingQuality = quality;
+
+    if (!modifiableState().imageSmoothingEnabled)
+        return;
+
+    if (auto* context = drawingContext())
+        context-&gt;setImageInterpolationQuality(smoothingToInterpolationQuality(quality));
+}
+
</ins><span class="cx"> bool CanvasRenderingContext2D::imageSmoothingEnabled() const
</span><span class="cx"> {
</span><span class="cx">     return state().imageSmoothingEnabled;
</span><span class="lines">@@ -2508,7 +2567,7 @@
</span><span class="cx">     modifiableState().imageSmoothingEnabled = enabled;
</span><span class="cx">     GraphicsContext* c = drawingContext();
</span><span class="cx">     if (c)
</span><del>-        c-&gt;setImageInterpolationQuality(enabled ? DefaultInterpolationQuality : InterpolationNone);
</del><ins>+        c-&gt;setImageInterpolationQuality(enabled ? smoothingToInterpolationQuality(state().imageSmoothingQuality) : InterpolationNone);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorehtmlcanvasCanvasRenderingContext2Dh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/html/canvas/CanvasRenderingContext2D.h (192974 => 192975)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/html/canvas/CanvasRenderingContext2D.h        2015-12-02 23:04:11 UTC (rev 192974)
+++ branches/safari-601.1.46-branch/Source/WebCore/html/canvas/CanvasRenderingContext2D.h        2015-12-02 23:04:16 UTC (rev 192975)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &quot;ColorSpace.h&quot;
</span><span class="cx"> #include &quot;FloatSize.h&quot;
</span><span class="cx"> #include &quot;FontCascade.h&quot;
</span><ins>+#include &quot;GraphicsContext.h&quot;
</ins><span class="cx"> #include &quot;GraphicsTypes.h&quot;
</span><span class="cx"> #include &quot;ImageBuffer.h&quot;
</span><span class="cx"> #include &quot;Path.h&quot;
</span><span class="lines">@@ -228,6 +229,15 @@
</span><span class="cx">     bool imageSmoothingEnabled() const;
</span><span class="cx">     void setImageSmoothingEnabled(bool);
</span><span class="cx"> 
</span><ins>+    String imageSmoothingQuality() const;
+    void setImageSmoothingQuality(const String&amp;);
+
+    enum class SmoothingQuality {
+        Low,
+        Medium,
+        High
+    };
+
</ins><span class="cx"> private:
</span><span class="cx">     enum class Direction {
</span><span class="cx">         Inherit,
</span><span class="lines">@@ -281,6 +291,7 @@
</span><span class="cx">         Vector&lt;float&gt; lineDash;
</span><span class="cx">         float lineDashOffset;
</span><span class="cx">         bool imageSmoothingEnabled;
</span><ins>+        SmoothingQuality imageSmoothingQuality;
</ins><span class="cx"> 
</span><span class="cx">         // Text state.
</span><span class="cx">         TextAlign textAlign;
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorehtmlcanvasCanvasRenderingContext2Didl"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl (192974 => 192975)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl        2015-12-02 23:04:11 UTC (rev 192974)
+++ branches/safari-601.1.46-branch/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl        2015-12-02 23:04:16 UTC (rev 192975)
</span><span class="lines">@@ -23,6 +23,7 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+enum ImageSmoothingQuality { &quot;low&quot;, &quot;medium&quot;, &quot;high&quot; };
</ins><span class="cx"> enum CanvasWindingRule { &quot;nonzero&quot;, &quot;evenodd&quot; };
</span><span class="cx"> 
</span><span class="cx"> interface CanvasRenderingContext2D : CanvasRenderingContext {
</span><span class="lines">@@ -188,5 +189,6 @@
</span><span class="cx"> 
</span><span class="cx">     attribute boolean imageSmoothingEnabled;
</span><span class="cx">     [ImplementedAs=imageSmoothingEnabled] attribute boolean webkitImageSmoothingEnabled;
</span><ins>+    attribute ImageSmoothingQuality imageSmoothingQuality;
</ins><span class="cx"> };
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>