<!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>[181058] 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/181058">181058</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2015-03-04 17:43:07 -0800 (Wed, 04 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>&lt;attachment&gt; icons are low-resolution when transformed or under page scale
https://bugs.webkit.org/show_bug.cgi?id=142262
&lt;rdar://problem/20035480&gt;

Reviewed by Dean Jackson.

We should use Icon::createIconForFiles, just like &lt;input type=&quot;file&quot;&gt; does,
instead of directly talking to IconServices. This results both in less code
and in NSImage's multiresolution magic making the icons sharp even under
the influence of transforms and page scale.

* WebCore.xcodeproj/project.pbxproj:
* platform/spi/mac/IconServicesSPI.h: Removed.
* platform/spi/mac/LaunchServicesSPI.h: Removed.
Get rid of IconServicesSPI.h and LaunchServicesSPI.h.

* platform/graphics/Icon.h:
Include RetainPtr just once.
paint() should take a GraphicsContext reference (null is not an option)
and a FloatRect (after all, it just turns around and converts to NSRect).

* platform/graphics/ios/IconIOS.mm:
(WebCore::Icon::paint):
* platform/graphics/mac/IconMac.mm:
(WebCore::Icon::createIconForFiles):
(WebCore::Icon::paint):
* platform/graphics/efl/IconEfl.cpp:
(WebCore::Icon::paint):
* platform/graphics/gtk/IconGtk.cpp:
(WebCore::Icon::paint):
* platform/graphics/win/IconWin.cpp:
(WebCore::Icon::paint):
Adapt to the paint() signature changes, fix some style, etc.

* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
Adapt to the paint() signature changes.

