anchor.diff:  (defmacro clip-line-to-clip-rectangle (x1 y1 x2 y2)
     `(apply #'%clip-line ,x1 ,y1 ,x2 ,y2 *clip-rectangle*))
   
  -#+debug
  -(defun clip-test (e length &optional (size 500))
  -  (let ((w size)
  -	(h size))
  -    (let ((cx (/ w 2))
  -	  (cy (/ h 2)))
  -      (scl:send e :expose)
  -      (graphics:with-room-for-graphics  (e h)
  -	(setq w (/ w 4) h (/ h 4))
  -	(draw-rectangle (- cx w) (+ cy h) (+ cx w) (- cy h)
  -				 :stream e :filled nil)	; Outline clipping region
  -	(decf w 1) (decf h 1)
  -	(dotimes (i length)
  -	  (multiple-value-bind (x1 y1 x2 y2)
  -	      (values (random size) (random size) (random size) (random size))
  -	    (draw-line x1 y1 x2 y2 :stream e)
  -	  (multiple-value-setq (x1 y1 x2 y2)
  -	      (%clip-line x1 y1 x2 y2
  -			 (- cx w) (+ cx w) (- cy h) (+ cy h)))
  -	    (if x1 (draw-line x1 y1 x2 y2 :stream e :thickness 3))))))))
  -
  -#+debug
  -(defun clip-test-2 (e length &optional (size 500))
  -  (let ((w size)
  -	(h size))
  -    (let ((cx (/ w 2))
  -	  (cy (/ h 2)))
  -      (scl:send e :expose)
  -      (setq w (/ w 4) h (/ h 4))
  -      (device-draw-rectangle e (- cx w) (+ cx w) (- cy h) (+ cy h) 
  -			     :filled nil)	; Outline clipping region
  -      (decf w 1) (decf h 1)
  -      (with-clipping-uv-rectangle (e (- cx w) (+ cx w) (- cy h) (+ cy h))
  -	(dotimes (i length)
  -	  (multiple-value-bind (x1 y1 x2 y2)
  -	      (values (random size) (random size) (random size) (random size))
  -;;	      (device-draw-circle e x1 y1 20)
  -	    (device-draw-rectangle e x1 x2 y1 y2)
  -	    (device-draw-line e x1 y1 x2 y2)))))))
  -
    
   ;;; "PORTABLE" GRAPHICS DEVICE INTERFACE FOR GRAPHS.
  
positive.code: 
  (defun flip-alu-p (alu)
    "Determine if this alu represents XOR drawing."
    #+clim (eq alu :flipping)
    #-clim
    (not (cond ((numberp alu) (= alu tv:alu-xor))	; Black and white.
  	     ((symbolp alu) (eq alu :flip))	
  	     ((scl:instancep alu) (= (scl:send alu :alu) tv:alu-xor)))))	; Color
  
  (defun DEVICE-DRAW-LINE (stream x1 y1 x2 y2 
  			 &key (alu %alu) (dash-pattern %dash-pattern)
  
negative.code: ;;; are (stream x1 y1 x2 y2).  Here we put all our smarts about how to draw lines
  ;;; as fast as possible.
  
  (defun make-optimized-line-displayer (alu thickness record-output-history)
    (let ((line-style nil))
      (cond (record-output-history
  	   #'(lambda (stream from-x from-y to-x to-y)
  	       (progn
                   ;; 192 bytes
                   (unless line-style
                     (setq line-style 
                           (make-line-style :thickness thickness)))
                   (with-drawing-options (stream :ink alu 
                                                 :line-style line-style)
                     (medium-draw-line* 
                      stream from-x from-y to-x to-y)))))
  	  (t
  	   #'(lambda (stream from-x from-y to-x to-y)
                 (unless line-style
                   (setq line-style (make-line-style :thickness thickness)))
                 (clim-internals::draw-line*
                  stream 0 0 from-x from-y to-x to-y :ink alu :line-style line-style))))))
  
  
  