anchor.diff:           (mirror (port-lookup-mirror port (medium-sheet medium))))
       (with-slots (gc) medium
         (unless gc
  -        (setq gc (xlib:create-gcontext :drawable mirror))
  -        (and gc
  -             (setf (xlib:gcontext-fill-style gc) :solid))))))
  +        (setf gc (xlib:create-gcontext :drawable mirror)
  +              (xlib:gcontext-fill-style gc) :solid)))))
   
   (defmethod medium-gcontext ((medium clx-medium) (ink color))
     (declare (optimize (debug 3)))
  -  (let* ((port (port medium))
  -         (mirror (port-lookup-mirror port (medium-sheet medium)))
  -         (line-style (medium-line-style medium)))
  +  (let* ((port (port medium)))
       (with-slots (gc last-medium-device-region) medium
  -      (unless gc
  -        (setq gc (xlib:create-gcontext :drawable mirror))
  -        ;; this is kind of false, since the :unit should be taken
  -        ;; into account -RS 2001-08-24
  -        (setf (xlib:gcontext-line-width gc) (line-style-thickness line-style)
  -              (xlib:gcontext-cap-style gc) (translate-cap-shape
  -                                            (line-style-cap-shape line-style))
  -              (xlib:gcontext-join-style gc) (line-style-joint-shape line-style))
  -        (let ((dashes (line-style-dashes line-style)))
  -          (unless (null dashes)
  -            (setf (xlib:gcontext-line-style gc) :dash
  -                  (xlib:gcontext-dashes gc) (if (eq dashes t) 3
  -                                                dashes)))))
         (setf (xlib:gcontext-function gc) boole-1)
         (setf (xlib:gcontext-foreground gc) (X-pixel port ink)
               (xlib:gcontext-background gc) (X-pixel port (medium-background medium)))
  
positive.code: 
  
  ;;;;
  
  #+ (or) ;; When used for transformed pattern it simply doesn't work. We either
          ;; should create design-gcontext for transformed-pattern, guard its
          ;; invalidation with a dynamic variable or do not cache at all. For now
          ;; we disable it and we'll re-enable it when we implement
          ;; design-gcontext for transformed patterns (which is needed
          ;; anyway). Then maybe we will reuse cached gcontext.
  (defmethod design-gcontext :around ((medium clx-medium) (ink climi::indexed-pattern))
    (let ((design-cache (slot-value (port medium) 'design-cache)))
      (alexandria:ensure-gethash ink design-cache (call-next-method))))
  
  ;;; XXX: both PM and MM pixmaps should be freed with (xlib:free-pixmap pixmap)
  ;;; when not used. We do not do that right now.
  (defun compute-rgb-image-pixmap-and-mask (drawable image)
    (let* ((width (pattern-width image))
           (height (pattern-height image))
           (depth (xlib:drawable-depth drawable))
  
negative.code:         (%set-gc-clipping-region medium gc))
        gc)))
  
  (defmethod medium-gcontext ((medium clx-medium) (ink climi::uniform-compositum))
    (let ((opacity (climi::compositum-mask ink))
          (ink (climi::compositum-ink ink)))
      (if (< (opacity-value opacity) 0.5)
          (slot-value medium 'gc)
          (medium-gcontext medium ink))))
  
  (defmethod medium-gcontext ((medium clx-medium) (ink climi::over-compositum))
    (medium-gcontext medium (climi::compositum-foreground ink)))
  
  (defmethod medium-gcontext ((medium clx-medium) (ink climi::opacity))
    (if (< (opacity-value ink) 0.5)
        (slot-value medium 'gc)
        (medium-gcontext medium +background-ink+)))
  
  (defmethod medium-gcontext ((medium clx-medium) (ink climi::indirect-ink))
    (medium-gcontext medium (climi::indirect-ink-ink ink)))
  