diff --git a/canvas/canvas.lisp b/canvas/canvas.lisp index a5dde99..407eb48 100644 --- a/canvas/canvas.lisp +++ b/canvas/canvas.lisp @@ -79,3 +79,25 @@ (defun update-canvas-pixel-ratio (canvas pixel-ratio) (bodge-canvas:update-canvas-pixel-ratio (%handle-of canvas) pixel-ratio)) + + +(defmacro with-blend-factors ((source-factor destination-factor + &optional source-alpha-factor destination-alpha-factor) + &body body) + `(bodge-canvas::with-blend-factors (,source-factor ,destination-factor + :source-alpha-factor + ,source-alpha-factor + :destination-alpha-factor + ,destination-alpha-factor + :canvas (%handle-of *canvas*)) + ,@body)) + + +(defmacro with-composite-operation ((operation) &body body) + `(bodge-canvas:with-composite-operation (,operation (%handle-of *canvas*)) + ,@body)) + + +(defmacro with-alpha ((value) &body body) + `(bodge-canvas:with-alpha (,value (%handle-of *canvas*)) + ,@body)) diff --git a/canvas/drawing.lisp b/canvas/drawing.lisp index 71dc5a4..4b72739 100644 --- a/canvas/drawing.lisp +++ b/canvas/drawing.lisp @@ -1,7 +1,6 @@ (cl:in-package :cl-bodge.canvas) - (defun draw-line (origin end paint &key (thickness 1.0)) (bodge-canvas:draw-line origin end (%paint-handle-of paint) :thickness thickness)) diff --git a/canvas/packages.lisp b/canvas/packages.lisp index 21e84a2..92d11b9 100644 --- a/canvas/packages.lisp +++ b/canvas/packages.lisp @@ -66,4 +66,8 @@ #:register-font-face #:canvas-font-metrics #:canvas-text-bounds - #:canvas-text-advance)) + #:canvas-text-advance + + #:with-composite-operation + #:with-blend-factors + #:with-alpha))