[Webkit-unassigned] [Bug 182083] New: REGRESSION(r217236): [iOS] PDFDocumentImage does not update its cached ImageBuffer if it has a sub-rectangle of the image

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 24 19:16:54 PST 2018


https://bugs.webkit.org/show_bug.cgi?id=182083

            Bug ID: 182083
           Summary: REGRESSION(r217236): [iOS] PDFDocumentImage does not
                    update its cached ImageBuffer if it has a
                    sub-rectangle of the image
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Images
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: sabouhallawa at apple.com

The PDFKit currently does not respect the context clipping rectangle. That means to draw a sub-recatnge of the PDF document image, the whole PDF document has to be rendered. This why the PDFDocumentImage draws the PDF document in an ImageBuffer first and then draws this ImageBuffer to the context. The ImageBuffer is cached and reused as long as the scaling factor does not change.


In <http://trac.webkit.org/changeset/203378>, the PDFDocumentImage cached ImageBuffer was bounded to a certain limit (64MB) to avoid a jetsam from the system. The check for keeping the cached ImageBuffer was extended to include the fact that the cached ImageBuffer includes only a sub-rectangle from the PDF document and not all of it. In PDFDocumentImage::cacheParametersMatch(), the condition below was added:

boo PDFDocumentImage::cacheParametersMatch()
{
>>    if (!m_cachedImageRect.contains(context.clipBounds()))
>>        return false;
}

m_cachedImageRect is in context coordinates and we check if the whole clipping rectangle is inside the drawing of the cached ImageBuffer. This condition is valid if the page is a standalone PDF image document. But if the image is inside an HTML page, this condition will be too restricted if the clipping rectangle includes more than the image rectangle even if the whole image drawing is cached in the ImageBuffer.

In <https://trac.webkit.org/changeset/224719>, this condition was removed to fix the issue of throwing the cached ImageBuffer needlessly because of moving the image. But removing this condition causes not updating the cached ImageBuffer when it has a sub-rectangle of the image and the new clipping rectangle is not the same as the one the ImageBuffer was cached for.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180125/e42931ca/attachment.html>


More information about the webkit-unassigned mailing list