WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
172495
Zoom in/out is slow in Safari with large PDFs
https://bugs.webkit.org/show_bug.cgi?id=172495
Summary
Zoom in/out is slow in Safari with large PDFs
Tim Horton
Reported
2017-05-23 02:01:26 PDT
Zoom in/out is slow in Safari with large PDFs
Attachments
Patch
(2.13 KB, patch)
2017-05-23 02:01 PDT
,
Tim Horton
no flags
Details
Formatted Diff
Diff
Patch
(4.98 KB, patch)
2017-05-23 11:50 PDT
,
Tim Horton
simon.fraser
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Tim Horton
Comment 1
2017-05-23 02:01:52 PDT
Created
attachment 310987
[details]
Patch
Andreas Kling
Comment 2
2017-05-23 09:49:38 PDT
Comment on
attachment 310987
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=310987&action=review
> Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm:1156 > + size_t pageCount = [m_pdfDocument pageCount]; > + for (size_t i = 0; i < pageCount; ++i) > + m_pageBoxes.append(enclosingIntRect([[m_pdfDocument pageAtIndex:i] boundsForBox:kPDFDisplayBoxCropBox]));
I'm no expert on this code, but shouldn't we clear m_pageBoxes somehow before appending all the boxes to it? Or is this going to only run once?
Sam Weinig
Comment 3
2017-05-23 10:10:01 PDT
Comment on
attachment 310987
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=310987&action=review
>> Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm:1156 >> + m_pageBoxes.append(enclosingIntRect([[m_pdfDocument pageAtIndex:i] boundsForBox:kPDFDisplayBoxCropBox])); > > I'm no expert on this code, but shouldn't we clear m_pageBoxes somehow before appending all the boxes to it? > Or is this going to only run once?
Also, since we know how many things are getting appened, you can reserve capacity and then do uncheckedAppends.
Tim Horton
Comment 4
2017-05-23 11:36:02 PDT
(In reply to Andreas Kling from
comment #2
)
> Comment on
attachment 310987
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=310987&action=review
> > > Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm:1156 > > + size_t pageCount = [m_pdfDocument pageCount]; > > + for (size_t i = 0; i < pageCount; ++i) > > + m_pageBoxes.append(enclosingIntRect([[m_pdfDocument pageAtIndex:i] boundsForBox:kPDFDisplayBoxCropBox])); > > I'm no expert on this code, but shouldn't we clear m_pageBoxes somehow > before appending all the boxes to it? > Or is this going to only run once?
LOL, yes, and this has always been broken, but has never really mattered much because we only use the first box... which means we can simplify this a great deal and do even less work!
Tim Horton
Comment 5
2017-05-23 11:50:33 PDT
Created
attachment 311035
[details]
Patch
Simon Fraser (smfr)
Comment 6
2017-05-23 11:53:06 PDT
Comment on
attachment 311035
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=311035&action=review
> Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm:1160 > + m_firstPageHeight = static_cast<unsigned>(CGCeiling([[m_pdfDocument pageAtIndex:0] boundsForBox:kPDFDisplayBoxCropBox].size.height));
Do we always have a page 0?
Tim Horton
Comment 7
2017-05-23 11:58:30 PDT
http://trac.webkit.org/changeset/217288/webkit
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug