RESOLVED FIXED 185445
Set colorspace in the PDF plugin.
https://bugs.webkit.org/show_bug.cgi?id=185445
Summary Set colorspace in the PDF plugin.
Per Arne Vollan
Reported 2018-05-08 13:49:53 PDT
We should set the colorspace in the PDF plugin.
Attachments
Patch (2.23 KB, patch)
2018-05-08 13:53 PDT, Per Arne Vollan
no flags
Patch (2.29 KB, patch)
2018-05-08 15:33 PDT, Per Arne Vollan
no flags
Per Arne Vollan
Comment 1 2018-05-08 13:50:44 PDT
Per Arne Vollan
Comment 2 2018-05-08 13:53:00 PDT
Brent Fulgham
Comment 3 2018-05-08 15:18:18 PDT
Comment on attachment 339869 [details] Patch r=me.
Tim Horton
Comment 4 2018-05-08 15:19:25 PDT
Comment on attachment 339869 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=339869&action=review > Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:637 > + if ([m_pdfLayerController.get() respondsToSelector:@selector(setDeviceColorSpace:)]) No need for the .get()s
Tim Horton
Comment 5 2018-05-08 15:20:19 PDT
Comment on attachment 339869 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=339869&action=review > Source/WebKit/WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:170 > +- (void) setDeviceColorSpace:(CGColorSpaceRef)colorSpace; No space after the ) >> Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:637 >> + if ([m_pdfLayerController.get() respondsToSelector:@selector(setDeviceColorSpace:)]) > > No need for the .get()s No need for the .get()s > Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:638 > + [m_pdfLayerController.get() setDeviceColorSpace:screenColorSpace()]; What does screenColorSpace do? It seems like it will usually be wrong, and we should be getting it from the page/view, not the screen (because there are multiple screens).
Brent Fulgham
Comment 6 2018-05-08 15:30:42 PDT
Comment on attachment 339869 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=339869&action=review >> Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:638 >> + [m_pdfLayerController.get() setDeviceColorSpace:screenColorSpace()]; > > What does screenColorSpace do? It seems like it will usually be wrong, and we should be getting it from the page/view, not the screen (because there are multiple screens). You could call screenColorSpace(this) maybe? The PDFPlugin's Widget will be tied to the correct screen, then 'screenColorSpace' can give you the right answer, tied to the display the PDF is being shown on.
Per Arne Vollan
Comment 7 2018-05-08 15:33:14 PDT
Per Arne Vollan
Comment 8 2018-05-08 15:36:31 PDT
(In reply to Brent Fulgham from comment #6) > Comment on attachment 339869 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=339869&action=review > > >> Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:638 > >> + [m_pdfLayerController.get() setDeviceColorSpace:screenColorSpace()]; > > > > What does screenColorSpace do? It seems like it will usually be wrong, and we should be getting it from the page/view, not the screen (because there are multiple screens). > > You could call screenColorSpace(this) maybe? The PDFPlugin's Widget will be > tied to the correct screen, then 'screenColorSpace' can give you the right > answer, tied to the display the PDF is being shown on. I used the PDF frame's view in the latest patch. Thanks for reviewing, all!
Simon Fraser (smfr)
Comment 9 2018-05-08 16:03:45 PDT
Comment on attachment 339889 [details] Patch How does this update if the screen colorspace changes?
Per Arne Vollan
Comment 10 2018-05-08 16:11:05 PDT
(In reply to Simon Fraser (smfr) from comment #9) > Comment on attachment 339889 [details] > Patch > > How does this update if the screen colorspace changes? That is a good point ... The current patch does not handle this, I believe. Thanks for reviewing!
WebKit Commit Bot
Comment 11 2018-05-08 18:35:01 PDT
Comment on attachment 339889 [details] Patch Clearing flags on attachment: 339889 Committed r231535: <https://trac.webkit.org/changeset/231535>
WebKit Commit Bot
Comment 12 2018-05-08 18:35:03 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.