anchor.diff:      (medium-draw-line* medium x1 y1 x2 y2)))
   
   (defmethod medium-draw-polygon* ((medium clx-medium) coord-seq closed filled)
  +  ;; TODO:
  +  ;; . cons less
  +  ;; . clip
     (assert (evenp (length coord-seq)))
  -  (let ((coord-seq (coerce coord-seq 'list))) ;XXX optimize this
  -    (with-transformed-positions ((sheet-native-transformation
  -				  (medium-sheet medium))
  -				 coord-seq)
  -      (setq coord-seq (mapcar #'round-coordinate coord-seq))
  -      (with-clx-graphics (medium)
  -	(xlib:draw-lines mirror gc
  -			 (if closed
  -			     (append coord-seq (list (first coord-seq)
  -						     (second coord-seq)))
  -			     coord-seq)
  -			 :fill-p filled)))))
  +  (with-transformed-positions ((sheet-native-transformation
  +                                (medium-sheet medium))
  +                               coord-seq)
  +    (setq coord-seq (map 'vector #'round-coordinate coord-seq))
  +    (with-clx-graphics (medium)
  +      (xlib:draw-lines mirror gc
  +                       (if closed
  +                           (concatenate 'vector
  +                                        coord-seq
  +                                        (vector (first coord-seq)
  +                                                (second coord-seq)))
  +                           coord-seq)
  +                       :fill-p filled))))
   
   (defmethod medium-draw-rectangle* ((medium clx-medium) left top right bottom filled)
  +  (medium-draw-rectangle-using-ink* medium (medium-ink medium)
  +                                    left top right bottom filled))
  +
  +(defmethod medium-draw-rectangle-using-ink* ((medium clx-medium) (ink t) left top right bottom filled)
     (let ((tr (sheet-native-transformation (medium-sheet medium))))
       (with-transformed-position (tr left top)
         (with-transformed-position (tr right bottom)
  
positive.code:                 (bottom (round-coordinate bottom)))
              ;; To clip rectangles, we just need to clamp the cooridnates
              (xlib:draw-rectangle mirror gc
                                          (max #x-8000 (min #x7FFF left))
                                          (max #x-8000 (min #x7FFF top))
                                          (max 0 (min #xFFFF (- right left)))
                                          (max 0 (min #xFFFF (- bottom top)))
                                          filled) ))))))
  
  (defmethod medium-draw-rectangles* ((medium clx-medium) position-seq filled)
    (assert (evenp (length position-seq)))
  
negative.code: (defclass clx-medium (basic-medium)
    ((gc
        :initform nil)
     (picture
      :initform nil)
     #+unicode
     (fontset
        :initform nil
        :accessor medium-fontset)
     ))
  
  #+CLX-EXT-RENDER
  (defun clx-medium-picture (clx-medium)
    (with-slots (picture) clx-medium
      (or picture
          (setf picture
                (xlib:render-create-picture (port-lookup-mirror (port clx-medium) (medium-sheet clx-medium)))))))
  
  
  