Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/mobile: glimage transparent blend disabled on iOS or OS-X #13509

Closed
nobonobo opened this issue Dec 6, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@nobonobo
Copy link

commented Dec 6, 2015

  • golang 1.5.2
  • OS-X 10.10 or iOS 9.1

expect:
gopher-expect

instead:
gopher-instead

iOS & OS-X default BLEND mode disabled.
patch for enable BLEND-mode

diff --git a/exp/gl/glutil/glimage.go b/exp/gl/glutil/glimage.go
index 497fd89..e8c6b5b 100644
--- a/exp/gl/glutil/glimage.go
+++ b/exp/gl/glutil/glimage.go
@@ -279,11 +279,12 @@ func (img *Image) Draw(sz size.Event, topLeft, topRight, bottomLeft geom.Point,
        glctx.BindBuffer(gl.ARRAY_BUFFER, glimage.quadXY)
        glctx.EnableVertexAttribArray(glimage.pos)
        glctx.VertexAttribPointer(glimage.pos, 2, gl.FLOAT, false, 0, 0)

        glctx.BindBuffer(gl.ARRAY_BUFFER, glimage.quadUV)
        glctx.EnableVertexAttribArray(glimage.inUV)
        glctx.VertexAttribPointer(glimage.inUV, 2, gl.FLOAT, false, 0, 0)

+       glctx.Enable(gl.BLEND)
+       glctx.BlendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)
+
        glctx.DrawArrays(gl.TRIANGLE_STRIP, 0, 4)

        glctx.DisableVertexAttribArray(glimage.pos)

@nobonobo nobonobo changed the title x/mobile glimage transparent blend disabled on iOS or OS-X x/mobile: glimage transparent blend disabled on iOS or OS-X Dec 6, 2015

@nobonobo

This comment has been minimized.

Copy link
Author

commented Dec 7, 2015

I must was write these code in the application layer.

@nobonobo nobonobo closed this Dec 7, 2015

@golang golang locked and limited conversation to collaborators Dec 14, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.