Commit Graph

111 Commits

Author SHA1 Message Date
Timm Bäder
cef7f7f87d gl renderer: Move work to the gradient vertex shader
No need to do this stuff once per fragment.
2020-01-07 17:27:16 +01:00
Timm Bäder
fdce30d3f8 gl renderer: Add some in/out compat glue to the shaders
so we can use _IN_ and _OUT_ and get the right things for
desktop/es/legacy GL.
2020-01-07 17:27:16 +01:00
Timm Bäder
1243174e53 gl renderer: Make RoundedRect work in gles
Which can't return struct types containing arrays. So let's revert to
the previous version but still send the rect along as a vec4[3];
2020-01-07 17:27:15 +01:00
Timm Bäder
cc909b160f gl renderer: Rewrite shader builder
Use a unified approach to write both vertex and fragment shader in the
same file.
2020-01-07 17:27:15 +01:00
Timm Bäder
49845795d9 gl renderer: Rewort passing rounded rects to shaders 2020-01-07 17:27:15 +01:00
Timm Bäder
ab04c74ec9 gl renderer: Don't copy border outline corner sizes around
We already offset + scale the outline and its corners, just pass those
directly to the shader.
2020-01-07 17:27:15 +01:00
Timm Bäder
d3852ca33a gl renderer: Remove some unused uniforms 2020-01-07 17:27:15 +01:00
Timm Bäder
56b456ff21 gl renderer: Remove unused uniform from inset shadow shader 2019-12-03 08:40:35 +01:00
Timm Bäder
8ca46169b1 gl renderer: Blur shader improvements
Use a two-pass blur shader, fix a few other things and unify the
blurring of blur nodes and blurred outset shadow nodes.

