Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UnifedPDF] Clean up annotation repaint code #28423

Conversation

smfr
Copy link
Contributor

@smfr smfr commented May 11, 2024

b64c3ed

[UnifedPDF] Clean up annotation repaint code
https://bugs.webkit.org/show_bug.cgi?id=274030
rdar://127915821

Reviewed by Tim Horton.

Future changes will require that we target repaints at pages, not just at the entire
document.

To support this, tighten up annotation repaint code to target a page (until the final
conversion to document coordinates). Implement a `pageIndexForAnnotation()` helper,
and add `setNeedsRepaintForAnnotation()`.

Implementing `revealAnnotation()` eliminates the final call site of `documentRectForAnnotation()`,
which can be removed.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::setNeedsRepaintForAnnotation):
(WebKit::UnifiedPDFPlugin::paintHoveredAnnotationOnPage):
(WebKit::UnifiedPDFPlugin::pageIndexForAnnotation const):
(WebKit::UnifiedPDFPlugin::pageIndexWithHoveredAnnotation const):
(WebKit::UnifiedPDFPlugin::repaintAnnotationsForFormField):
(WebKit::UnifiedPDFPlugin::startTrackingAnnotation):
(WebKit::UnifiedPDFPlugin::updateTrackedAnnotation):
(WebKit::UnifiedPDFPlugin::finishTrackingAnnotation):
(WebKit::UnifiedPDFPlugin::setActiveAnnotation):
(WebKit::UnifiedPDFPlugin::revealAnnotation):
(WebKit::UnifiedPDFPlugin::annotationRectsForTesting const):
(WebKit::UnifiedPDFPlugin::documentRectForAnnotation const): Deleted.

Canonical link: https://commits.webkit.org/278658@main

f570237

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ api-wpe
βœ… πŸ§ͺ ios-wk2-wpt ⏳ πŸ›  wpe-skia
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ›  gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2-stress βœ… πŸ§ͺ api-gtk
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@smfr smfr requested a review from cdumez as a code owner May 11, 2024 04:24
@smfr smfr self-assigned this May 11, 2024
@smfr smfr added the PDF For bugs in WebKit's built-in PDF support. label May 11, 2024
@smfr smfr added the merge-queue Applied to send a pull request to merge-queue label May 11, 2024
https://bugs.webkit.org/show_bug.cgi?id=274030
rdar://127915821

Reviewed by Tim Horton.

Future changes will require that we target repaints at pages, not just at the entire
document.

To support this, tighten up annotation repaint code to target a page (until the final
conversion to document coordinates). Implement a `pageIndexForAnnotation()` helper,
and add `setNeedsRepaintForAnnotation()`.

Implementing `revealAnnotation()` eliminates the final call site of `documentRectForAnnotation()`,
which can be removed.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::setNeedsRepaintForAnnotation):
(WebKit::UnifiedPDFPlugin::paintHoveredAnnotationOnPage):
(WebKit::UnifiedPDFPlugin::pageIndexForAnnotation const):
(WebKit::UnifiedPDFPlugin::pageIndexWithHoveredAnnotation const):
(WebKit::UnifiedPDFPlugin::repaintAnnotationsForFormField):
(WebKit::UnifiedPDFPlugin::startTrackingAnnotation):
(WebKit::UnifiedPDFPlugin::updateTrackedAnnotation):
(WebKit::UnifiedPDFPlugin::finishTrackingAnnotation):
(WebKit::UnifiedPDFPlugin::setActiveAnnotation):
(WebKit::UnifiedPDFPlugin::revealAnnotation):
(WebKit::UnifiedPDFPlugin::annotationRectsForTesting const):
(WebKit::UnifiedPDFPlugin::documentRectForAnnotation const): Deleted.

Canonical link: https://commits.webkit.org/278658@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/UnifedPDF-Clean-up-annotation-repaint-code branch from f570237 to b64c3ed Compare May 11, 2024 19:32
@webkit-commit-queue
Copy link
Collaborator

Committed 278658@main (b64c3ed): https://commits.webkit.org/278658@main

Reviewed commits have been landed. Closing PR #28423 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit b64c3ed into WebKit:main May 11, 2024
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PDF For bugs in WebKit's built-in PDF support.
Projects
None yet
4 participants