<!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>[213404] 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/213404">213404</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2017-03-03 17:45:39 -0800 (Fri, 03 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Clean up RenderImage and a RenderImageResource function
https://bugs.webkit.org/show_bug.cgi?id=169153

Reviewed by Zalan Bujtas.

Change all calls to imageResource().cachedImage() in RenderImage to use the inline
cachedImage() function.

In RenderImage::paintReplaced(), early return after the broken image block (and no need
to test imageResource().hasImage() again in the second condition). Convert height/width to size,
which also forces us to be explicit about using flooredIntSize() when fetching the image
(perhaps this should be a roundedIntSize, but I didn't want to change behavior).

Change RenderImageResource::image() to take an IntSize, rather than int height and width.

No behavior change.

* rendering/RenderImage.cpp:
(WebCore::RenderImage::styleDidChange):
(WebCore::RenderImage::imageChanged):
(WebCore::RenderImage::notifyFinished):
(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::paintIntoRect):
(WebCore::RenderImage::foregroundIsKnownToBeOpaqueInRect):
(WebCore::RenderImage::embeddedContentBox):
* rendering/RenderImageResource.cpp:
(WebCore::RenderImageResource::image):
* rendering/RenderImageResource.h:
(WebCore::RenderImageResource::image):
* rendering/RenderImageResourceStyleImage.cpp:
(WebCore::RenderImageResourceStyleImage::image):
* rendering/RenderImageResourceStyleImage.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderImagecpp">trunk/Source/WebCore/rendering/RenderImage.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderImageResourcecpp">trunk/Source/WebCore/rendering/RenderImageResource.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderImageResourceh">trunk/Source/WebCore/rendering/RenderImageResource.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderImageResourceStyleImagecpp">trunk/Source/WebCore/rendering/RenderImageResourceStyleImage.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderImageResourceStyleImageh">trunk/Source/WebCore/rendering/RenderImageResourceStyleImage.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (213403 => 213404)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-04 01:45:10 UTC (rev 213403)
+++ trunk/Source/WebCore/ChangeLog        2017-03-04 01:45:39 UTC (rev 213404)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2017-03-03  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        Clean up RenderImage and a RenderImageResource function
+        https://bugs.webkit.org/show_bug.cgi?id=169153
+
+        Reviewed by Zalan Bujtas.
+        
+        Change all calls to imageResource().cachedImage() in RenderImage to use the inline
+        cachedImage() function.
+
+        In RenderImage::paintReplaced(), early return after the broken image block (and no need
+        to test imageResource().hasImage() again in the second condition). Convert height/width to size,
+        which also forces us to be explicit about using flooredIntSize() when fetching the image
+        (perhaps this should be a roundedIntSize, but I didn't want to change behavior).
+
+        Change RenderImageResource::image() to take an IntSize, rather than int height and width.
+
+        No behavior change.
+
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::styleDidChange):
+        (WebCore::RenderImage::imageChanged):
+        (WebCore::RenderImage::notifyFinished):
+        (WebCore::RenderImage::paintReplaced):
+        (WebCore::RenderImage::paintIntoRect):
+        (WebCore::RenderImage::foregroundIsKnownToBeOpaqueInRect):
+        (WebCore::RenderImage::embeddedContentBox):
+        * rendering/RenderImageResource.cpp:
+        (WebCore::RenderImageResource::image):
+        * rendering/RenderImageResource.h:
+        (WebCore::RenderImageResource::image):
+        * rendering/RenderImageResourceStyleImage.cpp:
+        (WebCore::RenderImageResourceStyleImage::image):
+        * rendering/RenderImageResourceStyleImage.h:
+
</ins><span class="cx"> 2017-03-03  Antoine Quint  &lt;graouts@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Modern Media Controls] Improve media documents across macOS, iPhone and iPad
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderImage.cpp (213403 => 213404)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderImage.cpp        2017-03-04 01:45:10 UTC (rev 213403)
+++ trunk/Source/WebCore/rendering/RenderImage.cpp        2017-03-04 01:45:39 UTC (rev 213404)
</span><span class="lines">@@ -210,7 +210,7 @@
</span><span class="cx"> {
</span><span class="cx">     RenderReplaced::styleDidChange(diff, oldStyle);
</span><span class="cx">     if (m_needsToSetSizeForAltText) {
</span><del>-        if (!m_altText.isEmpty() &amp;&amp; setImageSizeForAltText(imageResource().cachedImage()))
</del><ins>+        if (!m_altText.isEmpty() &amp;&amp; setImageSizeForAltText(cachedImage()))
</ins><span class="cx">             repaintOrMarkForLayout(ImageSizeChangeForAltText);
</span><span class="cx">         m_needsToSetSizeForAltText = false;
</span><span class="cx">     }
</span><span class="lines">@@ -257,7 +257,7 @@
</span><span class="cx">             }
</span><span class="cx">             return;
</span><span class="cx">         }
</span><del>-        imageSizeChange = setImageSizeForAltText(imageResource().cachedImage());
</del><ins>+        imageSizeChange = setImageSizeForAltText(cachedImage());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (UNLIKELY(AXObjectCache::accessibilityEnabled())) {
</span><span class="lines">@@ -342,7 +342,7 @@
</span><span class="cx"> 
</span><span class="cx">     invalidateBackgroundObscurationStatus();
</span><span class="cx"> 
</span><del>-    if (&amp;newImage == imageResource().cachedImage()) {
</del><ins>+    if (&amp;newImage == cachedImage()) {
</ins><span class="cx">         // tell any potential compositing layers
</span><span class="cx">         // that the image is done and they can reference it directly.
</span><span class="cx">         contentChanged(ImageChanged);
</span><span class="lines">@@ -351,12 +351,7 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderImage::paintReplaced(PaintInfo&amp; paintInfo, const LayoutPoint&amp; paintOffset)
</span><span class="cx"> {
</span><del>-    LayoutUnit cWidth = contentWidth();
-    LayoutUnit cHeight = contentHeight();
-    LayoutUnit leftBorder = borderLeft();
-    LayoutUnit topBorder = borderTop();
-    LayoutUnit leftPad = paddingLeft();
-    LayoutUnit topPad = paddingTop();
</del><ins>+    LayoutSize contentSize = this-&gt;contentSize();
</ins><span class="cx"> 
</span><span class="cx">     GraphicsContext&amp; context = paintInfo.context();
</span><span class="cx">     float deviceScaleFactor = document().deviceScaleFactor();
</span><span class="lines">@@ -368,35 +363,39 @@
</span><span class="cx">         if (paintInfo.phase == PaintPhaseForeground)
</span><span class="cx">             page().addRelevantUnpaintedObject(this, visualOverflowRect());
</span><span class="cx"> 
</span><del>-        if (cWidth &gt; 2 &amp;&amp; cHeight &gt; 2) {
</del><ins>+        if (contentSize.width() &gt; 2 &amp;&amp; contentSize.height() &gt; 2) {
</ins><span class="cx">             LayoutUnit borderWidth = LayoutUnit(1 / deviceScaleFactor);
</span><span class="cx"> 
</span><ins>+            LayoutUnit leftBorder = borderLeft();
+            LayoutUnit topBorder = borderTop();
+            LayoutUnit leftPad = paddingLeft();
+            LayoutUnit topPad = paddingTop();
+
</ins><span class="cx">             // Draw an outline rect where the image should be.
</span><span class="cx">             context.setStrokeStyle(SolidStroke);
</span><span class="cx">             context.setStrokeColor(Color::lightGray);
</span><span class="cx">             context.setFillColor(Color::transparent);
</span><del>-            context.drawRect(snapRectToDevicePixels(LayoutRect(paintOffset.x() + leftBorder + leftPad, paintOffset.y() + topBorder + topPad, cWidth, cHeight), deviceScaleFactor), borderWidth);
</del><ins>+            context.drawRect(snapRectToDevicePixels(LayoutRect({ paintOffset.x() + leftBorder + leftPad, paintOffset.y() + topBorder + topPad }, contentSize), deviceScaleFactor), borderWidth);
</ins><span class="cx"> 
</span><span class="cx">             bool errorPictureDrawn = false;
</span><span class="cx">             LayoutSize imageOffset;
</span><span class="cx">             // When calculating the usable dimensions, exclude the pixels of
</span><span class="cx">             // the ouline rect so the error image/alt text doesn't draw on it.
</span><del>-            LayoutUnit usableWidth = cWidth - 2 * borderWidth;
-            LayoutUnit usableHeight = cHeight - 2 * borderWidth;
</del><ins>+            LayoutSize usableSize = contentSize - LayoutSize(2 * borderWidth, 2 * borderWidth);
</ins><span class="cx"> 
</span><span class="cx">             RefPtr&lt;Image&gt; image = imageResource().image();
</span><span class="cx"> 
</span><del>-            if (imageResource().errorOccurred() &amp;&amp; !image-&gt;isNull() &amp;&amp; usableWidth &gt;= image-&gt;width() &amp;&amp; usableHeight &gt;= image-&gt;height()) {
</del><ins>+            if (imageResource().errorOccurred() &amp;&amp; !image-&gt;isNull() &amp;&amp; usableSize.width() &gt;= image-&gt;width() &amp;&amp; usableSize.height() &gt;= image-&gt;height()) {
</ins><span class="cx">                 // Call brokenImage() explicitly to ensure we get the broken image icon at the appropriate resolution.
</span><del>-                std::pair&lt;Image*, float&gt; brokenImageAndImageScaleFactor = imageResource().cachedImage()-&gt;brokenImage(document().deviceScaleFactor());
</del><ins>+                std::pair&lt;Image*, float&gt; brokenImageAndImageScaleFactor = cachedImage()-&gt;brokenImage(document().deviceScaleFactor());
</ins><span class="cx">                 image = brokenImageAndImageScaleFactor.first;
</span><span class="cx">                 FloatSize imageSize = image-&gt;size();
</span><span class="cx">                 imageSize.scale(1 / brokenImageAndImageScaleFactor.second);
</span><span class="cx">                 // Center the error image, accounting for border and padding.
</span><del>-                LayoutUnit centerX = (usableWidth - imageSize.width()) / 2;
</del><ins>+                LayoutUnit centerX = (usableSize.width() - imageSize.width()) / 2;
</ins><span class="cx">                 if (centerX &lt; 0)
</span><span class="cx">                     centerX = 0;
</span><del>-                LayoutUnit centerY = (usableHeight - imageSize.height()) / 2;
</del><ins>+                LayoutUnit centerY = (usableSize.height() - imageSize.height()) / 2;
</ins><span class="cx">                 if (centerY &lt; 0)
</span><span class="cx">                     centerY = 0;
</span><span class="cx">                 imageOffset = LayoutSize(leftBorder + leftPad + centerX + borderWidth, topBorder + topPad + centerY + borderWidth);
</span><span class="lines">@@ -423,40 +422,44 @@
</span><span class="cx">                 TextRun textRun = RenderBlock::constructTextRun(text, style());
</span><span class="cx">                 LayoutUnit textWidth = font.width(textRun);
</span><span class="cx">                 if (errorPictureDrawn) {
</span><del>-                    if (usableWidth &gt;= textWidth &amp;&amp; fontMetrics.height() &lt;= imageOffset.height())
</del><ins>+                    if (usableSize.width() &gt;= textWidth &amp;&amp; fontMetrics.height() &lt;= imageOffset.height())
</ins><span class="cx">                         context.drawText(font, textRun, altTextOffset);
</span><del>-                } else if (usableWidth &gt;= textWidth &amp;&amp; usableHeight &gt;= fontMetrics.height())
</del><ins>+                } else if (usableSize.width() &gt;= textWidth &amp;&amp; usableSize.height() &gt;= fontMetrics.height())
</ins><span class="cx">                     context.drawText(font, textRun, altTextOffset);
</span><span class="cx">             }
</span><span class="cx">         }
</span><del>-    } else if (imageResource().hasImage() &amp;&amp; cWidth &gt; 0 &amp;&amp; cHeight &gt; 0) {
-        RefPtr&lt;Image&gt; img = imageResource().image(cWidth, cHeight);
-        if (!img || img-&gt;isNull()) {
-            if (paintInfo.phase == PaintPhaseForeground)
-                page().addRelevantUnpaintedObject(this, visualOverflowRect());
-            return;
-        }
</del><ins>+        return;
+    }
+    
+    if (contentSize.isEmpty())
+        return;
</ins><span class="cx"> 
</span><del>-        LayoutRect contentBoxRect = this-&gt;contentBoxRect();
-        contentBoxRect.moveBy(paintOffset);
-        LayoutRect replacedContentRect = this-&gt;replacedContentRect(intrinsicSize());
-        replacedContentRect.moveBy(paintOffset);
-        bool clip = !contentBoxRect.contains(replacedContentRect);
-        GraphicsContextStateSaver stateSaver(context, clip);
-        if (clip)
-            context.clip(contentBoxRect);
</del><ins>+    RefPtr&lt;Image&gt; img = imageResource().image(flooredIntSize(contentSize));
+    if (!img || img-&gt;isNull()) {
+        if (paintInfo.phase == PaintPhaseForeground)
+            page().addRelevantUnpaintedObject(this, visualOverflowRect());
+        return;
+    }
</ins><span class="cx"> 
</span><del>-        paintIntoRect(context, snapRectToDevicePixels(replacedContentRect, deviceScaleFactor));
-        
-        if (cachedImage() &amp;&amp; paintInfo.phase == PaintPhaseForeground) {
-            // For now, count images as unpainted if they are still progressively loading. We may want 
-            // to refine this in the future to account for the portion of the image that has painted.
-            LayoutRect visibleRect = intersection(replacedContentRect, contentBoxRect);
-            if (cachedImage()-&gt;isLoading())
-                page().addRelevantUnpaintedObject(this, visibleRect);
-            else
-                page().addRelevantRepaintedObject(this, visibleRect);
-        }
</del><ins>+    LayoutRect contentBoxRect = this-&gt;contentBoxRect();
+    contentBoxRect.moveBy(paintOffset);
+    LayoutRect replacedContentRect = this-&gt;replacedContentRect(intrinsicSize());
+    replacedContentRect.moveBy(paintOffset);
+    bool clip = !contentBoxRect.contains(replacedContentRect);
+    GraphicsContextStateSaver stateSaver(context, clip);
+    if (clip)
+        context.clip(contentBoxRect);
+
+    paintIntoRect(context, snapRectToDevicePixels(replacedContentRect, deviceScaleFactor));
+    
+    if (cachedImage() &amp;&amp; paintInfo.phase == PaintPhaseForeground) {
+        // For now, count images as unpainted if they are still progressively loading. We may want 
+        // to refine this in the future to account for the portion of the image that has painted.
+        LayoutRect visibleRect = intersection(replacedContentRect, contentBoxRect);
+        if (cachedImage()-&gt;isLoading())
+            page().addRelevantUnpaintedObject(this, visibleRect);
+        else
+            page().addRelevantRepaintedObject(this, visibleRect);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -536,7 +539,7 @@
</span><span class="cx">     if (!imageResource().hasImage() || imageResource().errorOccurred() || rect.width() &lt;= 0 || rect.height() &lt;= 0)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;Image&gt; img = imageResource().image(rect.width(), rect.height());
</del><ins>+    RefPtr&lt;Image&gt; img = imageResource().image(flooredIntSize(rect.size()));
</ins><span class="cx">     if (!img || img-&gt;isNull())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -569,7 +572,7 @@
</span><span class="cx">     UNUSED_PARAM(maxDepthToTest);
</span><span class="cx">     if (!imageResource().hasImage() || imageResource().errorOccurred())
</span><span class="cx">         return false;
</span><del>-    if (imageResource().cachedImage() &amp;&amp; !imageResource().cachedImage()-&gt;isLoaded())
</del><ins>+    if (cachedImage() &amp;&amp; !cachedImage()-&gt;isLoaded())
</ins><span class="cx">         return false;
</span><span class="cx">     if (!contentBoxRect().contains(localRect))
</span><span class="cx">         return false;
</span><span class="lines">@@ -590,7 +593,7 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     // Check for image with alpha.
</span><del>-    return imageResource().cachedImage() &amp;&amp; imageResource().cachedImage()-&gt;currentFrameKnownToBeOpaque(this);
</del><ins>+    return cachedImage() &amp;&amp; cachedImage()-&gt;currentFrameKnownToBeOpaque(this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RenderImage::computeBackgroundIsKnownToBeObscured(const LayoutPoint&amp; paintOffset)
</span><span class="lines">@@ -741,7 +744,7 @@
</span><span class="cx"> 
</span><span class="cx"> RenderBox* RenderImage::embeddedContentBox() const
</span><span class="cx"> {
</span><del>-    CachedImage* cachedImage = imageResource().cachedImage();
</del><ins>+    CachedImage* cachedImage = this-&gt;cachedImage();
</ins><span class="cx">     if (cachedImage &amp;&amp; is&lt;SVGImage&gt;(cachedImage-&gt;image()))
</span><span class="cx">         return downcast&lt;SVGImage&gt;(*cachedImage-&gt;image()).embeddedContentBox();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderImageResourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderImageResource.cpp (213403 => 213404)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderImageResource.cpp        2017-03-04 01:45:10 UTC (rev 213403)
+++ trunk/Source/WebCore/rendering/RenderImageResource.cpp        2017-03-04 01:45:39 UTC (rev 213404)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx">         m_renderer-&gt;repaint();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;Image&gt; RenderImageResource::image(int, int) const
</del><ins>+RefPtr&lt;Image&gt; RenderImageResource::image(const IntSize&amp;) const
</ins><span class="cx"> {
</span><span class="cx">     return m_cachedImage ? m_cachedImage-&gt;imageForRenderer(m_renderer) : Image::nullImage();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderImageResourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderImageResource.h (213403 => 213404)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderImageResource.h        2017-03-04 01:45:10 UTC (rev 213403)
+++ trunk/Source/WebCore/rendering/RenderImageResource.h        2017-03-04 01:45:39 UTC (rev 213404)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx"> 
</span><span class="cx">     void resetAnimation();
</span><span class="cx"> 
</span><del>-    virtual RefPtr&lt;Image&gt; image(int width = 0, int height = 0) const;
</del><ins>+    virtual RefPtr&lt;Image&gt; image(const IntSize&amp; size = { }) const;
</ins><span class="cx">     virtual bool errorOccurred() const;
</span><span class="cx"> 
</span><span class="cx">     virtual void setContainerSizeForRenderer(const IntSize&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderImageResourceStyleImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderImageResourceStyleImage.cpp (213403 => 213404)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderImageResourceStyleImage.cpp        2017-03-04 01:45:10 UTC (rev 213403)
+++ trunk/Source/WebCore/rendering/RenderImageResourceStyleImage.cpp        2017-03-04 01:45:39 UTC (rev 213404)
</span><span class="lines">@@ -63,12 +63,12 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;Image&gt; RenderImageResourceStyleImage::image(int width, int height) const
</del><ins>+RefPtr&lt;Image&gt; RenderImageResourceStyleImage::image(const IntSize&amp; size) const
</ins><span class="cx"> {
</span><span class="cx">     // Generated content may trigger calls to image() while we're still pending, don't assert but gracefully exit.
</span><span class="cx">     if (m_styleImage-&gt;isPending())
</span><span class="cx">         return nullptr;
</span><del>-    return m_styleImage-&gt;image(m_renderer, IntSize(width, height));
</del><ins>+    return m_styleImage-&gt;image(m_renderer, size);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderImageResourceStyleImage::setContainerSizeForRenderer(const IntSize&amp; size)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderImageResourceStyleImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderImageResourceStyleImage.h (213403 => 213404)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderImageResourceStyleImage.h        2017-03-04 01:45:10 UTC (rev 213403)
+++ trunk/Source/WebCore/rendering/RenderImageResourceStyleImage.h        2017-03-04 01:45:39 UTC (rev 213404)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx">     void shutdown() override;
</span><span class="cx"> 
</span><span class="cx">     bool hasImage() const override { return true; }
</span><del>-    RefPtr&lt;Image&gt; image(int width = 0, int height = 0) const override;
</del><ins>+    RefPtr&lt;Image&gt; image(const IntSize&amp; = { }) const override;
</ins><span class="cx">     bool errorOccurred() const override { return m_styleImage-&gt;errorOccurred(); }
</span><span class="cx"> 
</span><span class="cx">     void setContainerSizeForRenderer(const IntSize&amp;) override;
</span></span></pre>
</div>
</div>

</body>
</html>