Summary: | using clear drawing operator crashes printing | ||
---|---|---|---|
Product: | cairo | Reporter: | Julian Lamb <thepurlieu> |
Component: | image backend | Assignee: | Carl Worth <cworth> |
Status: | RESOLVED FIXED | QA Contact: | cairo-bugs mailing list <cairo-bugs> |
Severity: | normal | ||
Priority: | medium | ||
Version: | 1.8.6 | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | Test file to reproduce bug |
Description
Julian Lamb
2009-07-31 21:11:29 UTC
I don't recognise this, and to hit any assertion inside Cairo means something strange and completely unexpected has happened. I didn't reproduce this printing one of examples packaged with gerbv -- but that could just be user error. What would be great would be to confirm this bug with HEAD and then to grab a cairo-trace of the application hitting the bug. But, to be honest, I have a strong suspicion that I may have fixed this by reworking the clipping since 1.8. Created attachment 28365 [details]
Test file to reproduce bug
Thanks for looking into this Chris. If you have gerbv running, could you try the attached file and see if you can get the problem? Just load it and click print, then select an actual printer (not file). If not, it may well be fixed in HEAD. I can definitely compile HEAD and see if it is still there...just let me know. Cheers-- Julian (In reply to comment #3) > Thanks for looking into this Chris. If you have gerbv running, could you try > the attached file and see if you can get the problem? Just load it and click > print, then select an actual printer (not file). That's the killer - using an actual printer. Thanks I can reproduce this locally in both 1.8 and master. So the issue is that when printing the fallback resolution of the printer is set to 0 dpi. CAIRO_OPERATOR_CLEAR can not be handled natively by PDF/PS (except where the CLEAR affects the whole surface and we just discard all previous content) which triggers a fallback. As we attempt to create an fallback image with 0 pixels, we are understandably confused. The backtrace pin-points the caller to _gtk_printer_create_cairo_surface(), gtk/gtkprinter.c:924 so I'll go and look for the culprit there. But first I'll commit the guards to cairo. (Pushed to 1.8, in my local queue for master) In any event, my advice would be to rethink the use of CLEAR as you want to avoid unnecessary image fallbacks. And you need to check for errors after drawing and before commiting the print job -- though perhaps this error will need to be caught inside GTK+. Marking as fixed... I'll go raise a bug+patch for GTK+. Thanks Chris. As far as avoiding CLEAR operations, I'm not sure we have much choice. The RS274X file format has a "negative polarity" command, which pretty much lets the user "erase" previously drawn objects by drawing a negative object over them. Since we allow transparency, I didn't see any other way than to use the CLEAR operator to draw over it, since we can't just draw the object using the background color. Are there some other methods to achieve the same effect? Cheers-- Julian FYI, the GTK+ bug is http://bugzilla.gnome.org/show_bug.cgi?id=590861 (In reply to comment #6) > Thanks Chris. As far as avoiding CLEAR operations, I'm not sure we have much > choice. The RS274X file format has a "negative polarity" command, which pretty > much lets the user "erase" previously drawn objects by drawing a negative > object over them. Since we allow transparency, I didn't see any other way than > to use the CLEAR operator to draw over it, since we can't just draw the object > using the background color. Are there some other methods to achieve the same > effect? I don't think so, other than a wishlist idea for flattening to objects rather than images. Though I'd ask the question on the cairo mailing list, as with a wider audience someone may have a good solution... |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.