,
svn: r620
This commit is contained in:
parent
c3e325f51f
commit
fd7790118c
|
@ -48,11 +48,15 @@
|
|||
(= (vector-ref v1 (- i 1)) (vector-ref v2 (- i 1)))))
|
||||
(loop (- i 4)))))))
|
||||
|
||||
|
||||
(define image-snip-cache (make-hash-table 'weak))
|
||||
;; coerce-to-cache-image-snip : image -> (is-a?/c cache-image-snip%)
|
||||
(define (coerce-to-cache-image-snip snp)
|
||||
(cond
|
||||
[(hash-table-get image-snip-cache snp (λ () #f)) => values]
|
||||
[(is-a? snp image-snip%)
|
||||
(let ([bmp (send snp get-bitmap)])
|
||||
(let* ([bmp (send snp get-bitmap)]
|
||||
[cis
|
||||
(if bmp
|
||||
(let ([bmp-mask (or (send bmp get-loaded-mask)
|
||||
(send snp get-bitmap-mask)
|
||||
|
@ -71,7 +75,9 @@
|
|||
(bitmaps->cache-image-snip bmp
|
||||
(bitmap->mask bmp)
|
||||
(floor (/ w 2))
|
||||
(floor (/ h 2)))))))]
|
||||
(floor (/ h 2))))))])
|
||||
(hash-table-put! image-snip-cache snp cis)
|
||||
cis)]
|
||||
[else snp]))
|
||||
|
||||
;; copy-bitmap : bitmap -> bitmap
|
||||
|
|
Loading…
Reference in New Issue
Block a user