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
Timm Bäder
4cf2a482ea
gl: Add glyph cache
...
Based on the one used by the vulkan renderer
2017-12-21 19:12:30 +01:00
Timm Bäder
9b400134d5
gl renderer: Remove unused shaders
2017-12-21 19:12:30 +01:00
Timm Bäder
33aa61ef2c
gl renderer: Save clip in every node
2017-12-21 19:12:30 +01:00
Timm Bäder
24e69bb877
gl renderer: Implement rounded clip nodes
...
mostly a proof of concept
2017-12-21 19:12:30 +01:00
Timm Bäder
4aa3f51016
test-render-nodes: Add color matrix test
2017-12-21 18:25:52 +01:00
Timm Bäder
6bce14bee2
Rework the GL renderer
2017-12-21 18:25:52 +01:00
Benjamin Otte
9048d40bc2
vulkan: Fix mask shader to premultiply color
...
The inColor wasn't premultiplied, so the resulting colors were wrong
with translucent borders.
2017-12-02 16:21:58 +01:00
Benjamin Otte
abc8d61730
vulkan: Fix border shader to premultiply color
...
The inColor wasn't premultiplied, so the resulting colors were wrong
with translucent borders.
2017-12-02 16:21:58 +01:00
Benjamin Otte
e1572e003a
vulkan: No need to redefine gl_PerVertex
...
The compiler has those predefined, so use them.
2017-10-24 01:29:28 +02:00
Benjamin Otte
e4dbff6bfc
vulkan: Delete unused shaders
...
These have been renamed to .frag/.vert, apparently the originals weren't
deleted.
2017-10-24 01:29:28 +02:00
Matthias Clasen
b564dd853c
Avoid super-luminous pixels
...
The color-matrix shader was creating pixels with r,g,b > a in
some cases, which leads to unexpected test failures. In particular
this as visible the opacity render node test for opacity 0.
2017-10-19 15:16:54 +02:00
Matthias Clasen
76aa237cce
Fix blendmode shader
...
My reading of the spec formulas was imperfect.
2017-10-08 21:12:22 -04:00
Matthias Clasen
5577fde990
vulkan: Rename blend pipeline to texture
...
This is what it does, and the name blend is easily
confused with blend-mode.
2017-09-29 23:08:09 -04:00
Matthias Clasen
485470511f
vulkan: Update the outset-shadow fragment shaders
...
These were missing the blur-radius parameter that is written
by the vertex shader, causing Vulkan validation to complain.
2017-09-26 18:24:52 -04:00
Matthias Clasen
3c98b90fc6
vulkan: Implement nonseparable blendmodes
...
This is a directly-from-the-spec, unoptimized implementation.
2017-09-23 09:16:58 -04:00
Matthias Clasen
d61f6ff393
vulkan: Implement blend modes
...
This is another example for a 2-texture shader.
So far, only separable blend modes are implemented.
The implementation is not optimized, with an
if-else cascade in the shader.
2017-09-23 01:59:50 -04:00
Matthias Clasen
a75d995bd4
vulkan: Implement crossfade
...
This is the first shader using two textures. It almost works.
2017-09-22 22:16:10 -04:00
Matthias Clasen
9a1460218c
vulkan: Quiet another validation warning
...
It complains if a vertex shader has an out that is not matched
to an in of the fragment shader.
2017-09-21 12:05:00 -04:00
Matthias Clasen
b0e8d8483d
More work on text nodes
...
This commit takes several steps towards rendering text
like we want to.
The creation of the cairo surface and texture is moved
to the backend (in GskVulkanRenderer). We add a mask
shader that is used in the next text pipeline to use
the texture as a mask, like cairo_mask_surface does.
There is a separate color text pipeline that uses the
already existing blend shaders to use the texture as
a source, like cairo_paint does.
The text node api is simplified to have just a single
offset, which determines the left end of the text baseline,
like all our other text drawing APIs.
2017-09-10 14:36:26 -04:00
Patrick Griffis
a55b57caff
build: Improve vulkan resource handling
...
This fixes the proper dependencies getting set up for generating
the shaders and only the necessary things getting rebuilt on
resources changing in gsk.
2017-09-05 15:18:56 -04:00
Matthias Clasen
7bb5b8df0b
A somewhat working blur shader
...
This is a very direct implementation of a Gaussian blur,
without any optimizations.
2017-09-04 23:32:31 -04:00
Matthias Clasen
86c0c243a0
Add rules to regenerate all shader variants
...
We were missing rules to build the clip variants of
the shaders.
2017-09-03 19:58:41 -04:00