moved backend interface to canvas.go

This commit is contained in:
Thomas Friedel 2019-02-20 16:54:04 +01:00
parent c28c50a22e
commit 7cef867541
2 changed files with 9 additions and 9 deletions

View file

@ -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)
}

View file

@ -37,6 +37,15 @@ type Canvas struct {
shadowBuf [][2]float64 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 { type drawState struct {
transform mat transform mat
fill drawStyle fill drawStyle