From f245b6ca29e4bed9c19d1b46e2954d405f67f9c5 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 24 Nov 2010 05:44:21 -0700 Subject: [PATCH] fix bitmap% `load-file' method and remove `{get,set}-gl-config' Closes PR 11460 --- collects/racket/draw/private/bitmap.rkt | 10 +++++----- collects/scribblings/draw/bitmap-class.scrbl | 20 ------------------- .../scribblings/draw/gl-config-class.scrbl | 4 ++-- doc/release-notes/racket/Draw_and_GUI_5_1.txt | 4 +++- 4 files changed, 10 insertions(+), 28 deletions(-) diff --git a/collects/racket/draw/private/bitmap.rkt b/collects/racket/draw/private/bitmap.rkt index 81120cc4c0..c567b45ac5 100644 --- a/collects/racket/draw/private/bitmap.rkt +++ b/collects/racket/draw/private/bitmap.rkt @@ -221,11 +221,11 @@ (define locked 0) (define/public (adjust-lock delta) (set! locked (+ locked delta))) - (def/public (load-bitmap [(make-alts path-string? input-port?) in] - [bitmap-file-kind-symbol? [kind 'unknown]] - [(make-or-false color%) [bg #f]] - [any? [complain-on-failure? #f]]) - (check-alternate 'load-bitmap) + (def/public (load-file [(make-alts path-string? input-port?) in] + [bitmap-file-kind-symbol? [kind 'unknown]] + [(make-or-false color%) [bg #f]] + [any? [complain-on-failure? #f]]) + (check-alternate 'load-file) (release-bitmap-storage) (set!-values (s b&w?) (do-load-bitmap in kind bg complain-on-failure?)) (set! width (if s (cairo_image_surface_get_width s) 0)) diff --git a/collects/scribblings/draw/bitmap-class.scrbl b/collects/scribblings/draw/bitmap-class.scrbl index 84b4d14d1b..261b1bd3eb 100644 --- a/collects/scribblings/draw/bitmap-class.scrbl +++ b/collects/scribblings/draw/bitmap-class.scrbl @@ -83,14 +83,6 @@ monochrome bitmap and @racket[32] for a color bitmap. See also } -@defmethod[(get-gl-config [config (is-a?/c gl-config%)]) - void?]{ - -Returns a copy of this bitmap's requested OpenGL configuration. See - also @method[bitmap% set-gl-config]. - -} - @defmethod[(get-height) exact-positive-integer?]{ @@ -282,18 +274,6 @@ bitmap does not have to be selected into the DC. } -@defmethod[(set-gl-config [config (is-a?/c gl-config%)]) - void?]{ - -Sets the requested OpenGL configuration for this bitmap. The - configuration is used when the bitmap selected into a drawing - context, and then a GL context is created for the drawing context. - -The given @scheme[gl-config%] object is copied, so that changes to - the object do not affect the bitmap's configuration. - -} - @defmethod[(set-loaded-mask [mask (is-a?/c bitmap%)]) void?]{ diff --git a/collects/scribblings/draw/gl-config-class.scrbl b/collects/scribblings/draw/gl-config-class.scrbl index f7dcb607d6..69fc48701f 100644 --- a/collects/scribblings/draw/gl-config-class.scrbl +++ b/collects/scribblings/draw/gl-config-class.scrbl @@ -5,8 +5,8 @@ A @scheme[gl-config%] object encapsulates configuration information for an OpenGL drawing context. Use a @scheme[gl-config%] object as an - initialization argument for @scheme[canvas%], or provide it to - @xmethod[bitmap% set-gl-config]. + initialization argument for @scheme[canvas%] or provide it to + @racket[make-gl-bitmap]. @defconstructor[()]{ diff --git a/doc/release-notes/racket/Draw_and_GUI_5_1.txt b/doc/release-notes/racket/Draw_and_GUI_5_1.txt index ddc76d856f..36c1d1ef75 100644 --- a/doc/release-notes/racket/Draw_and_GUI_5_1.txt +++ b/doc/release-notes/racket/Draw_and_GUI_5_1.txt @@ -42,7 +42,9 @@ alphas; for example, drawing a line in the middle of an empty bitmap produces an image with non-zero alpha only at the drawn line. Only bitmaps created with the new `make-gl-bitmap' function support -OpenGL drawing. +OpenGL drawing. The `make-gl-bitmap' function takes a `gl-config%' as +an argument, and the `get-gl-config' and `set-gl-config' methods of +`bitmap%' have been removed. Use the new `make-bitmap', `read-bitmap', `make-monochrome-bitmap', `make-screen-bitmap', and `make-gl-bitmap' functions to create