op/paint: return ClipOp from Path.End

Instead of adding an implicit ClipOp, return a ClipOp ready to use, freeing the
caller from recording a macro.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-10-09 15:05:09 +02:00
parent a937a76534
commit ef5cf5b724
6 changed files with 36 additions and 29 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ import (
"strconv"
"testing"
"gioui.org/op"
"gioui.org/op/paint"
)
func TestLayoutLRU(t *testing.T) {
@@ -24,7 +24,7 @@ func TestLayoutLRU(t *testing.T) {
func TestuPathLRU(t *testing.T) {
c := new(pathCache)
put := func(i int) {
c.Put(pathKey{str: strconv.Itoa(i)}, op.MacroOp{})
c.Put(pathKey{str: strconv.Itoa(i)}, paint.ClipOp{})
}
get := func(i int) bool {
_, ok := c.Get(pathKey{str: strconv.Itoa(i)})