From 7d0fc7ceb885fc3cb33280e1fd3a0d573cc72ffa Mon Sep 17 00:00:00 2001 From: Thomas Friedel Date: Wed, 24 Apr 2019 12:35:11 +0200 Subject: [PATCH] regenerated --- backend/xmobile/clip.go | 4 +--- backend/xmobile/fill.go | 1 + backend/xmobile/xmobile.go | 8 +------- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/backend/xmobile/clip.go b/backend/xmobile/clip.go index 9e48578..67979eb 100755 --- a/backend/xmobile/clip.go +++ b/backend/xmobile/clip.go @@ -7,7 +7,6 @@ import ( ) func (b *XMobileBackend) ClearClip() { - b.curClip = nil b.activate() b.glctx.StencilMask(0xFF) @@ -15,9 +14,7 @@ func (b *XMobileBackend) ClearClip() { } func (b *XMobileBackend) Clip(pts [][2]float64) { - b.curClip = nil b.activate() - b.curClip = pts b.ptsBuf = b.ptsBuf[:0] b.ptsBuf = append(b.ptsBuf, @@ -41,6 +38,7 @@ func (b *XMobileBackend) Clip(pts [][2]float64) { b.glctx.UseProgram(b.sr.ID) b.glctx.Uniform4f(b.sr.Color, 1, 1, 1, 1) b.glctx.Uniform2f(b.sr.CanvasSize, float32(b.fw), float32(b.fh)) + b.glctx.Uniform1f(b.sr.GlobalAlpha, 1) b.glctx.EnableVertexAttribArray(b.sr.Vertex) b.glctx.ColorMask(false, false, false, false) diff --git a/backend/xmobile/fill.go b/backend/xmobile/fill.go index bbd645f..fe7a217 100755 --- a/backend/xmobile/fill.go +++ b/backend/xmobile/fill.go @@ -115,6 +115,7 @@ func (b *XMobileBackend) Fill(style *backendbase.FillStyle, pts [][2]float64) { b.glctx.UseProgram(b.sr.ID) b.glctx.Uniform4f(b.sr.Color, 0, 0, 0, 0) b.glctx.Uniform2f(b.sr.CanvasSize, float32(b.fw), float32(b.fh)) + b.glctx.Uniform1f(b.sr.GlobalAlpha, 1) b.glctx.EnableVertexAttribArray(b.sr.Vertex) b.glctx.VertexAttribPointer(b.sr.Vertex, 2, gl.FLOAT, false, 0, 0) diff --git a/backend/xmobile/xmobile.go b/backend/xmobile/xmobile.go index ea339db..35424d7 100755 --- a/backend/xmobile/xmobile.go +++ b/backend/xmobile/xmobile.go @@ -211,8 +211,6 @@ type XMobileBackend struct { *GLContext - curClip [][2]float64 - activateFn func() disableTextureRenderTarget func() } @@ -241,11 +239,7 @@ func New(x, y, w, h int, ctx *GLContext) (*XMobileBackend, error) { b.activateFn = func() { b.glctx.BindFramebuffer(gl.FRAMEBUFFER, gl.Framebuffer{Value: 0}) b.glctx.Viewport(b.x, b.y, b.w, b.h) - b.glctx.Clear(gl.STENCIL_BUFFER_BIT) - if c := b.curClip; c != nil { - b.curClip = nil - b.Clip(c) - } + // todo reapply clipping since another application may have used the stencil buffer } b.disableTextureRenderTarget = func() { b.glctx.BindFramebuffer(gl.FRAMEBUFFER, gl.Framebuffer{Value: 0})