@@ -15,6 +15,7 @@ import (
1515 "image/color"
1616 "math"
1717 "reflect"
18+ "slices"
1819 "time"
1920 "unsafe"
2021
@@ -189,7 +190,7 @@ const (
189190// imageOpData is the shadow of paint.ImageOp.
190191type imageOpData struct {
191192 src * image.RGBA
192- handle interface {}
193+ handle any
193194 filter byte
194195}
195196
@@ -200,7 +201,7 @@ type linearGradientOpData struct {
200201 color2 color.NRGBA
201202}
202203
203- func decodeImageOp (data []byte , refs []interface {} ) imageOpData {
204+ func decodeImageOp (data []byte , refs []any ) imageOpData {
204205 handle := refs [1 ]
205206 if handle == nil {
206207 return imageOpData {}
@@ -547,7 +548,7 @@ func newBlitter(ctx driver.Device) *blitter {
547548 b .texUniforms = new (blitTexUniforms )
548549 b .linearGradientUniforms = new (blitLinearGradientUniforms )
549550 pipelines , err := createColorPrograms (ctx , gio .Shader_blit_vert , gio .Shader_blit_frag ,
550- [3 ]interface {} {b .colUniforms , b .linearGradientUniforms , b .texUniforms },
551+ [3 ]any {b .colUniforms , b .linearGradientUniforms , b .texUniforms },
551552 )
552553 if err != nil {
553554 panic (err )
@@ -565,7 +566,7 @@ func (b *blitter) release() {
565566 }
566567}
567568
568- func createColorPrograms (b driver.Device , vsSrc shader.Sources , fsSrc [3 ]shader.Sources , uniforms [3 ]interface {} ) (pipelines [2 ][3 ]* pipeline , err error ) {
569+ func createColorPrograms (b driver.Device , vsSrc shader.Sources , fsSrc [3 ]shader.Sources , uniforms [3 ]any ) (pipelines [2 ][3 ]* pipeline , err error ) {
569570 defer func () {
570571 if err != nil {
571572 for _ , p := range pipelines {
@@ -822,7 +823,7 @@ func (r *renderer) packLayers(layers []opacityLayer) []opacityLayer {
822823 layers [l .parent ].clip = b .Union (l .clip )
823824 }
824825 if l .clip .Empty () {
825- layers = append (layers [: i ], layers [ i + 1 :] ... )
826+ layers = slices . Delete (layers , i , i + 1 )
826827 }
827828 }
828829 // Pack layers.
@@ -1316,7 +1317,7 @@ func (b *blitter) blit(mat materialType, fbo bool, col f32color.RGBA, col1, col2
13161317
13171318// newUniformBuffer creates a new GPU uniform buffer backed by the
13181319// structure uniformBlock points to.
1319- func newUniformBuffer (b driver.Device , uniformBlock interface {} ) * uniformBuffer {
1320+ func newUniformBuffer (b driver.Device , uniformBlock any ) * uniformBuffer {
13201321 ref := reflect .ValueOf (uniformBlock )
13211322 // Determine the size of the uniforms structure, *uniforms.
13221323 size := ref .Elem ().Type ().Size ()
0 commit comments