Skip to content

Commit

Permalink
Rename to single channel for the shaders too.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cedric BAIL committed Feb 17, 2023
1 parent 8136be1 commit d90341e
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
8 changes: 4 additions & 4 deletions internal/painter/gl/draw.go
Expand Up @@ -235,15 +235,15 @@ func (p *painter) drawSingleChannelTexture(o fyne.CanvasObject, creator func(can
}

points := p.rectCoords(size, pos, frame, canvas.ImageFillStretch, 0, pad)
p.ctx.UseProgram(p.grayProgram)
p.ctx.UseProgram(p.singleChannelProgram)
vbo := p.createBuffer(points)
p.defineVertexArray(p.grayProgram, "vert", 3, 5, 0)
p.defineVertexArray(p.grayProgram, "vertTexCoord", 2, 5, 3)
p.defineVertexArray(p.singleChannelProgram, "vert", 3, 5, 0)
p.defineVertexArray(p.singleChannelProgram, "vertTexCoord", 2, 5, 3)

p.ctx.BlendFunc(srcAlpha, oneMinusSrcAlpha)
p.logError()

shaderColor := p.ctx.GetUniformLocation(p.grayProgram, "color")
shaderColor := p.ctx.GetUniformLocation(p.singleChannelProgram, "color")
r, g, b, a := getFragmentColor(c)
p.ctx.Uniform4f(shaderColor, r, g, b, a)

Expand Down
2 changes: 1 addition & 1 deletion internal/painter/gl/gl_core.go
Expand Up @@ -74,7 +74,7 @@ func (p *painter) Init() {
gl.Enable(gl.BLEND)
p.logError()
p.program = p.createProgram("simple")
p.grayProgram = p.createProgram("gray")
p.singleChannelProgram = p.createProgram("single_channel")
p.lineProgram = p.createProgram("line")
p.rectangleProgram = p.createProgram("rectangle")
p.roundRectangleProgram = p.createProgram("round_rectangle")
Expand Down
2 changes: 1 addition & 1 deletion internal/painter/gl/gl_es.go
Expand Up @@ -81,7 +81,7 @@ func (p *painter) Init() {
gl.Enable(gl.BLEND)
p.logError()
p.program = p.createProgram("simple_es")
p.grayProgram = p.createProgram("gray_es")
p.singleChannelProgram = p.createProgram("single_channel_es")
p.lineProgram = p.createProgram("line_es")
p.rectangleProgram = p.createProgram("rectangle_es")
p.roundRectangleProgram = p.createProgram("round_rectangle_es")
Expand Down
2 changes: 1 addition & 1 deletion internal/painter/gl/gl_gomobile.go
Expand Up @@ -71,7 +71,7 @@ func (p *painter) Init() {
p.glctx().Disable(gl.DepthTest)
p.glctx().Enable(gl.Blend)
p.program = p.createProgram("simple_es")
p.grayProgram = p.createProgram("gray_es")
p.singleChannelProgram = p.createProgram("single_channel_es")
p.lineProgram = p.createProgram("line_es")
p.rectangleProgram = p.createProgram("rectangle_es")
p.roundRectangleProgram = p.createProgram("round_rectangle_es")
Expand Down
2 changes: 1 addition & 1 deletion internal/painter/gl/gl_goxjs.go
Expand Up @@ -66,7 +66,7 @@ func (p *painter) Init() {
gl.Enable(gl.BLEND)
p.logError()
p.program = p.createProgram("simple_es")
p.grayProgram = p.createProgram("gray_es")
p.singleChannelProgram = p.createProgram("single_channel_es")
p.lineProgram = p.createProgram("line_es")
p.rectangleProgram = p.createProgram("rectangle_es")
p.roundRectangleProgram = p.createProgram("round_rectangle_es")
Expand Down
10 changes: 5 additions & 5 deletions internal/painter/gl/painter.go
Expand Up @@ -20,10 +20,10 @@ func shaderSourceNamed(name string) ([]byte, []byte) {
return shaderSimpleVert.StaticContent, shaderSimpleFrag.StaticContent
case "simple_es":
return shaderSimpleesVert.StaticContent, shaderSimpleesFrag.StaticContent
case "gray":
return shaderSimpleVert.StaticContent, shaderGrayFrag.StaticContent
case "gray_es":
return shaderSimpleesVert.StaticContent, shaderGrayesFrag.StaticContent
case "single_channel":
return shaderSimpleVert.StaticContent, shaderSinglechannelFrag.StaticContent
case "single_channel_es":
return shaderSimpleesVert.StaticContent, shaderSinglechannelesFrag.StaticContent
case "rectangle":
return shaderRectangleVert.StaticContent, shaderRectangleFrag.StaticContent
case "round_rectangle":
Expand Down Expand Up @@ -71,7 +71,7 @@ type painter struct {
ctx context
contextProvider driver.WithContext
program Program
grayProgram Program
singleChannelProgram Program
lineProgram Program
rectangleProgram Program
roundRectangleProgram Program
Expand Down
20 changes: 10 additions & 10 deletions internal/painter/gl/shaders.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.

0 comments on commit d90341e

Please sign in to comment.