fixed a performance bug (avoids computing the rotation of a bitmap when it isnt actually rotated...)

This commit is contained in:
Robby Findler 2010-09-02 10:59:38 -05:00
parent f272acec5f
commit 09bd56081b

View File

@ -829,6 +829,11 @@ the mask bitmap and the original bitmap are all together in a single bytes!
(do-rotate bitmap flipped?)])))))
(define (do-rotate bitmap flip?)
(cond
[(zero? (bitmap-angle bitmap))
;; don't rotate anything in this case.
(void)]
[else
(let ([θ (degrees->radians (bitmap-angle bitmap))])
(let-values ([(bytes w h) (bitmap->bytes (bitmap-rendered-bitmap bitmap)
(bitmap-rendered-mask bitmap))])
@ -840,7 +845,7 @@ the mask bitmap and the original bitmap are all together in a single bytes!
[bm (bytes->bitmap flipped-bytes rotated-w rotated-h)]
[mask (send bm get-loaded-mask)])
(set-bitmap-rendered-bitmap! bitmap bm)
(set-bitmap-rendered-mask! bitmap mask))))))
(set-bitmap-rendered-mask! bitmap mask)))))]))
(define (do-scale bitmap)
(let* ([bdc (make-object bitmap-dc%)]