<!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>[180685] 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/180685">180685</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-02-26 10:37:14 -0800 (Thu, 26 Feb 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Cleanup RenderSVGResourceClipper class.
https://bugs.webkit.org/show_bug.cgi?id=142032.

Patch by Said Abou-Hallawa &lt;sabouhallawa@apple.com&gt; on 2015-02-26
Reviewed by Darin Adler.
Source/WebCore:

This is a follow up for <a href="http://trac.webkit.org/projects/webkit/changeset/180643">r180643</a>: &lt;http://trac.webkit.org/changeset/180643&gt;.
It includes cleanup for RenderSVGResourceClipper class.

* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::applyClippingToContext):
(WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
* rendering/svg/RenderSVGResourceClipper.h: Change ClipperData to be a
typedef instead of a class and rename it to ClipperMaskImage. The purpose
of having it a class even though it includes only one member was because
we wanted it to be WTF_MAKE_FAST_ALLOCATED. We do not need to allocate it
as a separate object on the heap anymore.

(WebCore::RenderSVGResourceClipper::addRendererToClipper): Instead of doing
double hash table lookups by calling HashMap::contains() and then HashMap::get(),
we can use HashMap::add() instead.

LayoutTests:

* svg/clip-path/clip-path-line-use-before-defined-expected.svg:
* svg/clip-path/clip-path-line-use-before-defined.svg: Simplify the test
and make separate drawings for different cases.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestssvgclippathclippathlineusebeforedefinedexpectedsvg">trunk/LayoutTests/svg/clip-path/clip-path-line-use-before-defined-expected.svg</a></li>
<li><a href="#trunkLayoutTestssvgclippathclippathlineusebeforedefinedsvg">trunk/LayoutTests/svg/clip-path/clip-path-line-use-before-defined.svg</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGResourceClippercpp">trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGResourceClipperh">trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (180684 => 180685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-02-26 18:36:43 UTC (rev 180684)
+++ trunk/LayoutTests/ChangeLog        2015-02-26 18:37:14 UTC (rev 180685)
</span><span class="lines">@@ -1,5 +1,16 @@
</span><span class="cx"> 2015-02-26  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Cleanup RenderSVGResourceClipper class.
+        https://bugs.webkit.org/show_bug.cgi?id=142032.
+
+        Reviewed by Darin Adler.
+
+        * svg/clip-path/clip-path-line-use-before-defined-expected.svg:
+        * svg/clip-path/clip-path-line-use-before-defined.svg: Simplify the test
+        and make separate drawings for different cases.
+
+2015-02-26  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
+
</ins><span class="cx">         Setting any of the &lt;object&gt; element plugin controlling attributes does not have any affect.
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=141936.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestssvgclippathclippathlineusebeforedefinedexpectedsvg"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/clip-path/clip-path-line-use-before-defined-expected.svg (180684 => 180685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/clip-path/clip-path-line-use-before-defined-expected.svg        2015-02-26 18:36:43 UTC (rev 180684)
+++ trunk/LayoutTests/svg/clip-path/clip-path-line-use-before-defined-expected.svg        2015-02-26 18:37:14 UTC (rev 180685)
</span><span class="lines">@@ -1,33 +1,44 @@
</span><del>-&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; width=&quot;200&quot; height=&quot;200&quot;&gt;
</del><ins>+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
</ins><span class="cx">   &lt;defs&gt;
</span><span class="cx">     &lt;style&gt;
</span><span class="cx">       line, path {
</span><span class="cx">         stroke: black;
</span><ins>+        stroke-width: 3;
</ins><span class="cx">       }
</span><span class="cx">     &lt;/style&gt;
</span><span class="cx">     &lt;clipPath id=&quot;clip-circle&quot;&gt;
</span><del>-        &lt;circle cx=&quot;50%&quot; cy=&quot;50%&quot; r=&quot;25%&quot;/&gt;
</del><ins>+      &lt;circle cx=&quot;75&quot; cy=&quot;75&quot; r=&quot;50&quot;/&gt;
</ins><span class="cx">     &lt;/clipPath&gt;
</span><ins>+    &lt;g id=&quot;circle-in-rect&quot;&gt;
+      &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;150&quot; height=&quot;150&quot; fill=&quot;lime&quot;/&gt;
+      &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;150&quot; height=&quot;150&quot; fill=&quot;white&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
+    &lt;/g&gt;
</ins><span class="cx">   &lt;/defs&gt;
</span><del>-  
-  &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;lime&quot;/&gt;
-  &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;white&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
</del><span class="cx"> 
</span><del>-  &lt;!-- diagonal --&gt;
-  &lt;line x1=&quot;170&quot; y1=&quot;30&quot; x2=&quot;30&quot; y2=&quot;170&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
</del><ins>+  &lt;use xlink:href=&quot;#circle-in-rect&quot; transform=&quot;translate(10, 10)&quot;&gt;
+    &lt;g clip-path=&quot;url(#clip-circle)&quot;&gt;
+      &lt;!-- center lines --&gt;
+      &lt;path d=&quot;M0 75 L150 75&quot;/&gt;
+      &lt;line x1=&quot;75&quot; y1=&quot;0&quot; x2=&quot;75&quot; y2=&quot;150&quot;/&gt;
+    &lt;/g&gt;
+  &lt;/use&gt;
</ins><span class="cx">   
</span><del>-  &lt;!-- top and left lines --&gt;
-  &lt;path d=&quot;M30 75 L170 75&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
-  &lt;line x1=&quot;75&quot; y1=&quot;30&quot; x2=&quot;75&quot; y2=&quot;170&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
</del><ins>+  &lt;use xlink:href=&quot;#circle-in-rect&quot; transform=&quot;translate(170, 10)&quot;&gt;
+    &lt;g clip-path=&quot;url(#clip-circle)&quot;&gt;
+      &lt;!-- diagonal lines --&gt;
+      &lt;path d=&quot;M0 0 L150 150&quot;/&gt;
+      &lt;line x1=&quot;0&quot; y1=&quot;150&quot; x2=&quot;150&quot; y2=&quot;0&quot;/&gt;
+    &lt;/g&gt;
+  &lt;/use&gt;
</ins><span class="cx"> 
</span><del>-  &lt;!-- right and bottom lines --&gt;
-  &lt;g clip-path=&quot;url(#clip-circle)&quot;&gt;
-    &lt;path d=&quot;M30 125 L170 125&quot;/&gt;
-    &lt;line x1=&quot;125&quot; y1=&quot;30&quot; x2=&quot;125&quot; y2=&quot;170&quot;/&gt;
-  &lt;/g&gt;
-  
-  &lt;!-- center lines --&gt;
-  &lt;path d=&quot;M30 100 L170 100&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
-  &lt;line x1=&quot;100&quot; y1=&quot;30&quot; x2=&quot;100&quot; y2=&quot;170&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
-  
</del><ins>+  &lt;use xlink:href=&quot;#circle-in-rect&quot; transform=&quot;translate(330, 10)&quot;&gt;
+    &lt;g clip-path=&quot;url(#clip-circle)&quot;&gt;
+      &lt;!-- top and left lines --&gt;
+      &lt;path d=&quot;M0 50 L150 50&quot;/&gt;
+      &lt;line x1=&quot;50&quot; y1=&quot;0&quot; x2=&quot;50&quot; y2=&quot;150&quot;/&gt;
+      &lt;!-- bottom and right lines --&gt;
+      &lt;path d=&quot;M0 100 L150 100&quot;/&gt;
+      &lt;line x1=&quot;100&quot; y1=&quot;0&quot; x2=&quot;100&quot; y2=&quot;150&quot;/&gt;
+    &lt;/g&gt;
+  &lt;/use&gt;
</ins><span class="cx"> &lt;/svg&gt;
</span></span></pre></div>
<a id="trunkLayoutTestssvgclippathclippathlineusebeforedefinedsvg"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/clip-path/clip-path-line-use-before-defined.svg (180684 => 180685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/clip-path/clip-path-line-use-before-defined.svg        2015-02-26 18:36:43 UTC (rev 180684)
+++ trunk/LayoutTests/svg/clip-path/clip-path-line-use-before-defined.svg        2015-02-26 18:37:14 UTC (rev 180685)
</span><span class="lines">@@ -1,38 +1,46 @@
</span><del>-&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; width=&quot;200&quot; height=&quot;200&quot;&gt;
</del><ins>+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
</ins><span class="cx">   &lt;defs&gt;
</span><span class="cx">     &lt;style&gt;
</span><span class="cx">       line, path {
</span><span class="cx">         stroke: black;
</span><ins>+        stroke-width: 3;
</ins><span class="cx">       }
</span><span class="cx">     &lt;/style&gt;
</span><ins>+    &lt;g id=&quot;circle-in-rect&quot;&gt;
+      &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;150&quot; height=&quot;150&quot; fill=&quot;lime&quot;/&gt;
+      &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;150&quot; height=&quot;150&quot; fill=&quot;white&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
+    &lt;/g&gt;
</ins><span class="cx">   &lt;/defs&gt;
</span><del>-  
-  &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;lime&quot;/&gt;
-  &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;100%&quot; height=&quot;100%&quot; fill=&quot;white&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
</del><span class="cx"> 
</span><del>-  &lt;!-- diagonal --&gt;
-  &lt;line x1=&quot;170&quot; y1=&quot;30&quot; x2=&quot;30&quot; y2=&quot;170&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
</del><ins>+  &lt;use xlink:href=&quot;#circle-in-rect&quot; transform=&quot;translate(10, 10)&quot;&gt;
+    &lt;!-- center lines --&gt;
+    &lt;path d=&quot;M0 75 L150 75&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
+    &lt;line x1=&quot;75&quot; y1=&quot;0&quot; x2=&quot;75&quot; y2=&quot;150&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
+  &lt;/use&gt;
</ins><span class="cx">   
</span><del>-  &lt;!-- top and left lines --&gt;
-  &lt;path d=&quot;M30 75 L170 75&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
-  &lt;line x1=&quot;75&quot; y1=&quot;30&quot; x2=&quot;75&quot; y2=&quot;170&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
</del><ins>+  &lt;use xlink:href=&quot;#circle-in-rect&quot; transform=&quot;translate(170, 10)&quot;&gt;
+    &lt;!-- diagonal lines --&gt;
+    &lt;path d=&quot;M0 0 L150 150&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
+    &lt;line x1=&quot;0&quot; y1=&quot;150&quot; x2=&quot;150&quot; y2=&quot;0&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
+  &lt;/use&gt;
</ins><span class="cx"> 
</span><del>-  &lt;!-- bottom and right lines --&gt;
-  &lt;g clip-path=&quot;url(#clip-circle)&quot;&gt;
-    &lt;path d=&quot;M30 125 L170 125&quot;/&gt;
-    &lt;line x1=&quot;125&quot; y1=&quot;30&quot; x2=&quot;125&quot; y2=&quot;170&quot;/&gt;
-  &lt;/g&gt;
</del><ins>+  &lt;use xlink:href=&quot;#circle-in-rect&quot; transform=&quot;translate(330, 10)&quot;&gt;
+    &lt;!-- top and left lines --&gt;
+    &lt;path d=&quot;M0 50 L150 50&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
+    &lt;line x1=&quot;50&quot; y1=&quot;0&quot; x2=&quot;50&quot; y2=&quot;150&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
+    &lt;g clip-path=&quot;url(#clip-circle)&quot;&gt;
+      &lt;!-- bottom and right lines --&gt;
+      &lt;path d=&quot;M0 100 L150 100&quot;/&gt;
+      &lt;line x1=&quot;100&quot; y1=&quot;0&quot; x2=&quot;100&quot; y2=&quot;150&quot;/&gt;
+    &lt;/g&gt;
+  &lt;/use&gt;
</ins><span class="cx">   
</span><span class="cx">   &lt;defs&gt;
</span><span class="cx">     &lt;clipPath id=&quot;clip-circle&quot;&gt;
</span><del>-      &lt;circle cx=&quot;50%&quot; cy=&quot;50%&quot; r=&quot;50%&quot; clip-path=&quot;url(#clip-small-circle)&quot;/&gt;
</del><ins>+      &lt;circle cx=&quot;75&quot; cy=&quot;75&quot; r=&quot;75&quot; clip-path=&quot;url(#clip-small-circle)&quot;/&gt;
</ins><span class="cx">     &lt;/clipPath&gt;
</span><span class="cx">     &lt;clipPath id=&quot;clip-small-circle&quot;&gt;
</span><del>-      &lt;circle cx=&quot;50%&quot; cy=&quot;50%&quot; r=&quot;25%&quot;/&gt;
</del><ins>+      &lt;circle cx=&quot;75&quot; cy=&quot;75&quot; r=&quot;50&quot;/&gt;
</ins><span class="cx">     &lt;/clipPath&gt;
</span><span class="cx">   &lt;/defs&gt;
</span><del>-
-  &lt;!-- center lines --&gt;
-  &lt;path d=&quot;M30 100 L170 100&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
-  &lt;line x1=&quot;100&quot; y1=&quot;30&quot; x2=&quot;100&quot; y2=&quot;170&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
</del><span class="cx"> &lt;/svg&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (180684 => 180685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-02-26 18:36:43 UTC (rev 180684)
+++ trunk/Source/WebCore/ChangeLog        2015-02-26 18:37:14 UTC (rev 180685)
</span><span class="lines">@@ -1,5 +1,28 @@
</span><span class="cx"> 2015-02-26  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Cleanup RenderSVGResourceClipper class.
+        https://bugs.webkit.org/show_bug.cgi?id=142032.
+
+        Reviewed by Darin Adler.
+        
+        This is a follow up for r180643: &lt;http://trac.webkit.org/changeset/180643&gt;.
+        It includes cleanup for RenderSVGResourceClipper class.
+
+        * rendering/svg/RenderSVGResourceClipper.cpp:
+        (WebCore::RenderSVGResourceClipper::applyClippingToContext):
+        (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
+        * rendering/svg/RenderSVGResourceClipper.h: Change ClipperData to be a
+        typedef instead of a class and rename it to ClipperMaskImage. The purpose
+        of having it a class even though it includes only one member was because
+        we wanted it to be WTF_MAKE_FAST_ALLOCATED. We do not need to allocate it
+        as a separate object on the heap anymore.
+        
+        (WebCore::RenderSVGResourceClipper::addRendererToClipper): Instead of doing
+        double hash table lookups by calling HashMap::contains() and then HashMap::get(),
+        we can use HashMap::add() instead.
+
+2015-02-26  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
+
</ins><span class="cx">         Setting any of the &lt;object&gt; element plugin controlling attributes does not have any affect.
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=141936.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGResourceClippercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp (180684 => 180685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp        2015-02-26 18:36:43 UTC (rev 180684)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp        2015-02-26 18:37:14 UTC (rev 180685)
</span><span class="lines">@@ -130,23 +130,22 @@
</span><span class="cx"> bool RenderSVGResourceClipper::applyClippingToContext(RenderElement&amp; renderer, const FloatRect&amp; objectBoundingBox,
</span><span class="cx">                                                       const FloatRect&amp; repaintRect, GraphicsContext* context)
</span><span class="cx"> {
</span><del>-    ClipperData* clipperData = addRendererToClipper(renderer);
-    ASSERT(clipperData);
-    bool shouldCreateClipData = !clipperData-&gt;clipMaskImage;
</del><ins>+    ClipperMaskImage&amp; clipperMaskImage = addRendererToClipper(renderer);
+    bool shouldCreateClipperMaskImage = !clipperMaskImage;
</ins><span class="cx"> 
</span><span class="cx">     AffineTransform animatedLocalTransform = clipPathElement().animatedLocalTransform();
</span><span class="cx"> 
</span><del>-    if (shouldCreateClipData &amp;&amp; pathOnlyClipping(context, animatedLocalTransform, objectBoundingBox))
</del><ins>+    if (shouldCreateClipperMaskImage &amp;&amp; pathOnlyClipping(context, animatedLocalTransform, objectBoundingBox))
</ins><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     AffineTransform absoluteTransform;
</span><span class="cx">     SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem(renderer, absoluteTransform);
</span><span class="cx"> 
</span><del>-    if (shouldCreateClipData &amp;&amp; !repaintRect.isEmpty()) {
-        if (!SVGRenderingContext::createImageBuffer(repaintRect, absoluteTransform, clipperData-&gt;clipMaskImage, ColorSpaceDeviceRGB, Unaccelerated))
</del><ins>+    if (shouldCreateClipperMaskImage &amp;&amp; !repaintRect.isEmpty()) {
+        if (!SVGRenderingContext::createImageBuffer(repaintRect, absoluteTransform, clipperMaskImage, ColorSpaceDeviceRGB, Unaccelerated))
</ins><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-        GraphicsContext* maskContext = clipperData-&gt;clipMaskImage-&gt;context();
</del><ins>+        GraphicsContext* maskContext = clipperMaskImage-&gt;context();
</ins><span class="cx">         ASSERT(maskContext);
</span><span class="cx"> 
</span><span class="cx">         maskContext-&gt;concatCTM(animatedLocalTransform);
</span><span class="lines">@@ -161,28 +160,27 @@
</span><span class="cx">             if (!clipper-&gt;applyClippingToContext(*this, objectBoundingBox, repaintRect, maskContext))
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-            succeeded = drawContentIntoMaskImage(clipperData, objectBoundingBox);
</del><ins>+            succeeded = drawContentIntoMaskImage(clipperMaskImage, objectBoundingBox);
</ins><span class="cx">             // The context restore applies the clipping on non-CG platforms.
</span><span class="cx">         } else
</span><del>-            succeeded = drawContentIntoMaskImage(clipperData, objectBoundingBox);
</del><ins>+            succeeded = drawContentIntoMaskImage(clipperMaskImage, objectBoundingBox);
</ins><span class="cx"> 
</span><span class="cx">         if (!succeeded)
</span><del>-            clipperData-&gt;clipMaskImage.reset();
</del><ins>+            clipperMaskImage.reset();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!clipperData-&gt;clipMaskImage)
</del><ins>+    if (!clipperMaskImage)
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    SVGRenderingContext::clipToImageBuffer(context, absoluteTransform, repaintRect, clipperData-&gt;clipMaskImage, shouldCreateClipData);
</del><ins>+    SVGRenderingContext::clipToImageBuffer(context, absoluteTransform, repaintRect, clipperMaskImage, shouldCreateClipperMaskImage);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderSVGResourceClipper::drawContentIntoMaskImage(ClipperData* clipperData, const FloatRect&amp; objectBoundingBox)
</del><ins>+bool RenderSVGResourceClipper::drawContentIntoMaskImage(const ClipperMaskImage&amp; clipperMaskImage, const FloatRect&amp; objectBoundingBox)
</ins><span class="cx"> {
</span><del>-    ASSERT(clipperData);
-    ASSERT(clipperData-&gt;clipMaskImage);
</del><ins>+    ASSERT(clipperMaskImage);
</ins><span class="cx"> 
</span><del>-    GraphicsContext* maskContext = clipperData-&gt;clipMaskImage-&gt;context();
</del><ins>+    GraphicsContext* maskContext = clipperMaskImage-&gt;context();
</ins><span class="cx">     ASSERT(maskContext);
</span><span class="cx"> 
</span><span class="cx">     AffineTransform maskContentTransformation;
</span><span class="lines">@@ -233,7 +231,7 @@
</span><span class="cx">         // In the case of a &lt;use&gt; element, we obtained its renderere above, to retrieve its clipRule.
</span><span class="cx">         // We have to pass the &lt;use&gt; renderer itself to renderSubtreeToImageBuffer() to apply it's x/y/transform/etc. values when rendering.
</span><span class="cx">         // So if isUseElement is true, refetch the childNode-&gt;renderer(), as renderer got overriden above.
</span><del>-        SVGRenderingContext::renderSubtreeToImageBuffer(clipperData-&gt;clipMaskImage.get(), isUseElement ? *child.renderer() : *renderer, maskContentTransformation);
</del><ins>+        SVGRenderingContext::renderSubtreeToImageBuffer(clipperMaskImage.get(), isUseElement ? *child.renderer() : *renderer, maskContentTransformation);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     view().frameView().setPaintBehavior(oldBehavior);
</span><span class="lines">@@ -257,11 +255,9 @@
</span><span class="cx">     m_clipBoundaries = clipPathElement().animatedLocalTransform().mapRect(m_clipBoundaries);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ClipperData* RenderSVGResourceClipper::addRendererToClipper(const RenderObject&amp; object)
</del><ins>+ClipperMaskImage&amp; RenderSVGResourceClipper::addRendererToClipper(const RenderObject&amp; object)
</ins><span class="cx"> {
</span><del>-    if (!m_clipper.contains(&amp;object))
-        m_clipper.set(&amp;object, std::make_unique&lt;ClipperData&gt;());
-    return m_clipper.get(&amp;object);
</del><ins>+    return m_clipper.add(&amp;object, ClipperMaskImage()).iterator-&gt;value;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RenderSVGResourceClipper::hitTestClipContent(const FloatRect&amp; objectBoundingBox, const FloatPoint&amp; nodeAtPoint)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGResourceClipperh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h (180684 => 180685)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h        2015-02-26 18:36:43 UTC (rev 180684)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h        2015-02-26 18:37:14 UTC (rev 180685)
</span><span class="lines">@@ -31,11 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-struct ClipperData {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    std::unique_ptr&lt;ImageBuffer&gt; clipMaskImage;
-};
</del><ins>+typedef std::unique_ptr&lt;ImageBuffer&gt; ClipperMaskImage;
</ins><span class="cx"> 
</span><span class="cx"> class RenderSVGResourceClipper final : public RenderSVGResourceContainer {
</span><span class="cx"> public:
</span><span class="lines">@@ -69,12 +65,12 @@
</span><span class="cx">     virtual const char* renderName() const override { return &quot;RenderSVGResourceClipper&quot;; }
</span><span class="cx"> 
</span><span class="cx">     bool pathOnlyClipping(GraphicsContext*, const AffineTransform&amp;, const FloatRect&amp;);
</span><del>-    bool drawContentIntoMaskImage(ClipperData*, const FloatRect&amp; objectBoundingBox);
</del><ins>+    bool drawContentIntoMaskImage(const ClipperMaskImage&amp;, const FloatRect&amp; objectBoundingBox);
</ins><span class="cx">     void calculateClipContentRepaintRect();
</span><del>-    ClipperData* addRendererToClipper(const RenderObject&amp;);
</del><ins>+    ClipperMaskImage&amp; addRendererToClipper(const RenderObject&amp;);
</ins><span class="cx"> 
</span><span class="cx">     FloatRect m_clipBoundaries;
</span><del>-    HashMap&lt;const RenderObject*, std::unique_ptr&lt;ClipperData&gt;&gt; m_clipper;
</del><ins>+    HashMap&lt;const RenderObject*, ClipperMaskImage&gt; m_clipper;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>