From 13b9e6aee5e539eab613303a78fa6c2d9306c8a8 Mon Sep 17 00:00:00 2001
From: faiface <faiface@ksp.sk>
Date: Mon, 10 Apr 2017 00:20:19 +0200
Subject: [PATCH] add ComposeTarget interface

---
 interface.go | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/interface.go b/interface.go
index 5f48f65..5287a1d 100644
--- a/interface.go
+++ b/interface.go
@@ -38,6 +38,30 @@ type BasicTarget interface {
 	SetColorMask(color.Color)
 }
 
+// ComposeTarget is a BasicTarget capable of Porter-Duff composition.
+type ComposeTarget interface {
+	BasicTarget
+
+	// SetComposeMethod sets a Porter-Duff composition method to be used.
+	SetComposeMethod(ComposeMethod)
+}
+
+// ComposeMethod is a Porter-Duff composition method.
+type ComposeMethod int
+
+// Here's the list of all available Porter-Duff composition methods. User ComposeOver for the basic
+// alpha blending.
+const (
+	ComposeOver ComposeMethod = iota
+	ComposeIn
+	ComposeOut
+	ComposeAtop
+	ComposeDstIn
+	ComposeDstOut
+	ComposeDstAtop
+	ComposeXor
+)
+
 // Triangles represents a list of vertices, where each three vertices form a triangle. (First,
 // second and third is the first triangle, fourth, fifth and sixth is the second triangle, etc.)
 type Triangles interface {
-- 
GitLab