racket/draw: avoid callback-based PNG writing

Doc rendering has been occasionally crashing in Pixman/Cairo. It might
have something to do with a non-atomic callback, so let's try avoiding
that, first. (If that doesn't work, the next step is to avoid using
Cairo in a multi-threaded way, for which this is a first step, too.)
This commit is contained in:
Matthew Flatt 2012-06-27 12:28:36 -06:00
parent 5f3f3e8c54
commit ec6f3fd610
2 changed files with 6 additions and 5 deletions

View File

@ -545,7 +545,7 @@
(let ([w (create-png-writer out width height #t #f)])
(write-png w rows)
(destroy-png-writer w)))]
[(and (not alpha-channel?)
[else #;(and (not alpha-channel?)
loaded-mask
(= width (send loaded-mask get-width))
(= height (send loaded-mask get-height)))
@ -568,6 +568,7 @@
(let ([w (create-png-writer out width height #f #t)])
(write-png w rows)
(destroy-png-writer w))))]
#;
[else
;; Use Cairo built-in support:
(let ([proc (lambda (ignored bstr len)

View File

@ -306,7 +306,7 @@
-> _int)
(_pointer = #f)
-> _cairo_surface_t/null))
;; Not recommended, unless it makes sense to make the allback atomic:
(define-cairo cairo_surface_write_to_png_stream (_fun _cairo_surface_t
(_fun _pointer
(s : _pointer)