<!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>[166100] trunk</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/166100">166100</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2014-03-21 15:09:05 -0700 (Fri, 21 Mar 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Subpixel rendering: Make <img> positioning subpixel aware.
https://bugs.webkit.org/show_bug.cgi?id=130596
Reviewed by Simon Fraser.
Change <img> positioning from integral to device pixel. It enables us
to paint hairline borders around <img> properly.
This patch changes the behavior of broken image representation from constant 1 CSS px border
to a dynamic 1 device px.
Source/WebCore:
Test: fast/images/hidpi-image-position-on-device-pixels.html
* WebCore.exp.in:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawImage):
* platform/graphics/GraphicsContext.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawRect):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawRect):
* platform/graphics/wince/GraphicsContextWinCE.cpp:
(WebCore::GraphicsContext::drawRect):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::paintIntoRect):
* rendering/RenderImage.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::drawPlatformResizerImage):
LayoutTests:
* fast/images/hidpi-image-position-on-device-pixels-expected.html: Added.
* fast/images/hidpi-image-position-on-device-pixels.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsContextcpp">trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsContexth">trunk/Source/WebCore/platform/graphics/GraphicsContext.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscairoGraphicsContextCairocpp">trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgGraphicsContextCGcpp">trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinceGraphicsContextWinCEcpp">trunk/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderImagecpp">trunk/Source/WebCore/rendering/RenderImage.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderImageh">trunk/Source/WebCore/rendering/RenderImage.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastimageshidpiimagepositionondevicepixelsexpectedhtml">trunk/LayoutTests/fast/images/hidpi-image-position-on-device-pixels-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastimageshidpiimagepositionondevicepixelshtml">trunk/LayoutTests/fast/images/hidpi-image-position-on-device-pixels.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (166099 => 166100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-03-21 21:53:25 UTC (rev 166099)
+++ trunk/LayoutTests/ChangeLog        2014-03-21 22:09:05 UTC (rev 166100)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2014-03-21 Zalan Bujtas <zalan@apple.com>
+
+ Subpixel rendering: Make <img> positioning subpixel aware.
+ https://bugs.webkit.org/show_bug.cgi?id=130596
+
+ Reviewed by Simon Fraser.
+
+ Change <img> positioning from integral to device pixel. It enables us
+ to paint hairline borders around <img> properly.
+ This patch changes the behavior of broken image representation from constant 1 CSS px border
+ to a dynamic 1 device px.
+
+ * fast/images/hidpi-image-position-on-device-pixels-expected.html: Added.
+ * fast/images/hidpi-image-position-on-device-pixels.html: Added.
+
</ins><span class="cx"> 2014-03-21 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> Unreviewed test fix after r166080.
</span></span></pre></div>
<a id="trunkLayoutTestsfastimageshidpiimagepositionondevicepixelsexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/images/hidpi-image-position-on-device-pixels-expected.html (0 => 166100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/images/hidpi-image-position-on-device-pixels-expected.html         (rev 0)
+++ trunk/LayoutTests/fast/images/hidpi-image-position-on-device-pixels-expected.html        2014-03-21 22:09:05 UTC (rev 166100)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we can paint images on device pixel positions.</title>
+<style>
+ div {
+ position: absolute;
+ background: yellow;
+}
+</style>
+</head>
+<body>
+<p id="container"></p>
+<script>
+ var container = document.getElementById("container");
+ adjustment = 0.1;
+ w = 50; h = 50;
+ for (i = 0; i < 10; ++i) {
+ adjustment += 0.1;
+ for (j = 0; j < 10; ++j) {
+ var e = document.createElement("div");
+ e.style.top = ((w + 1) * i + j * adjustment) + "px";
+ e.style.left = ((w + 1) * j + i * adjustment) + "px";
+ e.style.width = w + "px";
+ e.style.height = h + "px";
+ w += 0.1;
+ h += 0.1;
+ container.appendChild(e);
+ }
+ }
+</script></body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastimageshidpiimagepositionondevicepixelshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/images/hidpi-image-position-on-device-pixels.html (0 => 166100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/images/hidpi-image-position-on-device-pixels.html         (rev 0)
+++ trunk/LayoutTests/fast/images/hidpi-image-position-on-device-pixels.html        2014-03-21 22:09:05 UTC (rev 166100)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we can paint images on device pixel positions.</title>
+<style>
+ img {
+ position: absolute;
+}
+</style>
+</head>
+<body>
+<p id="container"></p>
+<script>
+ var container = document.getElementById("container");
+ adjustment = 0.1;
+ w = 50; h = 50;
+ for (i = 0; i < 10; ++i) {
+ adjustment += 0.1;
+ for (j = 0; j < 10; ++j) {
+ var e = document.createElement("img");
+ e.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4%2F58BAAT%2FAf9jgNErAAAAAElFTkSuQmCC"
+ e.style.top = ((w + 1) * i + j * adjustment) + "px";
+ e.style.left = ((w + 1) * j + i * adjustment) + "px";
+ e.style.width = w + "px";
+ e.style.height = h + "px";
+ w += 0.1;
+ h += 0.1;
+ container.appendChild(e);
+ }
+ }
+</script></body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (166099 => 166100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-21 21:53:25 UTC (rev 166099)
+++ trunk/Source/WebCore/ChangeLog        2014-03-21 22:09:05 UTC (rev 166100)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2014-03-21 Zalan Bujtas <zalan@apple.com>
+
+ Subpixel rendering: Make <img> positioning subpixel aware.
+ https://bugs.webkit.org/show_bug.cgi?id=130596
+
+ Reviewed by Simon Fraser.
+
+ Change <img> positioning from integral to device pixel. It enables us
+ to paint hairline borders around <img> properly.
+ This patch changes the behavior of broken image representation from constant 1 CSS px border
+ to a dynamic 1 device px.
+
+ Test: fast/images/hidpi-image-position-on-device-pixels.html
+
+ * WebCore.exp.in:
+ * platform/graphics/GraphicsContext.cpp:
+ (WebCore::GraphicsContext::drawImage):
+ * platform/graphics/GraphicsContext.h:
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::GraphicsContext::drawRect):
+ * platform/graphics/cg/GraphicsContextCG.cpp:
+ (WebCore::GraphicsContext::drawRect):
+ * platform/graphics/wince/GraphicsContextWinCE.cpp:
+ (WebCore::GraphicsContext::drawRect):
+ * rendering/RenderImage.cpp:
+ (WebCore::RenderImage::paintReplaced):
+ (WebCore::RenderImage::paintIntoRect):
+ * rendering/RenderImage.h:
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::drawPlatformResizerImage):
+
</ins><span class="cx"> 2014-03-21 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge VTTScanner Code from Blink
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (166099 => 166100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-03-21 21:53:25 UTC (rev 166099)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-03-21 22:09:05 UTC (rev 166100)
</span><span class="lines">@@ -513,7 +513,7 @@
</span><span class="cx"> __ZN7WebCore15GraphicsContext8fillRectERKNS_9FloatRectE
</span><span class="cx"> __ZN7WebCore15GraphicsContext8fillRectERKNS_9FloatRectERKNS_5ColorENS_10ColorSpaceE
</span><span class="cx"> __ZN7WebCore15GraphicsContext9clearRectERKNS_9FloatRectE
</span><del>-__ZN7WebCore15GraphicsContext9drawImageEPNS_5ImageENS_10ColorSpaceERKNS_8IntPointENS_17CompositeOperatorENS_27ImageOrientationDescriptionE
</del><ins>+__ZN7WebCore15GraphicsContext9drawImageEPNS_5ImageENS_10ColorSpaceERKNS_10FloatPointENS_17CompositeOperatorENS_27ImageOrientationDescriptionE
</ins><span class="cx"> __ZN7WebCore15GraphicsContext9setShadowERKNS_9FloatSizeEfRKNS_5ColorENS_10ColorSpaceE
</span><span class="cx"> __ZN7WebCore15GraphicsContext9translateEff
</span><span class="cx"> __ZN7WebCore15GraphicsContextD1Ev
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp (166099 => 166100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp        2014-03-21 21:53:25 UTC (rev 166099)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp        2014-03-21 22:09:05 UTC (rev 166100)
</span><span class="lines">@@ -555,23 +555,23 @@
</span><span class="cx"> fillRect(font.selectionRectForText(run, point, h, from, to), backgroundColor, colorSpace);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const IntPoint& p, CompositeOperator op, ImageOrientationDescription description)
</del><ins>+void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatPoint& p, CompositeOperator op, ImageOrientationDescription description)
</ins><span class="cx"> {
</span><span class="cx"> if (!image)
</span><span class="cx"> return;
</span><del>- drawImage(image, styleColorSpace, FloatRect(IntRect(p, image->size())), FloatRect(FloatPoint(), FloatSize(image->size())), op, description);
</del><ins>+ drawImage(image, styleColorSpace, FloatRect(p, image->size()), FloatRect(FloatPoint(), image->size()), op, description);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const IntRect& r, CompositeOperator op, ImageOrientationDescription description, bool useLowQualityScale)
</del><ins>+void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatRect& r, CompositeOperator op, ImageOrientationDescription description, bool useLowQualityScale)
</ins><span class="cx"> {
</span><span class="cx"> if (!image)
</span><span class="cx"> return;
</span><del>- drawImage(image, styleColorSpace, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->size())), op, description, useLowQualityScale);
</del><ins>+ drawImage(image, styleColorSpace, r, FloatRect(FloatPoint(), image->size()), op, description, useLowQualityScale);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const IntPoint& dest, const IntRect& srcRect, CompositeOperator op, ImageOrientationDescription description)
</del><ins>+void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatPoint& dest, const IntRect& srcRect, CompositeOperator op, ImageOrientationDescription description)
</ins><span class="cx"> {
</span><del>- drawImage(image, styleColorSpace, FloatRect(IntRect(dest, srcRect.size())), FloatRect(srcRect), op, description);
</del><ins>+ drawImage(image, styleColorSpace, FloatRect(dest, srcRect.size()), FloatRect(srcRect), op, description);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op, ImageOrientationDescription description, bool useLowQualityScale)
</span><span class="lines">@@ -579,13 +579,6 @@
</span><span class="cx"> drawImage(image, styleColorSpace, dest, src, op, BlendModeNormal, description, useLowQualityScale);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatRect& dest)
-{
- if (!image)
- return;
- drawImage(image, styleColorSpace, dest, FloatRect(IntRect(IntPoint(), image->size())));
-}
-
</del><span class="cx"> void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op, BlendMode blendMode, ImageOrientationDescription description, bool useLowQualityScale)
</span><span class="cx"> { if (paintingDisabled() || !image)
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (166099 => 166100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h        2014-03-21 21:53:25 UTC (rev 166099)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h        2014-03-21 22:09:05 UTC (rev 166100)
</span><span class="lines">@@ -271,7 +271,7 @@
</span><span class="cx"> // FIXME: ...except drawRect(), which fills properly but always strokes
</span><span class="cx"> // using a 1-pixel stroke inset from the rect borders (of the correct
</span><span class="cx"> // stroke color).
</span><del>- void drawRect(const FloatRect&);
</del><ins>+ void drawRect(const FloatRect&, float borderThickness = 1);
</ins><span class="cx"> void drawLine(const FloatPoint&, const FloatPoint&);
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -302,10 +302,9 @@
</span><span class="cx">
</span><span class="cx"> void strokeRect(const FloatRect&, float lineWidth);
</span><span class="cx">
</span><del>- void drawImage(Image*, ColorSpace styleColorSpace, const IntPoint&, CompositeOperator = CompositeSourceOver, ImageOrientationDescription = ImageOrientationDescription());
- void drawImage(Image*, ColorSpace styleColorSpace, const IntRect&, CompositeOperator = CompositeSourceOver, ImageOrientationDescription = ImageOrientationDescription(), bool useLowQualityScale = false);
- void drawImage(Image*, ColorSpace styleColorSpace, const IntPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, ImageOrientationDescription = ImageOrientationDescription());
- void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect);
</del><ins>+ void drawImage(Image*, ColorSpace styleColorSpace, const FloatPoint&, CompositeOperator = CompositeSourceOver, ImageOrientationDescription = ImageOrientationDescription());
+ void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect&, CompositeOperator = CompositeSourceOver, ImageOrientationDescription = ImageOrientationDescription(), bool useLowQualityScale = false);
+ void drawImage(Image*, ColorSpace styleColorSpace, const FloatPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, ImageOrientationDescription = ImageOrientationDescription());
</ins><span class="cx"> void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, ImageOrientationDescription = ImageOrientationDescription(), bool useLowQualityScale = false);
</span><span class="cx"> void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator, BlendMode, ImageOrientationDescription = ImageOrientationDescription(), bool useLowQualityScale = false);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscairoGraphicsContextCairocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp (166099 => 166100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp        2014-03-21 21:53:25 UTC (rev 166099)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp        2014-03-21 22:09:05 UTC (rev 166100)
</span><span class="lines">@@ -230,7 +230,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Draws a filled rectangle with a stroked border.
</span><del>-void GraphicsContext::drawRect(const FloatRect& rect)
</del><ins>+void GraphicsContext::drawRect(const FloatRect& rect, float)
</ins><span class="cx"> {
</span><span class="cx"> if (paintingDisabled())
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgGraphicsContextCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (166099 => 166100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp        2014-03-21 21:53:25 UTC (rev 166099)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp        2014-03-21 22:09:05 UTC (rev 166100)
</span><span class="lines">@@ -280,7 +280,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Draws a filled rectangle with a stroked border.
</span><del>-void GraphicsContext::drawRect(const FloatRect& rect)
</del><ins>+void GraphicsContext::drawRect(const FloatRect& rect, float borderThickness)
</ins><span class="cx"> {
</span><span class="cx"> // FIXME: this function does not handle patterns and gradients
</span><span class="cx"> // like drawPath does, it probably should.
</span><span class="lines">@@ -299,10 +299,10 @@
</span><span class="cx"> if (oldFillColor != strokeColor())
</span><span class="cx"> setCGFillColor(context, strokeColor(), strokeColorSpace());
</span><span class="cx"> CGRect rects[4] = {
</span><del>- FloatRect(rect.x(), rect.y(), rect.width(), 1),
- FloatRect(rect.x(), rect.maxY() - 1, rect.width(), 1),
- FloatRect(rect.x(), rect.y() + 1, 1, rect.height() - 2),
- FloatRect(rect.maxX() - 1, rect.y() + 1, 1, rect.height() - 2)
</del><ins>+ FloatRect(rect.x(), rect.y(), rect.width(), borderThickness),
+ FloatRect(rect.x(), rect.maxY() - borderThickness, rect.width(), borderThickness),
+ FloatRect(rect.x(), rect.y() + borderThickness, borderThickness, rect.height() - 2 * borderThickness),
+ FloatRect(rect.maxX() - borderThickness, rect.y() + borderThickness, borderThickness, rect.height() - 2 * borderThickness)
</ins><span class="cx"> };
</span><span class="cx"> CGContextFillRects(context, rects, 4);
</span><span class="cx"> if (oldFillColor != strokeColor())
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinceGraphicsContextWinCEcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp (166099 => 166100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp        2014-03-21 21:53:25 UTC (rev 166099)
+++ trunk/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp        2014-03-21 22:09:05 UTC (rev 166100)
</span><span class="lines">@@ -625,7 +625,7 @@
</span><span class="cx"> m_data->restore();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContext::drawRect(const FloatRect& rect)
</del><ins>+void GraphicsContext::drawRect(const FloatRect& rect, float)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_data->m_opacity || paintingDisabled() || rect.isEmpty())
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderImage.cpp (166099 => 166100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderImage.cpp        2014-03-21 21:53:25 UTC (rev 166099)
+++ trunk/Source/WebCore/rendering/RenderImage.cpp        2014-03-21 22:09:05 UTC (rev 166100)
</span><span class="lines">@@ -390,6 +390,7 @@
</span><span class="cx"> LayoutUnit topPad = paddingTop();
</span><span class="cx">
</span><span class="cx"> GraphicsContext* context = paintInfo.context;
</span><ins>+ float deviceScaleFactor = document().deviceScaleFactor();
</ins><span class="cx">
</span><span class="cx"> Page* page = frame().page();
</span><span class="cx">
</span><span class="lines">@@ -401,13 +402,13 @@
</span><span class="cx"> page->addRelevantUnpaintedObject(this, visualOverflowRect());
</span><span class="cx">
</span><span class="cx"> if (cWidth > 2 && cHeight > 2) {
</span><del>- const int borderWidth = 1;
</del><ins>+ LayoutUnit borderWidth = LayoutUnit(1 / deviceScaleFactor);
</ins><span class="cx">
</span><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, style().colorSpace());
</span><span class="cx"> context->setFillColor(Color::transparent, style().colorSpace());
</span><del>- context->drawRect(pixelSnappedIntRect(LayoutRect(paintOffset.x() + leftBorder + leftPad, paintOffset.y() + topBorder + topPad, cWidth, cHeight)));
</del><ins>+ context->drawRect(pixelSnappedForPainting(LayoutRect(paintOffset.x() + leftBorder + leftPad, paintOffset.y() + topBorder + topPad, cWidth, cHeight), deviceScaleFactor), borderWidth);
</ins><span class="cx">
</span><span class="cx"> bool errorPictureDrawn = false;
</span><span class="cx"> LayoutSize imageOffset;
</span><span class="lines">@@ -437,7 +438,7 @@
</span><span class="cx"> #if ENABLE(CSS_IMAGE_ORIENTATION)
</span><span class="cx"> orientationDescription.setImageOrientationEnum(style().imageOrientation());
</span><span class="cx"> #endif
</span><del>- context->drawImage(image.get(), style().colorSpace(), pixelSnappedIntRect(LayoutRect(paintOffset + imageOffset, imageSize)), CompositeSourceOver, orientationDescription);
</del><ins>+ context->drawImage(image.get(), style().colorSpace(), pixelSnappedForPainting(LayoutRect(paintOffset + imageOffset, imageSize), deviceScaleFactor), CompositeSourceOver, orientationDescription);
</ins><span class="cx"> errorPictureDrawn = true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -478,7 +479,7 @@
</span><span class="cx"> if (clip)
</span><span class="cx"> context->clip(contentRect);
</span><span class="cx">
</span><del>- paintIntoRect(context, paintRect);
</del><ins>+ paintIntoRect(context, pixelSnappedForPainting(paintRect, deviceScaleFactor));
</ins><span class="cx">
</span><span class="cx"> if (cachedImage() && page && paintInfo.phase == PaintPhaseForeground) {
</span><span class="cx"> // For now, count images as unpainted if they are still progressively loading. We may want
</span><span class="lines">@@ -549,25 +550,24 @@
</span><span class="cx"> repaint();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void RenderImage::paintIntoRect(GraphicsContext* context, const LayoutRect& rect)
</del><ins>+void RenderImage::paintIntoRect(GraphicsContext* context, const FloatRect& rect)
</ins><span class="cx"> {
</span><del>- IntRect alignedRect = pixelSnappedIntRect(rect);
- if (!imageResource().hasImage() || imageResource().errorOccurred() || alignedRect.width() <= 0 || alignedRect.height() <= 0)
</del><ins>+ if (!imageResource().hasImage() || imageResource().errorOccurred() || rect.width() <= 0 || rect.height() <= 0)
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- RefPtr<Image> img = imageResource().image(alignedRect.width(), alignedRect.height());
</del><ins>+ RefPtr<Image> img = imageResource().image(rect.width(), rect.height());
</ins><span class="cx"> if (!img || img->isNull())
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> HTMLImageElement* imageElt = (element() && isHTMLImageElement(element())) ? toHTMLImageElement(element()) : 0;
</span><span class="cx"> CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator() : CompositeSourceOver;
</span><span class="cx"> Image* image = imageResource().image().get();
</span><del>- bool useLowQualityScaling = shouldPaintAtLowQuality(context, image, image, alignedRect.size());
</del><ins>+ bool useLowQualityScaling = shouldPaintAtLowQuality(context, image, image, LayoutSize(rect.size()));
</ins><span class="cx"> ImageOrientationDescription orientationDescription(shouldRespectImageOrientation());
</span><span class="cx"> #if ENABLE(CSS_IMAGE_ORIENTATION)
</span><span class="cx"> orientationDescription.setImageOrientationEnum(style().imageOrientation());
</span><span class="cx"> #endif
</span><del>- context->drawImage(imageResource().image(alignedRect.width(), alignedRect.height()).get(), style().colorSpace(), alignedRect, compositeOperator, orientationDescription, useLowQualityScaling);
</del><ins>+ context->drawImage(imageResource().image(rect.width(), rect.height()).get(), style().colorSpace(), rect, compositeOperator, orientationDescription, useLowQualityScaling);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool RenderImage::boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance bleedAvoidance, InlineFlowBox*) const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderImage.h (166099 => 166100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderImage.h        2014-03-21 21:53:25 UTC (rev 166099)
+++ trunk/Source/WebCore/rendering/RenderImage.h        2014-03-21 22:09:05 UTC (rev 166100)
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx">
</span><span class="cx"> virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) override;
</span><span class="cx">
</span><del>- void paintIntoRect(GraphicsContext*, const LayoutRect&);
</del><ins>+ void paintIntoRect(GraphicsContext*, const FloatRect&);
</ins><span class="cx"> virtual void paint(PaintInfo&, const LayoutPoint&) override final;
</span><span class="cx"> virtual void layout() override;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (166099 => 166100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-03-21 21:53:25 UTC (rev 166099)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-03-21 22:09:05 UTC (rev 166100)
</span><span class="lines">@@ -3482,12 +3482,12 @@
</span><span class="cx"> context->save();
</span><span class="cx"> context->translate(resizerCornerRect.x() + cornerResizerSize.width(), resizerCornerRect.y() + resizerCornerRect.height() - cornerResizerSize.height());
</span><span class="cx"> context->scale(FloatSize(-1.0, 1.0));
</span><del>- context->drawImage(resizeCornerImage.get(), renderer().style().colorSpace(), IntRect(IntPoint(), cornerResizerSize));
</del><ins>+ context->drawImage(resizeCornerImage.get(), renderer().style().colorSpace(), FloatRect(FloatPoint(), cornerResizerSize));
</ins><span class="cx"> context->restore();
</span><span class="cx"> return;
</span><span class="cx"> }
</span><del>- LayoutRect imageRect(resizerCornerRect.maxXMaxYCorner() - cornerResizerSize, cornerResizerSize);
- context->drawImage(resizeCornerImage.get(), renderer().style().colorSpace(), pixelSnappedIntRect(imageRect));
</del><ins>+ FloatRect imageRect = pixelSnappedForPainting(LayoutRect(resizerCornerRect.maxXMaxYCorner() - cornerResizerSize, cornerResizerSize), renderer().document().deviceScaleFactor());
+ context->drawImage(resizeCornerImage.get(), renderer().style().colorSpace(), imageRect);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void RenderLayer::paintResizer(GraphicsContext* context, const LayoutPoint& paintOffset, const LayoutRect& damageRect)
</span></span></pre>
</div>
</div>
</body>
</html>