From 7cef8675416b5ca3b18164e1c9b9a30bd2912df6 Mon Sep 17 00:00:00 2001 From: Thomas Friedel Date: Wed, 20 Feb 2019 16:54:04 +0100 Subject: [PATCH] moved backend interface to canvas.go --- backend.go | 9 --------- canvas.go | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 backend.go diff --git a/backend.go b/backend.go deleted file mode 100644 index e3639a8..0000000 --- a/backend.go +++ /dev/null @@ -1,9 +0,0 @@ -package canvas - -import "github.com/tfriedel6/canvas/backend/backendbase" - -type Backend interface { - ClearRect(x, y, w, h int) - Clear(pts [4][2]float64) - Fill(style *backendbase.Style, pts [][2]float64) -} diff --git a/canvas.go b/canvas.go index 2fc0e7c..a5fcb4b 100644 --- a/canvas.go +++ b/canvas.go @@ -37,6 +37,15 @@ type Canvas struct { shadowBuf [][2]float64 } +// Backend is used by the canvas to actually do the final +// drawing. This enables the backend to be implemented by +// various methods (OpenGL, but also other APIs or software) +type Backend interface { + ClearRect(x, y, w, h int) + Clear(pts [4][2]float64) + Fill(style *backendbase.Style, pts [][2]float64) +} + type drawState struct { transform mat fill drawStyle