Bug 245664
| Summary: | [CG] A large PDFDocumentImage may be displayed pixelated | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Said Abou-Hallawa <sabouhallawa> |
| Component: | Images | Assignee: | Said Abou-Hallawa <sabouhallawa> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | sabouhallawa, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=252194 | ||
| Bug Depends on: | 251641 | ||
| Bug Blocks: | |||
Said Abou-Hallawa
Drawing a sub-rectangle of PDFDocumentImage can be expensive because the whole image has to be displayed. PDFDocumentImage tries to cache a viewport of the last source displayed rectangle. The viewport is a bigger rectangle which includes the source rectangle. The goal of caching the viewport is to reuse it as many times as possible and not to draw the image itself. The calculations and the transformation to create, draw and reuse the viewport is very complex and fragile.
The solution is to clean up this code by introducing a new class called ImageViewport. This class will be responsible of creating a viewport ImageBuffer, drawing the source rectangle of the image to the viewport ImageBuffer and drawing this buffer to the destination GraphicsContext. The calculations can be simplified such that the resolution of the viewport ImageBuffer matches the effective resolution of the destination GraphicsContext.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Said Abou-Hallawa
rdar://97254192
Said Abou-Hallawa
Pull request: https://github.com/WebKit/WebKit/pull/4700
EWS
Committed 259928@main (8382d4d3c6e3): <https://commits.webkit.org/259928@main>
Reviewed commits have been landed. Closing PR #4700 and removing active labels.