<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Use Region instead of IntRect in PageClient and WebPageProxy setViewNeedsDisplay method"
   href="https://bugs.webkit.org/show_bug.cgi?id=155747">bug 155747</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Attachment #274648 Flags</td>
           <td>review?
           </td>
           <td>review+
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Use Region instead of IntRect in PageClient and WebPageProxy setViewNeedsDisplay method"
   href="https://bugs.webkit.org/show_bug.cgi?id=155747#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Use Region instead of IntRect in PageClient and WebPageProxy setViewNeedsDisplay method"
   href="https://bugs.webkit.org/show_bug.cgi?id=155747">bug 155747</a>
              from <span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=274648&amp;action=diff" name="attach_274648" title="Patch">attachment 274648</a> <a href="attachment.cgi?id=274648&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=274648&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=274648&amp;action=review</a>

<span class="quote">&gt; Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp:73
&gt; +    RefPtr&lt;cairo_region_t&gt; damageRegion = adoptRef(cairo_region_create());
&gt; +    auto rects = region.rects();
&gt; +    for (const auto&amp; rect : rects) {
&gt; +        cairo_rectangle_int_t damageRect = rect;
&gt; +        cairo_region_union_rectangle(damageRegion.get(), &amp;damageRect);
&gt; +    }</span >

This is “make a cairo_region_t out of a WebCore::Region” and it should do that as efficiently as possible. I think that belongs as a separate function, not nested inside PageClientImpl::setViewNeedsDisplay.

<span class="quote">&gt; Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp:237
&gt; +        damageRegion.unite(IntRect(IntPoint(), m_webPageProxy.viewSize()));</span >

Should use the constructor here instead of unite.

<span class="quote">&gt; Source/WebKit2/UIProcess/efl/WebView.cpp:416
&gt; +    auto rects = region.rects();
&gt; +    for (const auto&amp; rect : rects)
&gt; +        m_client.viewNeedsDisplay(this, rect);</span >

No reason for the local variable.

    for (auto&amp; rect : region.rects())</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>