diff --git a/interface.go b/interface.go index fed7ac8..d92d460 100644 --- a/interface.go +++ b/interface.go @@ -56,11 +56,13 @@ const ( ComposeIn ComposeOut ComposeAtop - ComposeDstOver - ComposeDstIn - ComposeDstOut - ComposeDstAtop + ComposeRover + ComposeRin + ComposeRout + ComposeRatop ComposeXor + ComposePlus + ComposeCopy ) // Triangles represents a list of vertices, where each three vertices form a triangle. (First, diff --git a/pixelgl/canvas.go b/pixelgl/canvas.go index 5ebe5bf..df71f6d 100644 --- a/pixelgl/canvas.go +++ b/pixelgl/canvas.go @@ -153,16 +153,20 @@ func setBlendFunc(cmp pixel.ComposeMethod) { glhf.BlendFunc(glhf.OneMinusDstAlpha, glhf.Zero) case pixel.ComposeAtop: glhf.BlendFunc(glhf.DstAlpha, glhf.OneMinusSrcAlpha) - case pixel.ComposeDstOver: + case pixel.ComposeRover: glhf.BlendFunc(glhf.OneMinusDstAlpha, glhf.One) - case pixel.ComposeDstIn: + case pixel.ComposeRin: glhf.BlendFunc(glhf.Zero, glhf.SrcAlpha) - case pixel.ComposeDstOut: + case pixel.ComposeRout: glhf.BlendFunc(glhf.Zero, glhf.OneMinusSrcAlpha) - case pixel.ComposeDstAtop: + case pixel.ComposeRatop: glhf.BlendFunc(glhf.OneMinusDstAlpha, glhf.SrcAlpha) case pixel.ComposeXor: glhf.BlendFunc(glhf.OneMinusDstAlpha, glhf.OneMinusSrcAlpha) + case pixel.ComposePlus: + glhf.BlendFunc(glhf.One, glhf.One) + case pixel.ComposeCopy: + glhf.BlendFunc(glhf.One, glhf.Zero) default: panic(errors.New("Canvas: invalid compose method")) }