<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - REGRESSION(r213618): Large async image decoding should only be requested at the time the BitmapImage is drawn"
   href="https://bugs.webkit.org/show_bug.cgi?id=169473">169473</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>REGRESSION(r213618): Large async image decoding should only be requested at the time the BitmapImage is drawn
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Images
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>sabouhallawa&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In &lt;<a href="http://trac.webkit.org/changeset/213618">http://trac.webkit.org/changeset/213618</a>&gt;, the large async image decoding was requested for all the images in the tileCoverageRect of the tileGrid. This turned out to be inefficient approach because tileCoverageRect represents the rectangle from the page that should be cached in tiles. This rectangle includes dirty and clean rectangles. But when requesting the async image decoding, we enumerate all the images in tileCoverageRect regardless whether they are in dirty rects, i.e. they are going to be drawn. Or they are in clean rects, i.e. they are not going to be drawn.

This causes more CPU to be wasted needlessly. And more importantly a memory regression due to aggressive async decoding for images which are not going to be drawn. These images were drawn on tiles and those tiles were kept clean so their frames were destroyed by the MemoryCache to keep the memory under control. But requesting the async decoding for those images, bring their frames back to memory.

The fix is to request the async image decoding only at the time that a BitmapImage is drawn. This is the time that we are sure, a BitmapImage needs to be drawn. It also fixes the scaling and transformation that we need to apply to sizeForDrawing since all of them have to be applied to the GraphicsContext.</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>