Alexander Larsson
4f7171885f
GskGLRenderer: Label various gl objects
...
This means the names are more useful in tools like renderdoc.
2019-04-25 11:35:00 +02:00
Timm Bäder
e13d242320
gl renderer: Keep op builder around
...
GL keeps the unoform state per-program, but not per-frame. So, we can't
pretend that this works for us. Keep the RenderOpBuilder around for the
entire lifetime of the renderer instead.
2019-04-24 17:55:14 +02:00
Timm Bäder
91bbe6ef95
gl renderer: Sync gpu and cpu default alpha value
...
Otherwise we might end up not passing the new value to the GPU.
2019-04-24 13:29:45 +02:00
Timm Bäder
cc878ec00f
gl renderer: begin/end_frame around do_render
...
This fixes rendering to a texture on intel hardware. The glClear calls
would throw a GL_FRAMEBUFFER_INCOMPLETE error here, because the
gsk_gl_driver_begin_frame() call in do_render() reset the framebuffer
object in use.
2019-04-23 17:09:14 +02:00
Timm Bäder
3569348f9c
gl renderer: Declare color matrix child separately
...
Otherwise I'm doing this all the time when debugging.
2019-04-13 06:00:02 +02:00
Timm Bäder
0245ac2106
gl renderer: Apply transform only for final texture drawing
...
We don't want the new transform while drawing things on a texture.
Instead, only apply the new transform matrix when adding the final
texture drawing ops.
This fixes the stack cube rotation transition to at least look somewhat
better.
2019-03-31 06:16:16 +02:00
Timm Bäder
b2089b89cc
gl renderer: Add debug code to dump framebuffer
...
This way we can specify it on specific add_offscreen_ops callsites.
2019-03-31 06:14:41 +02:00
Timm Bäder
9105de9170
gl renderer: Cache rendered fallback nodes
2019-03-06 06:31:25 +01:00
Benjamin Otte
bd113aa85c
transform: Redo querying API
...
Make the API expect a tranform of the proper category instead of
doing the check ourselves and returning TRUE/FALSE.
The benefit is that the mai use case is switch (transform->category)
statements and in those we know the category and don't need to check
TRUE/FALSE.
Using the wrong matrix will now cause a g_warning().
2019-03-04 23:41:51 +01:00
Benjamin Otte
3cc84d2860
transform: Make category public API
...
Also rename it from GskMatrixCategory to GskTransformCategory.
2019-03-04 23:15:24 +01:00
Benjamin Otte
3a3c2d14ab
rendernode: Make the transform node take a GskTransform
...
This is an attempt to push GskTransform deeper into the stack.
2019-03-04 23:15:07 +01:00
Timm Bäder
416a4cf5ea
gl renderer: Ignore nodes with nan bounds
...
This can happen for certain transform nodes. The transform node's
child's bounds are fine, but the transform node bounds are all nan.
Just ignore those bounds since we can't meaningfully render them anyway.
2019-02-28 07:22:34 +01:00
Timm Bäder
5577e30ad4
gl renderer: Add more nodes that support transforms
2019-02-28 07:22:34 +01:00
Timm Bäder
e836c575ce
gl renderer: Remove GskRoundedRect initializaion
2019-02-25 08:46:27 +01:00
Timm Bäder
47fb1ec4c4
gl renderer: Partially implement rounded rect intersection
...
Some rounded rect intersections can actually be done and even expressed
as a single rounded rectangle.
2019-02-25 08:46:27 +01:00
Timm Bäder
f0624266dc
gl renderer: Add debug function to dump render node
2019-02-25 08:46:27 +01:00
Timm Bäder
58c2bea959
gl renderer: Stop determining the matrix category ourselves
...
Use the category we get from transform nodes and add ops_ API to supply
one when we set a graphene_matrix_t directly.
2019-02-25 08:37:06 +01:00
Timm Bäder
f9041230c6
gl renderer: Round size up when rendering to a texture
...
Both the clip we use and the viewport we set should contain the entire
texture size and not potentially clip the last pixel.
2019-02-23 04:50:25 +01:00
Timm Bäder
da0bd697b8
gl renderer: Use the matrix node category
2019-02-22 19:08:43 +01:00
Benjamin Otte
6a4bf2b993
gsk: Remove offset nodes
...
They were a neat idea while they lasted. But now, it's time for
categorized transform nodes, where matrices with
GSK_MATRIX_CATEGORY_2D_TRANSLATE are the exact replacement.
Renderers have not been adapted for this purpose, so they (continue to)
run slow paths.
2019-02-21 19:47:28 +01:00
Benjamin Otte
359bc7695c
build: Reintroduce warning flags from autotools
...
Some of the flags got lost in the meson transition or were demoted from
error flags to warning flags.
This commit reintroduces them.
It also includes fixes for the code that had warnings with those flags.
The big one being -Wshadow.
2019-01-22 04:33:12 +01:00
Timm Bäder
8e0cbc1c3d
gl renderer: Support (not) resetting the opacity for offscreen nodes
...
We usually want to do that, but it's wrong for e.g. crossfade nodes.
2019-01-18 19:43:54 +01:00
Timm Bäder
59bf76dce1
gl renderer: Force blur shadow node children offscreen
...
This broke the overlay blur demoe when resizing the window to a size
that would completely move the image below a button, causing the
GtkSnapshot code to remove the clip node below the blur node.
2019-01-13 08:41:37 +01:00
Timm Bäder
d55fc8b7b1
gl renderer: Dont't try to draw glyphs at scale 0
...
Fixes #1475
2019-01-10 17:14:48 +01:00
Timm Bäder
fb7d033953
gl renderer: Remove debug code
2019-01-10 16:49:19 +01:00
Timm Bäder
cfa440bbae
gl renderer: Fix hidpi transform nodes
2019-01-10 16:49:19 +01:00
Timm Bäder
b0a8b7da63
gl renderer: Only compile the vertex shader once
...
All our programs use the same vertex shader, so don't compile it over
and over again. This improves startup times by at least 0.001%, I swear.
2019-01-10 16:49:19 +01:00
Timm Bäder
b2ff6e91cd
gl renderer: Don't forget the offset when rendering blur nodes
2019-01-10 16:49:19 +01:00
Timm Bäder
1d3aa9207c
gl renderer: Add a clip stack
...
So we can check that the currently set clip is the first one and now
intersect with it. This first clip is always the entire viewport or the
entire render_area and we don't want to end up drawing things to a
texture because of it.
2018-12-31 12:44:02 +01:00
Timm Bäder
3ce45508e1
gl renderer: Track border width state separately
2018-12-07 16:36:10 +01:00
Timm Bäder
4b3a94f382
gl renderer: Fix remaining TODO about offset nodes
...
All of the nodes should now support offsets.
2018-12-04 06:30:47 +01:00
Timm Bäder
d67dacedba
gl renderer: transform nodes: offset
2018-12-04 06:30:47 +01:00
Timm Bäder
e1feb1b712
gl renderer: Clip nodes: offset
2018-12-04 06:30:47 +01:00
Timm Bäder
e8670c89ae
gl renderer: Linear gradients: offset
2018-12-04 06:30:47 +01:00
Timm Bäder
b4f918904c
gl renderer: Outset shadow nodes: offset
2018-12-04 06:30:47 +01:00
Timm Bäder
aead150ce2
gl renderer: Care about offset when rendering border nodes
2018-12-04 06:30:47 +01:00
Timm Bäder
fd47e57e4b
gl renderer: care about offset when rendering shadow nodes
2018-12-04 06:30:47 +01:00
Timm Bäder
2b95a5daee
gl renderer: Remove blend shader
...
It's unused.
2018-12-02 16:04:40 +01:00
Timm Bäder
0681c5d5bc
gl renderer: Reset opacity when rendering to a texture
...
The opacity will already be applied when rendering the final texture.
2018-12-02 16:03:08 +01:00
Timm Bäder
b19926c079
gl renderer: Add function to draw debug rectangle
2018-12-02 14:31:57 +01:00
Timm Bäder
ad759307f8
gl renderer: Add more node types to print_render_node_tree
...
debugging ++
2018-12-02 13:39:55 +01:00
Timm Bäder
58a4ae94e9
gl renderer: Use ops_transform_bounds_modelview in more places
2018-12-02 13:25:43 +01:00
Timm Bäder
9df9087a13
gl renderer: Add NodeSample
...
As a quick way of checking what a particular sample of nodes (e.g. all
offset node children) are made up of.
2018-12-02 13:25:43 +01:00
Timm Bäder
71512cf9ad
gl renderer: Move geometry calculation further down
...
We don't need it above, so move it to where it belongs.
2018-12-02 13:25:43 +01:00
Timm Bäder
2831dbb110
gl renderer: Refactor add_offscreen_ops
...
Use a graphene_rect_t for the node bounds instead of 4 floats.
This makes it simpler to pass the size in without the offset applied.
2018-12-02 13:25:43 +01:00
Timm Bäder
933acb3682
gl renderer: Add offscreen ops without offset applied
...
When doing color matrix nodes. This fixes color matrix node with scale =
2.
2018-12-02 13:25:43 +01:00
Timm Bäder
574ebafa46
gl renderer: Reset offset when rendering offscreen
...
We want to apply the offset to the rendered texture, not to the
offscreen-rendered content.
2018-12-02 13:25:43 +01:00
Timm Bäder
74dd05b45e
gl renderer: add render ops for dumping the framebuffer
...
So offscreen rendering can be properly debugged.
2018-12-02 13:25:43 +01:00
Timm Bäder
3eb2cef421
gl renderer: Set the render region as initial clip
...
So we avoid creating render ops for things outside of it.
2018-12-02 13:25:43 +01:00
Timm Bäder
5907ff694f
gl renderer: Render non-trivial transforms to a texture
...
This way we can e.g. render rotated clips, borders, etc.
2018-11-29 08:50:18 +01:00