<!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>[190273] 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/190273">190273</a></dd>
<dt>Author</dt> <dd>said@apple.com</dd>
<dt>Date</dt> <dd>2015-09-27 20:43:00 -0700 (Sun, 27 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Rename all the variables and parameters of type HTMLImageElement in CanvasRenderingContext2D.cpp from 'image' to 'imageElement'

Patch by Said Abou-Hallawa &lt;sabouhallawa@apple.com&gt; on 2015-09-27
Reviewed by Darin Adler.

This does not change functionality in this file. It is a preparation for
the fix of the https://bugs.webkit.org/show_bug.cgi?id=148845.

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::size):
(WebCore::normalizeRect):
(WebCore::CanvasRenderingContext2D::drawImageFromRect):
(WebCore::CanvasRenderingContext2D::setAlpha):
(WebCore::CanvasRenderingContext2D::createRadialGradient):
(WebCore::CanvasRenderingContext2D::createPattern):
(WebCore::CanvasRenderingContext2D::drawImage):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp">trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (190272 => 190273)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-09-27 22:24:18 UTC (rev 190272)
+++ trunk/Source/WebCore/ChangeLog        2015-09-28 03:43:00 UTC (rev 190273)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-09-27  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
+
+        Rename all the variables and parameters of type HTMLImageElement in CanvasRenderingContext2D.cpp from 'image' to 'imageElement'
+
+        Reviewed by Darin Adler.
+
+        This does not change functionality in this file. It is a preparation for
+        the fix of the https://bugs.webkit.org/show_bug.cgi?id=148845.
+
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::size):
+        (WebCore::normalizeRect):
+        (WebCore::CanvasRenderingContext2D::drawImageFromRect):
+        (WebCore::CanvasRenderingContext2D::setAlpha):
+        (WebCore::CanvasRenderingContext2D::createRadialGradient):
+        (WebCore::CanvasRenderingContext2D::createPattern):
+        (WebCore::CanvasRenderingContext2D::drawImage):
+
</ins><span class="cx"> 2015-09-27  Yusuke Suzuki  &lt;utatane.tea@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [ES6] Implement ES6 Module loader hook stubs in WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (190272 => 190273)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2015-09-27 22:24:18 UTC (rev 190272)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2015-09-28 03:43:00 UTC (rev 190273)
</span><span class="lines">@@ -1326,14 +1326,14 @@
</span><span class="cx">     ImageSizeBeforeDevicePixelRatio
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-static LayoutSize size(HTMLImageElement* image, ImageSizeType sizeType)
</del><ins>+static LayoutSize size(HTMLImageElement* imageElement, ImageSizeType sizeType)
</ins><span class="cx"> {
</span><span class="cx">     LayoutSize size;
</span><del>-    if (CachedImage* cachedImage = image-&gt;cachedImage()) {
-        size = cachedImage-&gt;imageSizeForRenderer(image-&gt;renderer(), 1.0f); // FIXME: Not sure about this.
</del><ins>+    if (CachedImage* cachedImage = imageElement-&gt;cachedImage()) {
+        size = cachedImage-&gt;imageSizeForRenderer(imageElement-&gt;renderer(), 1.0f); // FIXME: Not sure about this.
</ins><span class="cx"> 
</span><del>-        if (sizeType == ImageSizeAfterDevicePixelRatio &amp;&amp; is&lt;RenderImage&gt;(image-&gt;renderer()) &amp;&amp; cachedImage-&gt;image() &amp;&amp; !cachedImage-&gt;image()-&gt;hasRelativeWidth())
-            size.scale(downcast&lt;RenderImage&gt;(*image-&gt;renderer()).imageDevicePixelRatio());
</del><ins>+        if (sizeType == ImageSizeAfterDevicePixelRatio &amp;&amp; is&lt;RenderImage&gt;(imageElement-&gt;renderer()) &amp;&amp; cachedImage-&gt;image() &amp;&amp; !cachedImage-&gt;image()-&gt;hasRelativeWidth())
+            size.scale(downcast&lt;RenderImage&gt;(*imageElement-&gt;renderer()).imageDevicePixelRatio());
</ins><span class="cx">     }
</span><span class="cx">     return size;
</span><span class="cx"> }
</span><span class="lines">@@ -1355,42 +1355,42 @@
</span><span class="cx">         std::max(rect.height(), -rect.height()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, float x, float y, ExceptionCode&amp; ec)
</del><ins>+void CanvasRenderingContext2D::drawImage(HTMLImageElement* imageElement, float x, float y, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    if (!image) {
</del><ins>+    if (!imageElement) {
</ins><span class="cx">         ec = TYPE_MISMATCH_ERR;
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    LayoutSize destRectSize = size(image, ImageSizeAfterDevicePixelRatio);
-    drawImage(image, x, y, destRectSize.width(), destRectSize.height(), ec);
</del><ins>+    LayoutSize destRectSize = size(imageElement, ImageSizeAfterDevicePixelRatio);
+    drawImage(imageElement, x, y, destRectSize.width(), destRectSize.height(), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::drawImage(HTMLImageElement* image,
</del><ins>+void CanvasRenderingContext2D::drawImage(HTMLImageElement* imageElement,
</ins><span class="cx">     float x, float y, float width, float height, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    if (!image) {
</del><ins>+    if (!imageElement) {
</ins><span class="cx">         ec = TYPE_MISMATCH_ERR;
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    LayoutSize sourceRectSize = size(image, ImageSizeBeforeDevicePixelRatio);
-    drawImage(image, FloatRect(0, 0, sourceRectSize.width(), sourceRectSize.height()), FloatRect(x, y, width, height), ec);
</del><ins>+    LayoutSize sourceRectSize = size(imageElement, ImageSizeBeforeDevicePixelRatio);
+    drawImage(imageElement, FloatRect(0, 0, sourceRectSize.width(), sourceRectSize.height()), FloatRect(x, y, width, height), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::drawImage(HTMLImageElement* image,
</del><ins>+void CanvasRenderingContext2D::drawImage(HTMLImageElement* imageElement,
</ins><span class="cx">     float sx, float sy, float sw, float sh,
</span><span class="cx">     float dx, float dy, float dw, float dh, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    drawImage(image, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), ec);
</del><ins>+    drawImage(imageElement, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRect&amp; srcRect, const FloatRect&amp; dstRect, ExceptionCode&amp; ec)
</del><ins>+void CanvasRenderingContext2D::drawImage(HTMLImageElement* imageElement, const FloatRect&amp; srcRect, const FloatRect&amp; dstRect, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    drawImage(image, srcRect, dstRect, state().globalComposite, state().globalBlend, ec);
</del><ins>+    drawImage(imageElement, srcRect, dstRect, state().globalComposite, state().globalBlend, ec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRect&amp; srcRect, const FloatRect&amp; dstRect, const CompositeOperator&amp; op, const BlendMode&amp; blendMode, ExceptionCode&amp; ec)
</del><ins>+void CanvasRenderingContext2D::drawImage(HTMLImageElement* imageElement, const FloatRect&amp; srcRect, const FloatRect&amp; dstRect, const CompositeOperator&amp; op, const BlendMode&amp; blendMode, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    if (!image) {
</del><ins>+    if (!imageElement) {
</ins><span class="cx">         ec = TYPE_MISMATCH_ERR;
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -1404,13 +1404,13 @@
</span><span class="cx">     if (!dstRect.width() || !dstRect.height())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (!image-&gt;complete())
</del><ins>+    if (!imageElement-&gt;complete())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     FloatRect normalizedSrcRect = normalizeRect(srcRect);
</span><span class="cx">     FloatRect normalizedDstRect = normalizeRect(dstRect);
</span><span class="cx"> 
</span><del>-    FloatRect imageRect = FloatRect(FloatPoint(), size(image, ImageSizeBeforeDevicePixelRatio));
</del><ins>+    FloatRect imageRect = FloatRect(FloatPoint(), size(imageElement, ImageSizeBeforeDevicePixelRatio));
</ins><span class="cx">     if (!srcRect.width() || !srcRect.height()) {
</span><span class="cx">         ec = INDEX_SIZE_ERR;
</span><span class="cx">         return;
</span><span class="lines">@@ -1424,26 +1424,30 @@
</span><span class="cx">     if (!state().hasInvertibleTransform)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CachedImage* cachedImage = image-&gt;cachedImage();
</del><ins>+    CachedImage* cachedImage = imageElement-&gt;cachedImage();
</ins><span class="cx">     if (!cachedImage)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    Image* image = cachedImage-&gt;imageForRenderer(imageElement-&gt;renderer());
+    if (!image)
+        return;
+
</ins><span class="cx">     if (rectContainsCanvas(normalizedDstRect)) {
</span><del>-        c-&gt;drawImage(cachedImage-&gt;imageForRenderer(image-&gt;renderer()), ColorSpaceDeviceRGB, normalizedDstRect, normalizedSrcRect, ImagePaintingOptions(op, blendMode));
</del><ins>+        c-&gt;drawImage(image, ColorSpaceDeviceRGB, normalizedDstRect, normalizedSrcRect, ImagePaintingOptions(op, blendMode));
</ins><span class="cx">         didDrawEntireCanvas();
</span><span class="cx">     } else if (isFullCanvasCompositeMode(op)) {
</span><del>-        fullCanvasCompositedDrawImage(cachedImage-&gt;imageForRenderer(image-&gt;renderer()), ColorSpaceDeviceRGB, normalizedDstRect, normalizedSrcRect, op);
</del><ins>+        fullCanvasCompositedDrawImage(image, ColorSpaceDeviceRGB, normalizedDstRect, normalizedSrcRect, op);
</ins><span class="cx">         didDrawEntireCanvas();
</span><span class="cx">     } else if (op == CompositeCopy) {
</span><span class="cx">         clearCanvas();
</span><del>-        c-&gt;drawImage(cachedImage-&gt;imageForRenderer(image-&gt;renderer()), ColorSpaceDeviceRGB, normalizedDstRect, normalizedSrcRect, ImagePaintingOptions(op, blendMode));
</del><ins>+        c-&gt;drawImage(image, ColorSpaceDeviceRGB, normalizedDstRect, normalizedSrcRect, ImagePaintingOptions(op, blendMode));
</ins><span class="cx">         didDrawEntireCanvas();
</span><span class="cx">     } else {
</span><del>-        c-&gt;drawImage(cachedImage-&gt;imageForRenderer(image-&gt;renderer()), ColorSpaceDeviceRGB, normalizedDstRect, normalizedSrcRect, ImagePaintingOptions(op, blendMode));
</del><ins>+        c-&gt;drawImage(image, ColorSpaceDeviceRGB, normalizedDstRect, normalizedSrcRect, ImagePaintingOptions(op, blendMode));
</ins><span class="cx">         didDraw(normalizedDstRect);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    checkOrigin(image);
</del><ins>+    checkOrigin(imageElement);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, float x, float y, ExceptionCode&amp; ec)
</span><span class="lines">@@ -1611,7 +1615,7 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::drawImageFromRect(HTMLImageElement* image,
</del><ins>+void CanvasRenderingContext2D::drawImageFromRect(HTMLImageElement* imageElement,
</ins><span class="cx">     float sx, float sy, float sw, float sh,
</span><span class="cx">     float dx, float dy, float dw, float dh,
</span><span class="cx">     const String&amp; compositeOperation)
</span><span class="lines">@@ -1621,7 +1625,7 @@
</span><span class="cx">     if (!parseCompositeAndBlendOperator(compositeOperation, op, blendOp) || blendOp != BlendModeNormal)
</span><span class="cx">         op = CompositeSourceOver;
</span><span class="cx"> 
</span><del>-    drawImage(image, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), op, BlendModeNormal, IGNORE_EXCEPTION);
</del><ins>+    drawImage(imageElement, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), op, BlendModeNormal, IGNORE_EXCEPTION);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::setAlpha(float alpha)
</span><span class="lines">@@ -1788,10 +1792,10 @@
</span><span class="cx">     return WTF::move(gradient);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CanvasPattern&gt; CanvasRenderingContext2D::createPattern(HTMLImageElement* image,
</del><ins>+RefPtr&lt;CanvasPattern&gt; CanvasRenderingContext2D::createPattern(HTMLImageElement* imageElement,
</ins><span class="cx">     const String&amp; repetitionType, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    if (!image) {
</del><ins>+    if (!imageElement) {
</ins><span class="cx">         ec = TYPE_MISMATCH_ERR;
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="lines">@@ -1801,9 +1805,9 @@
</span><span class="cx">     if (ec)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    CachedImage* cachedImage = image-&gt;cachedImage();
</del><ins>+    CachedImage* cachedImage = imageElement-&gt;cachedImage();
</ins><span class="cx">     // If the image loading hasn't started or the image is not complete, it is not fully decodable.
</span><del>-    if (!cachedImage || !image-&gt;complete())
</del><ins>+    if (!cachedImage || !imageElement-&gt;complete())
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     if (cachedImage-&gt;status() == CachedResource::LoadError) {
</span><span class="lines">@@ -1811,11 +1815,11 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!image-&gt;cachedImage()-&gt;imageForRenderer(image-&gt;renderer()))
</del><ins>+    if (!imageElement-&gt;cachedImage()-&gt;imageForRenderer(imageElement-&gt;renderer()))
</ins><span class="cx">         return CanvasPattern::create(Image::nullImage(), repeatX, repeatY, true);
</span><span class="cx"> 
</span><span class="cx">     bool originClean = cachedImage-&gt;isOriginClean(canvas()-&gt;securityOrigin());
</span><del>-    return CanvasPattern::create(cachedImage-&gt;imageForRenderer(image-&gt;renderer()), repeatX, repeatY, originClean);
</del><ins>+    return CanvasPattern::create(cachedImage-&gt;imageForRenderer(imageElement-&gt;renderer()), repeatX, repeatY, originClean);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;CanvasPattern&gt; CanvasRenderingContext2D::createPattern(HTMLCanvasElement* canvas,
</span></span></pre>
</div>
</div>

</body>
</html>