racket/gui win32: enable clipping-problem workaround for 32-bit mode

The specialization to Win64 to work around a Cairo clipping
problem probably had more to do with the version of Cairo,
instead of the variant of Windows, since both variants need the
workarounds after a Cairo upgrade.
This commit is contained in:
Matthew Flatt 2014-09-25 13:53:36 -06:00
parent 722d4858aa
commit 641fa5f744

View File

@ -31,6 +31,8 @@
(define hwnd-param (make-parameter #f)) (define hwnd-param (make-parameter #f))
(define need-clip-workarounds? #t)
(define win32-bitmap% (define win32-bitmap%
(class win32-no-hwnd-bitmap% (class win32-no-hwnd-bitmap%
(init w h hwnd [gl-config #f]) (init w h hwnd [gl-config #f])
@ -74,9 +76,8 @@
;; Work around a Cairo(?) bug. When a clipping ;; Work around a Cairo(?) bug. When a clipping
;; region is set, we draw text, and then the clipping ;; region is set, we draw text, and then the clipping
;; region is changed, the change doesn't take ;; region is changed, the change doesn't take
;; until we draw more text --- but only under Win64, ;; until we draw more text --- but only with DDB surfaces.
;; and only with DDB surfaces. (when need-clip-workarounds?
(when win64?
(let ([bm (internal-get-bitmap)]) (let ([bm (internal-get-bitmap)])
(when (bm . is-a? . win32-bitmap%) (when (bm . is-a? . win32-bitmap%)
(SelectClipRgn (cairo_win32_surface_get_dc (SelectClipRgn (cairo_win32_surface_get_dc
@ -130,11 +131,11 @@
(define sh (->screen (unbox h))) (define sh (->screen (unbox h)))
(define r (make-RECT 0 0 sw sh)) (define r (make-RECT 0 0 sw sh))
(define clip-type (define clip-type
(if win64? (if need-clip-workarounds?
(GetClipBox hdc r) (GetClipBox hdc r)
SIMPLEREGION)) SIMPLEREGION))
(cond (cond
[(and win64? [(and need-clip-workarounds?
(not (and (= clip-type SIMPLEREGION) (not (and (= clip-type SIMPLEREGION)
(= (RECT-left r) 0) (= (RECT-left r) 0)
(= (RECT-top r) 0) (= (RECT-top r) 0)