RESOLVED FIXED 64032
Work around Skia PDF's lack of inverted path support.
https://bugs.webkit.org/show_bug.cgi?id=64032
Summary Work around Skia PDF's lack of inverted path support.
Steve VanDeBogart
Reported 2011-07-06 14:22:25 PDT
The trick used in http://neugierig.org/software/chromium/notes/2010/07/clipping.html to support antialiased clips doesn't work when printing to Skia's PDF backend because the backend does not support inverted paths (PDF does not support it natively meaning Skia would need a full geometry engine to support it). This manifests as rounded buttons not being drawn when printing, tracked as Chrome bug 79519. However, when the output is a vector device, like PDF, we don't need antialiased clips - it's up to the PDF rendering engine to do that. So we can simply disable the antialiased clip code if the output is a vector device. I think the fix isn't testable because it requires examining the printed output.
Attachments
Don't use clip antialias hack when printing. (1.39 KB, patch)
2011-07-06 14:51 PDT, Steve VanDeBogart
no flags
Don't use clip antialias hack when printing. (1.45 KB, patch)
2011-07-06 14:57 PDT, Steve VanDeBogart
no flags
Adding descriptive comment in changelog and inline for Steve (2.36 KB, patch)
2011-07-07 14:52 PDT, Chris Guillory
no flags
Steve VanDeBogart
Comment 1 2011-07-06 14:51:23 PDT
Created attachment 99885 [details] Don't use clip antialias hack when printing.
WebKit Review Bot
Comment 2 2011-07-06 14:53:50 PDT
Attachment 99885 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/ChangeLog:1: ChangeLog entry has no bug number [changelog/bugnumber] [5] Total errors found: 1 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Steve VanDeBogart
Comment 3 2011-07-06 14:57:50 PDT
Created attachment 99887 [details] Don't use clip antialias hack when printing.
Chris Guillory
Comment 4 2011-07-06 15:33:57 PDT
James, can you take a look at this change?
James Robinson
Comment 5 2011-07-06 15:42:05 PDT
Why can't we test printed output?
Steve VanDeBogart
Comment 6 2011-07-06 15:44:31 PDT
As far as I'm aware, there's not a PDF renderer available in the testing pipeline.
James Robinson
Comment 7 2011-07-06 15:46:05 PDT
Who's working on fixing that?
Tony Chang
Comment 8 2011-07-06 15:47:54 PDT
Have you tried layoutTestController.setPrinting()? There are a few examples of this in the tree (e.g., printing/compositing-layer-printing.html and printing/media-queries-print.html). It might only work on Mac, which probably doesn't go through this code path, in which case you can ignore me.
Tony Chang
Comment 9 2011-07-06 15:48:41 PDT
Hamaji may have other ideas on how to test printing.
Steve VanDeBogart
Comment 10 2011-07-06 15:56:11 PDT
There's a bug in Skia, assigned to me: http://code.google.com/p/skia/issues/detail?id=246 For awhile the plan was to use Chrome's PDF plugin, but licensing didn't work out on that. I investigated using ghostscript, but it has some very strange rendering quirks for the existing skia test set. Ben Wagner recently proposed some code to use lib poppler, which we may use, though it does not handle shaders or soft masks correctly.
Chris Guillory
Comment 11 2011-07-06 17:27:19 PDT
LayoutTests/platform/chromium/test_expectations.txt skips printing/compositing-layer-printing.html and printing/media-queries-print.html for the chromium port. With the comment: // These tests try to print a PDF file as the expected result. I don't think // we plan on supporting this anytime soon. I think Eric said before that automated testing of printing with DumpRenderTree is not possible.
Eric Seidel (no email)
Comment 12 2011-07-06 18:27:01 PDT
Yup, printing tests were a dream. But never a reality. PDFs (at least on OS X) include all sorts of per-machine information, making them a poor reference image format.
James Robinson
Comment 13 2011-07-07 11:51:02 PDT
Comment on attachment 99887 [details] Don't use clip antialias hack when printing. OK, but please add a descriptive comment in the changelog and inline to explain what is going on.
Chris Guillory
Comment 14 2011-07-07 14:52:02 PDT
Created attachment 100036 [details] Adding descriptive comment in changelog and inline for Steve
James Robinson
Comment 15 2011-07-07 15:55:13 PDT
Comment on attachment 100036 [details] Adding descriptive comment in changelog and inline for Steve Thanks for the explanation, I'm sure the next person to debug through this bit of code will appreciate it greatly.
WebKit Review Bot
Comment 16 2011-07-07 16:16:32 PDT
Comment on attachment 100036 [details] Adding descriptive comment in changelog and inline for Steve Clearing flags on attachment: 100036 Committed r90599: <http://trac.webkit.org/changeset/90599>
WebKit Review Bot
Comment 17 2011-07-07 16:16:37 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.