Commit Graph

1098 Commits

Author SHA1 Message Date
Timm Bäder
f79c807645 gl renderer: Don't invert offset value twice 2020-01-07 17:27:16 +01:00
Timm Bäder
d0d2ad9f5b gl renderer: Remove unused variable from shader 2020-01-07 17:27:16 +01:00
Timm Bäder
0b8298038a gl renderer: Move color computation to vertex shader 2020-01-07 17:27:16 +01:00
Timm Bäder
6ef0bb8bea gl renderer: Move final color computation to vertex shader
.. of the coloring program, which is used all the time for text.
2020-01-07 17:27:16 +01:00
Timm Bäder
91472b2ecd gl renderer: Compute final color in vertex shader
This is a very often used shader. No need to to do this for every
fragment.
2020-01-07 17:27:16 +01:00
Timm Bäder
73f2167fe4 gl renderer: Avoid an invalid read
We need to copy the color here, since the program state can live across
frame boundaries.
2020-01-07 17:27:16 +01:00
Timm Bäder
2079c898e7 gl renderer: Remove some unneeded calculations from shaders 2020-01-07 17:27:16 +01:00
Timm Bäder
c79c18f39c gl renderer: Shuffle things around a bit 2020-01-07 17:27:16 +01:00
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
f07397f4dd gl renderer: Upload GL_RGBA texture data in GLES
Colored icons are still broken this way, but at least they show up and
text works.
2020-01-07 17:27:16 +01:00
Timm Bäder
f1751f514c gltextureatlas: Use more correct debug name for texture
These aren't all glyph atlases anymore.
2020-01-07 17:27:16 +01:00
Timm Bäder
8dd7f5aefe gl renderer: Mark beginning of frame if DEBUG_OPS is set 2020-01-07 17:27:16 +01:00
Timm Bäder
398f49ad31 gl renderer: Trivial declaration reorder 2020-01-07 17:27:16 +01:00
Timm Bäder
3d260a950e gl renderer: Remove a few outdated comments 2020-01-07 17:27:16 +01:00
Timm Bäder
f31667f437 gl renderer: Remove unused translation handling 2020-01-07 17:27:15 +01:00
Timm Bäder
219493c818 gl renderer: Don't copy matrix/offset of color matrix nodes into ops 2020-01-07 17:27:15 +01:00
Timm Bäder
06f63764fb gl renderer: Initialize alpha uniform to 1.0
This makes gl-legacy work and gl-gles work except for text and icons.
2020-01-07 17:27:15 +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
d12dde07c3 gl renderer: Fix program uniform updating code
This breaks the initial uniform value, but we will fix that in a later
commit in a different way.
2020-01-07 17:27:15 +01:00
Timm Bäder
5191b6fccd gl renderer: Only send clip corners if we need to
We change the clip bounds a lot more ofthen than the clip corners and
they are already split up in the shader, so only send the corners if we
need to.
2020-01-07 17:27:15 +01:00
Timm Bäder
2e6e6c1779 gl renderer: Fix color comparison 2020-01-07 17:27:15 +01:00
Timm Bäder
a29b8fbef4 gl renderer: Shorten debug output impl
This will leak a string but WHATEVER.
2020-01-07 17:27:15 +01:00
Timm Bäder
5b072e716c gl renderer: Fix debug color output 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
4744bb9099 gl renderer: stop copying current color around
Just use a pointer now.
2020-01-07 17:27:15 +01:00
Timm Bäder
91522dda63 gl renderer: remove a memory leak 2020-01-07 17:27:15 +01:00
Timm Bäder
f85448ffbf gl renderer: Split blurring a node into its own function 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
9d9a730659 gl renderer: Drop a dead if statement
We already handle this earlier.
2020-01-07 17:27:15 +01:00
Timm Bäder
d868b23c76 gl renderer: Implement blurred inset shadow nodes
And with this...

Fixes #1101
2019-12-03 08:40:35 +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
b91913d10d opbuffer: Remove unused op member 2019-12-03 08:40:35 +01:00
Timm Bäder
1854f3f49c gl renderer: Cache current scale in RenderOpBuilder
We call ops_get_scale a lot, so this should be better. It will also make
a later x/y split for the scaling easier.
2019-12-03 08:40:34 +01:00
Timm Bäder
ca66e9788c gl renderer: Save one level of indentation 2019-12-03 08:40:34 +01:00
Timm Bäder
fb5dc73841 gl renderer: Implement blurred shadow nodes 2019-12-03 08:40:34 +01:00
Timm Bäder
8d61d9f627 gl renderer: Take a TextureRegion in blur_texture
So we can refer to textures on a texture atlas.
2019-12-03 08:40:34 +01:00
Timm Bäder
22b6085c32 gl renderer: Scale blur radius
We scale the texture size, so as a consequence we have to scale the blur
radius.
2019-12-03 08:40:34 +01:00
Timm Bäder
2deb1a05a0 gl renderer: Add some often needed debug code 2019-12-03 08:40:34 +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
982890515d gl renderer: Don't use g_assert() for code that should always run
g_assert can be compiled out.
2019-11-27 16:56:47 +01:00
Timm Bäder
1817025f46 gl renderer: Don't save repeat nodes to disk
This is just debuggin code someone forgot.
2019-11-27 16:47:14 +01:00
Emmanuele Bassi
def700739d Use a single compilation symbol
We use a compilation symbol in our build to allow the inclusion of
specific headers while building GTK, to avoid the need to include only
the global header.

Each namespace has its own compilation symbol because we used to have
different libraries, and strict symbol visibility between libraries;
now that we have a single library, and we can use private symbols across
namespaces while building GTK, we should have a single compilation
symbol, and simplify the build rules.
2019-11-27 13:33:43 +00:00
Timm Bäder
8f6de1f955 gl renderer: Load flipped-y offscreen vertex data directly
Instead of loading the unflipped version first and then flipping it.
Don't do it in add_render_ops either but only in the function actually
adding the render ops for the nodes, since those frequently have
early-out conditions that don't need the vertex data at all.
2019-11-26 09:09:25 +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
91f7ac2d58 gl renderer: Care more about 0×0 offscreen nodes
These never result in a rendering of course, but we must make sure not
to create a 0×0 texture for them, since that will cause problems later
on.
2019-11-26 09:09:25 +01:00
Timm Bäder
053360df85 gl renderer: Remove unused function 2019-11-19 11:06:08 +01:00
Timm Bäder
600ce68210 gl renderer: Add a short cut for repeat nodes that don't repeat
These happen and we don't even need to draw the child to a texture.
2019-11-19 10:45:02 +01:00