* rendering/RenderThemeMac.mm:
(WebCore::paintAttachmentIcon):
Use Icon::createIconForFiles instead of IconServices.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsIconh">trunk/Source/WebCore/platform/graphics/Icon.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicseflIconEflcpp">trunk/Source/WebCore/platform/graphics/efl/IconEfl.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgtkIconGtkcpp">trunk/Source/WebCore/platform/graphics/gtk/IconGtk.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsiosIconIOSmm">trunk/Source/WebCore/platform/graphics/ios/IconIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacIconMacmm">trunk/Source/WebCore/platform/graphics/mac/IconMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinIconWincpp">trunk/Source/WebCore/platform/graphics/win/IconWin.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderFileUploadControlcpp">trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeIOSmm">trunk/Source/WebCore/rendering/RenderThemeIOS.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeMacmm">trunk/Source/WebCore/rendering/RenderThemeMac.mm</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformspimacIconServicesSPIh">trunk/Source/WebCore/platform/spi/mac/IconServicesSPI.h</a></li>
<li><a href="#trunkSourceWebCoreplatformspimacLaunchServicesSPIh">trunk/Source/WebCore/platform/spi/mac/LaunchServicesSPI.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (181057 => 181058)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-03-05 01:40:45 UTC (rev 181057)
+++ trunk/Source/WebCore/ChangeLog        2015-03-05 01:43:07 UTC (rev 181058)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2015-03-04  Timothy Horton  &lt;timothy_horton@apple.com&gt;
+
+        &lt;attachment&gt; icons are low-resolution when transformed or under page scale
+        https://bugs.webkit.org/show_bug.cgi?id=142262
+        &lt;rdar://problem/20035480&gt;
+
+        Reviewed by Dean Jackson.
+
+        We should use Icon::createIconForFiles, just like &lt;input type=&quot;file&quot;&gt; does,
+        instead of directly talking to IconServices. This results both in less code
+        and in NSImage's multiresolution magic making the icons sharp even under
+        the influence of transforms and page scale.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/spi/mac/IconServicesSPI.h: Removed.
+        * platform/spi/mac/LaunchServicesSPI.h: Removed.
+        Get rid of IconServicesSPI.h and LaunchServicesSPI.h.
+
+        * platform/graphics/Icon.h:
+        Include RetainPtr just once.
+        paint() should take a GraphicsContext reference (null is not an option)
+        and a FloatRect (after all, it just turns around and converts to NSRect).
+
+        * platform/graphics/ios/IconIOS.mm:
+        (WebCore::Icon::paint):
+        * platform/graphics/mac/IconMac.mm:
+        (WebCore::Icon::createIconForFiles):
+        (WebCore::Icon::paint):
+        * platform/graphics/efl/IconEfl.cpp:
+        (WebCore::Icon::paint):
+        * platform/graphics/gtk/IconGtk.cpp:
+        (WebCore::Icon::paint):
+        * platform/graphics/win/IconWin.cpp:
+        (WebCore::Icon::paint):
+        Adapt to the paint() signature changes, fix some style, etc.
+
+        * rendering/RenderFileUploadControl.cpp:
+        (WebCore::RenderFileUploadControl::paintObject):
+        * rendering/RenderThemeIOS.mm:
+        (WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
+        Adapt to the paint() signature changes.
+
+        * rendering/RenderThemeMac.mm:
+        (WebCore::paintAttachmentIcon):
+        Use Icon::createIconForFiles instead of IconServices.
+
</ins><span class="cx"> 2015-03-04  Tim Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;attachment&gt; should not appear selected when the cursor is adjacent to it
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (181057 => 181058)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-03-05 01:40:45 UTC (rev 181057)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-03-05 01:43:07 UTC (rev 181058)
</span><span class="lines">@@ -1125,8 +1125,6 @@
</span><span class="cx">                 2D6E468417D660F500ECF8BB /* PDFDocumentImageMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D6E468217D660F500ECF8BB /* PDFDocumentImageMac.mm */; };
</span><span class="cx">                 2D70BA1318074DDF0001908A /* PlatformCALayerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D70BA1218074DDF0001908A /* PlatformCALayerMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2D70BA1518074F860001908A /* PlatformCALayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D70BA1418074F850001908A /* PlatformCALayer.cpp */; };
</span><del>-                2D74E99C1A9D3F3200DFB3D4 /* IconServicesSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D74E99B1A9D3F3200DFB3D4 /* IconServicesSPI.h */; };
-                2D74E99E1A9D402900DFB3D4 /* LaunchServicesSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D74E99D1A9D402900DFB3D4 /* LaunchServicesSPI.h */; };
</del><span class="cx">                 2D76BB821945632400CFD29A /* RunLoopObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D76BB801945632400CFD29A /* RunLoopObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2D76BB8419456F8100CFD29A /* RunLoopObserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D76BB8319456F8100CFD29A /* RunLoopObserver.cpp */; };
</span><span class="cx">                 2D8287F616E4A0380086BD00 /* HitTestLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D8287F416E4A0380086BD00 /* HitTestLocation.cpp */; };
</span><span class="lines">@@ -8199,8 +8197,6 @@
</span><span class="cx">                 2D6E468217D660F500ECF8BB /* PDFDocumentImageMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PDFDocumentImageMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D70BA1218074DDF0001908A /* PlatformCALayerMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlatformCALayerMac.h; path = ca/mac/PlatformCALayerMac.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D70BA1418074F850001908A /* PlatformCALayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PlatformCALayer.cpp; path = ca/PlatformCALayer.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                2D74E99B1A9D3F3200DFB3D4 /* IconServicesSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IconServicesSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                2D74E99D1A9D402900DFB3D4 /* LaunchServicesSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LaunchServicesSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 2D76BB801945632400CFD29A /* RunLoopObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RunLoopObserver.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D76BB8319456F8100CFD29A /* RunLoopObserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RunLoopObserver.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D8287F416E4A0380086BD00 /* HitTestLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HitTestLocation.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -17720,8 +17716,6 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 2D59F1BE1A0044C6001F3D29 /* DataDetectorsSPI.h */,
</span><del>-                                2D74E99B1A9D3F3200DFB3D4 /* IconServicesSPI.h */,
-                                2D74E99D1A9D402900DFB3D4 /* LaunchServicesSPI.h */,
</del><span class="cx">                                 2D413F601A187A3F0041A521 /* LookupSPI.h */,
</span><span class="cx">                                 1C6466271A12C3F90094603C /* NSFontSPI.h */,
</span><span class="cx">                                 9321D58F1A3906FA008052BE /* NSImmediateActionGestureRecognizerSPI.h */,
</span><span class="lines">@@ -24337,7 +24331,6 @@
</span><span class="cx">                                 2E37DFDB12DBAFB800A6B233 /* DOMURL.h in Headers */,
</span><span class="cx">                                 CD9DE18217AAD6A400EA386D /* DOMURLMediaSource.h in Headers */,
</span><span class="cx">                                 15C770A6100D41CD005BA267 /* DOMValidityState.h in Headers */,
</span><del>-                                2D74E99C1A9D3F3200DFB3D4 /* IconServicesSPI.h in Headers */,
</del><span class="cx">                                 BC1A37C0097C715F0019F3D8 /* DOMViews.h in Headers */,
</span><span class="cx">                                 31C0FF490E4CEFDD007D6FE5 /* DOMWebKitAnimationEvent.h in Headers */,
</span><span class="cx">                                 31C0FF4B0E4CEFDD007D6FE5 /* DOMWebKitAnimationEventInternal.h in Headers */,
</span><span class="lines">@@ -26540,7 +26533,6 @@
</span><span class="cx">                                 B2227A880D00BF220071B782 /* SVGPatternElement.h in Headers */,
</span><span class="cx">                                 B2227A8C0D00BF220071B782 /* SVGPointList.h in Headers */,
</span><span class="cx">                                 B2227A8F0D00BF220071B782 /* SVGPolyElement.h in Headers */,
</span><del>-                                2D74E99E1A9D402900DFB3D4 /* LaunchServicesSPI.h in Headers */,
</del><span class="cx">                                 2D58D8551A15F65F00A5F726 /* DataDetection.h in Headers */,
</span><span class="cx">                                 B2227A910D00BF220071B782 /* SVGPolygonElement.h in Headers */,
</span><span class="cx">                                 B2227A940D00BF220071B782 /* SVGPolylineElement.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsIconh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Icon.h (181057 => 181058)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Icon.h        2015-03-05 01:40:45 UTC (rev 181057)
+++ trunk/Source/WebCore/platform/graphics/Icon.h        2015-03-05 01:43:07 UTC (rev 181058)
</span><span class="lines">@@ -21,17 +21,16 @@
</span><span class="cx"> #ifndef Icon_h
</span><span class="cx"> #define Icon_h
</span><span class="cx"> 
</span><ins>+#include &lt;wtf/Forward.h&gt;
</ins><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><del>-#include &lt;wtf/Forward.h&gt;
</del><ins>+#include &lt;wtf/RetainPtr.h&gt;
</ins><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> #include &quot;NativeImagePtr.h&quot;
</span><span class="cx"> #include &lt;CoreGraphics/CoreGraphics.h&gt;
</span><del>-#include &lt;wtf/RetainPtr.h&gt;
</del><span class="cx"> #elif PLATFORM(MAC)
</span><del>-#include &lt;wtf/RetainPtr.h&gt;
</del><span class="cx"> OBJC_CLASS NSImage;
</span><span class="cx"> #elif PLATFORM(WIN)
</span><span class="cx"> typedef struct HICON__* HICON;
</span><span class="lines">@@ -42,7 +41,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class GraphicsContext;
</span><del>-class IntRect;
</del><ins>+class FloatRect;
</ins><span class="cx">     
</span><span class="cx"> class Icon : public RefCounted&lt;Icon&gt; {
</span><span class="cx"> public:
</span><span class="lines">@@ -50,7 +49,7 @@
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT ~Icon();
</span><span class="cx"> 
</span><del>-    void paint(GraphicsContext*, const IntRect&amp;);
</del><ins>+    void paint(GraphicsContext&amp;, const FloatRect&amp;);
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx">     static PassRefPtr&lt;Icon&gt; create(HICON hIcon) { return adoptRef(new Icon(hIcon)); }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicseflIconEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/efl/IconEfl.cpp (181057 => 181058)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/efl/IconEfl.cpp        2015-03-05 01:40:45 UTC (rev 181057)
+++ trunk/Source/WebCore/platform/graphics/efl/IconEfl.cpp        2015-03-05 01:43:07 UTC (rev 181058)
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Icon::paint(GraphicsContext*, const IntRect&amp;)
</del><ins>+void Icon::paint(GraphicsContext&amp;, const FloatRect&amp;)
</ins><span class="cx"> {
</span><span class="cx">     notImplemented();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgtkIconGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gtk/IconGtk.cpp (181057 => 181058)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gtk/IconGtk.cpp        2015-03-05 01:40:45 UTC (rev 181057)
+++ trunk/Source/WebCore/platform/graphics/gtk/IconGtk.cpp        2015-03-05 01:43:07 UTC (rev 181058)
</span><span class="lines">@@ -113,13 +113,13 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Icon::paint(GraphicsContext* context, const IntRect&amp; rect)
</del><ins>+void Icon::paint(GraphicsContext&amp; context, const FloatRect&amp; rect)
</ins><span class="cx"> {
</span><del>-    if (context-&gt;paintingDisabled())
</del><ins>+    if (context.paintingDisabled())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // TODO: Scale/clip the image if necessary.
</span><del>-    cairo_t* cr = context-&gt;platformContext()-&gt;cr();
</del><ins>+    cairo_t* cr = context.platformContext()-&gt;cr();
</ins><span class="cx">     cairo_save(cr);
</span><span class="cx">     gdk_cairo_set_source_pixbuf(cr, m_icon, rect.x(), rect.y());
</span><span class="cx">     cairo_paint(cr);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsiosIconIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ios/IconIOS.mm (181057 => 181058)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ios/IconIOS.mm        2015-03-05 01:40:45 UTC (rev 181057)
+++ trunk/Source/WebCore/platform/graphics/ios/IconIOS.mm        2015-03-05 01:43:07 UTC (rev 181058)
</span><span class="lines">@@ -55,21 +55,20 @@
</span><span class="cx">     return adoptRef(new Icon(imageRef));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Icon::paint(GraphicsContext* context, const IntRect&amp; destRect)
</del><ins>+void Icon::paint(GraphicsContext&amp; context, const FloatRect&amp; destRect)
</ins><span class="cx"> {
</span><del>-    if (context-&gt;paintingDisabled())
</del><ins>+    if (context.paintingDisabled())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    GraphicsContextStateSaver stateSaver(*context);
</del><ins>+    GraphicsContextStateSaver stateSaver(context);
</ins><span class="cx"> 
</span><span class="cx">     float width = CGImageGetWidth(m_cgImage.get());
</span><span class="cx">     float height = CGImageGetHeight(m_cgImage.get());
</span><span class="cx">     FloatSize size(width, height);
</span><del>-    FloatRect srcRect(0, 0, width, height);
-    ColorSpace colorSpace = ColorSpaceDeviceRGB;
</del><ins>+    FloatRect srcRect(FloatPoint(), size);
</ins><span class="cx"> 
</span><del>-    context-&gt;setImageInterpolationQuality(InterpolationHigh);
-    context-&gt;drawNativeImage(m_cgImage.get(), size, colorSpace, destRect, srcRect);
</del><ins>+    context.setImageInterpolationQuality(InterpolationHigh);
+    context.drawNativeImage(m_cgImage.get(), size, ColorSpaceDeviceRGB, destRect, srcRect);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacIconMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/IconMac.mm (181057 => 181058)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/IconMac.mm        2015-03-05 01:40:45 UTC (rev 181057)
+++ trunk/Source/WebCore/platform/graphics/mac/IconMac.mm        2015-03-05 01:43:07 UTC (rev 181058)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx"> PassRefPtr&lt;Icon&gt; Icon::createIconForFiles(const Vector&lt;String&gt;&amp; filenames)
</span><span class="cx"> {
</span><span class="cx">     if (filenames.isEmpty())
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     bool useIconFromFirstFile;
</span><span class="cx">     useIconFromFirstFile = filenames.size() == 1;
</span><span class="lines">@@ -57,31 +57,29 @@
</span><span class="cx">         // Don't pass relative filenames -- we don't want a result that depends on the current directory.
</span><span class="cx">         // Need 0U here to disambiguate String::operator[] from operator(NSString*, int)[]
</span><span class="cx">         if (filenames[0].isEmpty() || filenames[0][0U] != '/')
</span><del>-            return 0;
</del><ins>+            return nullptr;
</ins><span class="cx"> 
</span><del>-        NSImage* image = [[NSWorkspace sharedWorkspace] iconForFile:filenames[0]];
</del><ins>+        NSImage *image = [[NSWorkspace sharedWorkspace] iconForFile:filenames[0]];
</ins><span class="cx">         if (!image)
</span><del>-            return 0;
</del><ins>+            return nullptr;
</ins><span class="cx"> 
</span><span class="cx">         return adoptRef(new Icon(image));
</span><span class="cx">     }
</span><del>-    NSImage* image = [NSImage imageNamed:NSImageNameMultipleDocuments];
</del><ins>+    NSImage *image = [NSImage imageNamed:NSImageNameMultipleDocuments];
</ins><span class="cx">     if (!image)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     return adoptRef(new Icon(image));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Icon::paint(GraphicsContext* context, const IntRect&amp; rect)
</del><ins>+void Icon::paint(GraphicsContext&amp; context, const FloatRect&amp; rect)
</ins><span class="cx"> {
</span><del>-    if (context-&gt;paintingDisabled())
</del><ins>+    if (context.paintingDisabled())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    LocalCurrentGraphicsContext localCurrentGC(context);
</del><ins>+    LocalCurrentGraphicsContext localCurrentGC(&amp;context);
</ins><span class="cx"> 
</span><del>-    [m_nsImage.get() drawInRect:rect
-        fromRect:NSMakeRect(0, 0, [m_nsImage.get() size].width, [m_nsImage.get() size].height)
-        operation:NSCompositeSourceOver fraction:1.0f];
</del><ins>+    [m_nsImage drawInRect:rect fromRect:NSMakeRect(0, 0, [m_nsImage size].width, [m_nsImage size].height) operation:NSCompositeSourceOver fraction:1.0f];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinIconWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/IconWin.cpp (181057 => 181058)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/IconWin.cpp        2015-03-05 01:40:45 UTC (rev 181057)
+++ trunk/Source/WebCore/platform/graphics/win/IconWin.cpp        2015-03-05 01:43:07 UTC (rev 181058)
</span><span class="lines">@@ -73,12 +73,12 @@
</span><span class="cx">     return adoptRef(new Icon(hIcon));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Icon::paint(GraphicsContext* context, const IntRect&amp; r)
</del><ins>+void Icon::paint(GraphicsContext&amp; context, const FloatRect&amp; r)
</ins><span class="cx"> {
</span><del>-    if (context-&gt;paintingDisabled())
</del><ins>+    if (context.paintingDisabled())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    LocalWindowsContext windowContext(context, r);
</del><ins>+    LocalWindowsContext windowContext(&amp;context, enclosingIntRect(r));
</ins><span class="cx">     DrawIconEx(windowContext.hdc(), r.x(), r.y(), m_hIcon, r.width(), r.height(), 0, 0, DI_NORMAL);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformspimacIconServicesSPIh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/spi/mac/IconServicesSPI.h (181057 => 181058)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/mac/IconServicesSPI.h        2015-03-05 01:40:45 UTC (rev 181057)
+++ trunk/Source/WebCore/platform/spi/mac/IconServicesSPI.h        2015-03-05 01:43:07 UTC (rev 181058)
</span><span class="lines">@@ -1,34 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import &quot;LaunchServicesSPI.h&quot;
-#import &quot;SoftLinking.h&quot;
-#import &lt;objc/runtime.h&gt;
-
-SOFT_LINK_PRIVATE_FRAMEWORK(IconServices)
-
-typedef UInt32 ISScale;
-
-SOFT_LINK(IconServices, _ISCreateCGImageFromBindingWithSizeScaleAndOptions, CGImageRef, (LSBindingRef binding, CGSize size, ISScale scale, CFDictionaryRef options), (binding, size, scale, options))
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformspimacLaunchServicesSPIh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/spi/mac/LaunchServicesSPI.h (181057 => 181058)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/mac/LaunchServicesSPI.h        2015-03-05 01:40:45 UTC (rev 181057)
+++ trunk/Source/WebCore/platform/spi/mac/LaunchServicesSPI.h        2015-03-05 01:43:07 UTC (rev 181058)
</span><span class="lines">@@ -1,37 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#if USE(APPLE_INTERNAL_SDK)
-
-#include &lt;LaunchServices/LaunchServicesPriv.h&gt;
-
-#else
-
-WTF_EXTERN_C_BEGIN
-typedef struct _LSBinding* LSBindingRef;
-LSBindingRef _LSBindingCreateWithURL(CFAllocatorRef, CFURLRef);
-WTF_EXTERN_C_END
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderFileUploadControlcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp (181057 => 181058)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp        2015-03-05 01:40:45 UTC (rev 181057)
+++ trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp        2015-03-05 01:43:07 UTC (rev 181058)
</span><span class="lines">@@ -186,7 +186,7 @@
</span><span class="cx">             }
</span><span class="cx"> #else
</span><span class="cx">             // Draw the file icon
</span><del>-            inputElement().icon()-&gt;paint(paintInfo.context, IntRect(roundToInt(iconX), roundToInt(iconY), iconWidth, iconHeight));
</del><ins>+            inputElement().icon()-&gt;paint(*paintInfo.context, IntRect(roundToInt(iconX), roundToInt(iconY), iconWidth, iconHeight));
</ins><span class="cx"> #endif
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (181057 => 181058)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm        2015-03-05 01:40:45 UTC (rev 181057)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm        2015-03-05 01:43:07 UTC (rev 181058)
</span><span class="lines">@@ -1054,7 +1054,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Foreground picture frame and icon.
</span><span class="cx">     paintInfo.context-&gt;fillRoundedRect(FloatRoundedRect(thumbnailPictureFrameRect, cornerSize, cornerSize, cornerSize, cornerSize), pictureFrameColor, ColorSpaceDeviceRGB);
</span><del>-    icon-&gt;paint(paintInfo.context, thumbnailRect);
</del><ins>+    icon-&gt;paint(*paintInfo.context, thumbnailRect);
</ins><span class="cx"> 
</span><span class="cx">     return false;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (181057 => 181058)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeMac.mm        2015-03-05 01:40:45 UTC (rev 181057)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm        2015-03-05 01:43:07 UTC (rev 181058)
</span><span class="lines">@@ -42,10 +42,9 @@
</span><span class="cx"> #import &quot;HTMLMediaElement.h&quot;
</span><span class="cx"> #import &quot;HTMLNames.h&quot;
</span><span class="cx"> #import &quot;HTMLPlugInImageElement.h&quot;
</span><del>-#import &quot;IconServicesSPI.h&quot;
</del><ins>+#import &quot;Icon.h&quot;
</ins><span class="cx"> #import &quot;Image.h&quot;
</span><span class="cx"> #import &quot;ImageBuffer.h&quot;
</span><del>-#import &quot;LaunchServicesSPI.h&quot;
</del><span class="cx"> #import &quot;LocalCurrentGraphicsContext.h&quot;
</span><span class="cx"> #import &quot;LocalizedStrings.h&quot;
</span><span class="cx"> #import &quot;MediaControlElements.h&quot;
</span><span class="lines">@@ -2322,20 +2321,13 @@
</span><span class="cx"> 
</span><span class="cx"> static void paintAttachmentIcon(const RenderAttachment&amp; attachment, GraphicsContext&amp; context, AttachmentLayout&amp; layout)
</span><span class="cx"> {
</span><del>-    File* file = attachment.attachmentElement().file();
-    RetainPtr&lt;LSBindingRef&gt; lsBinding = adoptCF(_LSBindingCreateWithURL(kCFAllocatorDefault, (CFURLRef)[NSURL fileURLWithPath:file ? file-&gt;path() : String()]));
-    if (!lsBinding)
-        return;
-
-    // FIXME: This should take transforms and page scale into account, not just deviceScaleFactor.
-    FloatSize iconSizeInPoints(attachmentIconSize, attachmentIconSize);
-    iconSizeInPoints.scale(attachment.document().deviceScaleFactor());
-
-    RetainPtr&lt;CGImageRef&gt; icon = adoptCF(_ISCreateCGImageFromBindingWithSizeScaleAndOptions(lsBinding.get(), iconSizeInPoints, 1, nil));
</del><ins>+    Vector&lt;String&gt; filenames;
+    if (File* file = attachment.attachmentElement().file())
+        filenames.append(file-&gt;path());
+    RefPtr&lt;Icon&gt; icon = Icon::createIconForFiles(filenames);
</ins><span class="cx">     if (!icon)
</span><span class="cx">         return;
</span><del>-
-    context.drawNativeImage(icon.get(), iconSizeInPoints, ColorSpaceDeviceRGB, layout.iconRect, FloatRect(FloatPoint(), iconSizeInPoints));
</del><ins>+    icon-&gt;paint(context, layout.iconRect);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void addAttachmentTitleBackgroundRightCorner(Path&amp; path, const FloatRect* fromRect, const FloatRect* toRect)
</span></span></pre>
</div>
</div>

</body>
</html>