anchor.diff:  (in-package :mezzano.gui)
   
   (defstruct (surface
  -             (:constructor %make-surface))
  +             (:constructor %make-surface)
  +             (:copier nil))
     (pixels (error "Pixel data not specified."))
     (format (error "Format not specified.")))
   
  
positive.code: 
  (defun surface-pixel (surface x y)
    "Get the pixel in SURFACE at (X,Y)."
    (aref (surface-pixels surface) y x))
  
  (defun (setf surface-pixel) (value surface x y)
    "Set the pixel in SURFACE at (X,Y)."
    (setf (aref (surface-pixels surface) y x) value))
  
  (defun bitblt (mode width height source-surface source-x source-y dest-surface dest-x dest-y)
    "Copy a WIDTHxHEIGHT rectangle of pixels from SOURCE-SURFACE to DEST-SURFACE.
  
negative.code: (defun make-surface (width height &key (format :argb32) (initial-colour 0))
    "Create a new surface of the specified WIDTH, HEIGHT and FORMAT.
  The surface will be filled with INITIAL-COLOUR, which defaults to fully transparent."
    (check-type format (member :argb32 :a8 :a1 :argb64f))
    (%make-surface :pixels (if (eql format :argb64f)
                               (let ((pixels (make-array (list height width 4)
                                                         :element-type 'short-float))
                                     (a (float (colour-alpha initial-colour) 0.0s0))
                                     (r (float (colour-red initial-colour) 0.0s0))
                                     (g (float (colour-green initial-colour) 0.0s0))
                                     (b (float (colour-blue initial-colour) 0.0s0)))
                                 (dotimes (y height)
                                   (dotimes (x height)
                                     (setf (aref pixels y x 0) b
                                           (aref pixels y x 1) g
                                           (aref pixels y x 2) r
                                           (aref pixels y x 3) a)))
                                 pixels)
                               (make-array (list height width)
                                       :element-type (ecase format
                                                       (:argb32 '(unsigned-byte 32))
                                                       (:a8 '(unsigned-byte 8))
                                                       (:a1 'bit))
                                       :initial-element initial-colour))
                   :format format))
  
  (defun make-surface-from-array (array &key (format :argb32) premultiplied)
    "Create a new surface with the same dimensions as ARRAY.
  If the surface format contains colour components, they will be converted to
  premultiplied alpha unless PREMULTIPLIED is true."
    (check-type format (member :argb32 :a8 :a1 :argb64f))
    (let ((pixels (ecase format
                    (:argb32
                     (check-type array (array (unsigned-byte 32) (* *)))
  