Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UnifiedPDF] Data detector page overlay tiles should not be repainted…
… when there is no active highlight https://bugs.webkit.org/show_bug.cgi?id=271074 rdar://124707729 Reviewed by Simon Fraser. Currently, we unconditionally call PageOverlay::setNeedsDisplay() whenever we scroll the PDF plugin. This is incredibly inefficient because we're repainting all the tiles even when there is no need to do so. This patch teaches teh data detector overlay controller to better reason about when a repaint is necessary, and only calls setNeedsDisplay() when those conditions are met. Namely, we no longer repaint if there is no active highlight or if the active highlight instance has not changed. In a future patch, we will further optimize this by clipping the repaint to only the bounds of the active (and just-deactivated) highlight. * Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDataDetectorOverlayController.h: * Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDataDetectorOverlayController.mm: (WebKit::PDFDataDetectorOverlayController::handleMouseEvent): (WebKit::PDFDataDetectorOverlayController::didInvalidateHighlightOverlayRects): Canonical link: https://commits.webkit.org/276200@main
- Loading branch information