racket/draw: fix ok? result for too-large bitmap creation

Use cairo_surface_status() to check whether creation succeeded.
This commit is contained in:
Matthew Flatt 2014-11-24 13:13:18 -07:00
parent f02bfbd11e
commit ce4f41bc72
2 changed files with 4 additions and 0 deletions

View File

@ -201,6 +201,8 @@
(max (*i scale h) 1))])
(cairo_surface_flush s)
(cond
[(not (zero? (cairo_surface_status s)))
#f]
[(cairo_image_surface_get_data s)
(cond
[b&w?

View File

@ -109,6 +109,8 @@
(define-cairo cairo_get_target (_cfun _cairo_t -> _cairo_surface_t)) ;; not an allocator
(define-cairo cairo_surface_status (_cfun _cairo_surface_t -> _int))
(define-cairo cairo_surface_get_type (_cfun _cairo_surface_t -> _int))
;; Context