win32: periodic canvas flushing
original commit: 4d316f78510aed0ff5a90dd038994c6da0eaabda
This commit is contained in:
parent
303034be6f
commit
6482978363
|
@ -112,14 +112,14 @@
|
|||
|
||||
(define (add-event-boundary-callback! v proc)
|
||||
(atomically
|
||||
(alert-tasks-ready)
|
||||
(hash-set! boundary-ht v proc)))
|
||||
(hash-set! boundary-ht v proc)
|
||||
(alert-tasks-ready)))
|
||||
(define (add-event-boundary-sometimes-callback! v proc)
|
||||
(atomically
|
||||
(alert-tasks-ready)
|
||||
(when (zero? (hash-count sometimes-boundary-ht))
|
||||
(set! last-time (current-inexact-milliseconds)))
|
||||
(hash-set! sometimes-boundary-ht v proc)))
|
||||
(hash-set! sometimes-boundary-ht v proc)
|
||||
(alert-tasks-ready)))
|
||||
|
||||
(define (remove-event-boundary-callback! v)
|
||||
(atomically
|
||||
|
|
|
@ -264,8 +264,11 @@
|
|||
(define/public (schedule-periodic-backing-flush)
|
||||
(void))
|
||||
(define/public (do-canvas-backing-flush hdc)
|
||||
(when hdc
|
||||
(do-backing-flush this dc hdc)))
|
||||
(if hdc
|
||||
(do-backing-flush this dc hdc)
|
||||
(let ([hdc (GetDC canvas-hwnd)])
|
||||
(do-backing-flush this dc hdc)
|
||||
(ReleaseDC canvas-hwnd hdc))))
|
||||
|
||||
(define/public (make-compatible-bitmap w h)
|
||||
(send dc make-backing-bitmap w h))
|
||||
|
|
|
@ -146,6 +146,14 @@
|
|||
(define (win32-start-event-pump)
|
||||
(thread (lambda ()
|
||||
(let loop ()
|
||||
(sync queue-evt other-peek-evt)
|
||||
(unless (let ([any-tasks? (sync/timeout 0 boundary-tasks-ready-evt)])
|
||||
(sync/timeout (and any-tasks? (* sometimes-delay-msec 0.001))
|
||||
queue-evt
|
||||
other-peek-evt
|
||||
(if any-tasks?
|
||||
(wrap-evt (system-idle-evt)
|
||||
(lambda (v) #f))
|
||||
boundary-tasks-ready-evt)))
|
||||
(pre-event-sync #t))
|
||||
(as-entry dispatch-all-ready)
|
||||
(loop)))))
|
||||
|
|
Loading…
Reference in New Issue
Block a user