Related to #1283
2019-12-03 08:40:34 +01:00
Timm Bäder
1c2661ed12 gl renderer: Fix repeat node shader once again 2019-11-26 09:09:25 +01:00
Timm Bäder
604f44da11 gl renderer: Fix repeat nodes that don't repeat
Fixes #2234
2019-11-19 10:31:21 +01:00
Timm Bäder
2977e91aed gl renderer: Grow unblurred outset shadow outline on the gpu 2019-10-11 10:16:39 +02:00
Timm Bäder
0b999c73d1 gl renderer: Fix glsl rounded rect shrinking
Previous code would add rounded corners to a rect with all 0 corners
when growing.
2019-10-11 10:15:58 +02:00
Timm Bäder
2914c360a9 gl renderer: Implement a subset of repeat nodes 2019-08-11 09:05:31 +02:00
Elias Aebi
a357995484 glsl: don't use switch statements 2019-07-31 18:48:54 +02:00
Elias Aebi
1e6120e776 glsl: use float literals 2019-07-06 14:42:08 +02:00
Timm Bäder
a2518493a2 gl renderer: Fix color matrix shader
We *just* computed a un-premultiplied color, maybe we should also use
it.
2019-05-18 13:47:59 +02:00
Timm Bäder
4869013a8d gl renderer: Fix coloring shader
We *just* pre-multiplied u_color but then didn't use its rgb values.
This fixes backdrop scale marks in Adwaita to not be white.
2019-05-06 17:58:55 +02:00
Timm Bäder
3e2107846d gl renderer: Fix blend shader 2019-05-06 17:34:48 +02:00
Timm Bäder
c848b9014b gl renderer: Add simple blend node implementation 2019-04-28 07:58:31 +02:00
Timm Bäder
34fcfb154a gl renderer: Properly apply opacity in cross-fade shader 2019-04-24 13:29:45 +02:00
Timm Bäder
2b95a5daee gl renderer: Remove blend shader
It's unused.
2018-12-02 16:04:40 +01:00
Elias Aebi
19873e549a gl: implement clipping for legacy contexts 2018-07-14 14:31:50 +02:00
Elias Aebi
05ca6bc189 gl: fix compilation errors for legacy context shaders 2018-07-14 14:24:21 +02:00
Timm Bäder
eaf899061a gl renderer: Remove shadow program
Drawing shadows is the same task as drawing text in our case and these
two shaders have been the same thing for quite a while.
2018-03-15 18:12:00 +01:00
Timm Bäder
0a7880110e gl renderer: Fix clipped borders
Stop abusing the clip rect for borders.
2018-03-15 18:11:57 +01:00
Timm Bäder
d2b5436462 gl: Make blur nodes with radius ∈ ]0; 1[
Otherwise, the radius here ends up being 0 and we don't draw anything at
all.
2018-02-27 14:22:08 +01:00
Timm Bäder
4946810960 gl renderer: Render unblurred outset shadows differently
We don't need to draw anything to a texure for those.
2018-01-15 10:56:43 +01:00
Timm Bäder
bbf6e81c1f gl renderer: Fix shaders for gles
Remove uniform initializers, add casts to float, etc.
2018-01-08 19:23:06 +01:00
Timm Bäder
cd2a53851b gl: Fix copy&paste error in blur shader 2018-01-08 19:23:06 +01:00
Timm Bäder
3176ae7e51 gl renderer: Use alpha uniform in inset shadow shader 2018-01-08 17:44:33 +01:00
Timm Bäder
f729cbb760 gl renderer: Fix text color pre-multiplication 2018-01-04 12:20:27 +01:00
Timm Bäder
4abbf929ad gl renderer: Remove some unused uniforms from shader 2017-12-29 05:48:42 +01:00
Timm Bäder
2bc10fa365 gl renderer: draw all outset shadows
Instead of falling back to cairo for most of them.
2017-12-29 05:48:40 +01:00
Timm Bäder
7a2d30323e gl renderer: try doing outset box shadows
Still fall back in cases we can't handle that way.
2017-12-21 19:12:33 +01:00
Timm Bäder
d211f42091 gl renderer: Remove unused vertex shader 2017-12-21 19:12:32 +01:00
Timm Bäder
a83037c440 gl renderer: Implement cross fade nodes 2017-12-21 19:12:32 +01:00
Timm Bäder
bed03aa319 gl renderer: Fix linear gradient shader color calculation
This fixes both the wrong headerbar color and the broken border color in
of the circular button in the widget-factory.
2017-12-21 19:12:32 +01:00
Timm Bäder
eb221ff305 gl renderer: Only take glyph texture alpha into account
This way, we can use the very same coloring program to draw text shadows
of fonts with colored glyphs.
2017-12-21 19:12:32 +01:00
Timm Bäder
64400e82b5 gl renderer: Default to 0px clip and border radius
Finally fix the division by 0 in the clip code.
2017-12-21 19:12:32 +01:00
Timm Bäder
2d3e87da46 gl renderer: Try to fix border rendering 2017-12-21 19:12:32 +01:00
Timm Bäder
fd0b7caa7c gl renderer: Fix shadow shader
We need to take the alpha of the shadow color into account as well.
2017-12-21 19:12:32 +01:00
Timm Bäder
3b7cfd068b gl renderer: Implement simple border nodes 2017-12-21 19:12:31 +01:00
Timm Bäder
e95b356465 gl renderer: Implement simple shadow nodes 2017-12-21 19:12:31 +01:00
Timm Bäder
8c9e203458 gl renderer: Fix inset shadow offset calculation 2017-12-21 19:12:31 +01:00
Timm Bäder
47c4bf5be0 gl renderer: Implement unblurred outset shadows 2017-12-21 19:12:31 +01:00
Timm Bäder
5c7838e168 gl renderer: Rework program creation
Make sure all uniform names have to match between the shader names and
the _location integers we save in every Program struct.
2017-12-21 19:12:31 +01:00
Timm Bäder
388157b995 gl renderer: Implement unblurred inset shadows 2017-12-21 19:12:31 +01:00
Timm Bäder
6a1a70c677 gl renderer: Implement blur nodes 2017-12-21 19:12:31 +01:00
Timm Bäder
f4304336ea gl renderer: Don't pass MVP to shaders
We already pass both modelview and projection matrix individually.
2017-12-21 19:12:30 +01:00