Emmanuele Bassi
042a5736fa
Merge branch 'share-gl-programs' into 'master'
...
GskGLRenderer: Share programs between different renderers in same display
See merge request GNOME/gtk!1413
2020-02-11 16:30:16 +00:00
Matthias Clasen
720e48ec51
Merge branch 'handle-max-texture-size' into 'master'
...
gl: Don't require too large texture for offsreen ops
See merge request GNOME/gtk!1411
2020-02-11 16:23:02 +00:00
Matthias Clasen
9d0393d8e6
Merge branch 'fix-angle-normalization' into 'master'
...
gsk: Fix angle normalization
See merge request GNOME/gtk!1409
2020-02-11 16:17:14 +00:00
Alexander Larsson
7b0b3d9547
GskGLRenderer: Share programs between different renderers in same display
...
This is similar to how we share texture atlases. Some added complexity
in that the program state also needed to be shared, so it had to move to
the shared Programs object.
With this change realization of additional GskRenderers when opening
popups went from ~60msec to ~35 msec on average.
2020-02-11 16:58:45 +01:00
Emmanuele Bassi
0df542e494
Declare global counters only in debug builds
2020-02-11 14:47:22 +00:00
Emmanuele Bassi
47c44644b1
Silence compiler warnings in non-debug builds
2020-02-11 14:47:22 +00:00
Alexander Larsson
1f0438e7fe
gsk: Fix angle normalization
...
I was getting assertions that normalize_angle() failed the
result < 260 check. Doing some research on this it turns out
to be a precision issue. If the incomming angle is very slightly
below zero, then adding 360 to it may end up with exactly 360.
I simplified the code a bit to avoid division and rounding, because in
practice most angles will be "just outside" the 0-360 degree anyway.
And i also added a workaround for the "result is 360" case by just
setting it to 0.
2020-02-11 13:51:06 +01:00
Alexander Larsson
8fdb710c0f
gl: Don't require too large texture for offsreen ops
...
When rendering ops to an offscreen texture we take max-texture-size
in consideration and modify the scale we use such that the required
texture does not exceed the limit.
This means some rendering will be blocky/fuzzy, but that is better
than it being clipped.
2020-02-11 13:50:35 +01:00
Matthias Clasen
0e15032635
gsk: Small documentation additions
2020-02-08 19:36:25 -05:00
Timm Bäder
8388791f87
GskTransform: Remove useless fmod check
...
All angles are in the [0; 360[ range
2020-02-07 13:16:32 -05:00
Timm Bäder
cbb05a3eab
GskTransform: add assertions to make normalize_angle() intentions clear
...
360deg should be expressed as 0deg and no angle should ever be
negative.
2020-02-07 13:16:32 -05:00
Timm Bäder
75ef8d8a50
GskRoundedRect: Inline graphene_rect_contains_rect
...
Brings gsk_rounded_rect_contains_rect down from 0.54% to 0.14% when
rendering rounded backgrounds.
2020-02-07 13:16:32 -05:00
Benjamin Otte
7e8d8218b9
Revert "Break out cairo color matrix recoloring to gdk_cairo_image_surface_recolor()"
...
We're not in the business of adding Cairo APIs. That's Cairo's job.
Also, we don't need this API anywhere like the original commit claimed,
so there's no need to make it available in any way.
This reverts commit afa6cc2369
.
2020-02-04 16:43:59 +01:00
Alexander Larsson
afa6cc2369
Break out cairo color matrix recoloring to gdk_cairo_image_surface_recolor()
...
This is useful in some parts of the icon theme APIs.
2020-01-29 19:06:16 +01:00
Timm Bäder
05b9a99661
gsk: Remove some unused defines
...
These are from the GVariant days of render nodes.
2020-01-26 18:21:07 +01:00
Timm Bäder
77e0d360ed
Add pure and const annotations to various functions
2020-01-26 18:21:07 +01:00
Timm Bäder
f62535affc
gl renderer: Avoid some work when rendering border nodes
2020-01-26 18:21:07 +01:00
Matthias Clasen
a297129685
Add a profiler mark around renderer realization
...
This takes time that is worth calling out.
2020-01-25 01:28:24 -05:00
Timm Bäder
f80a341b4f
gl renderer: handle cross-fade nodes with invisible children
2020-01-24 06:19:16 +01:00
Timm Bäder
77f8245c0c
gl renderer: Handle blur nodes with invisible children
2020-01-24 06:19:16 +01:00
Timm Bäder
8afdbd6ee3
gl renderer: Make render_rounded_clip_node clearer
2020-01-24 06:19:16 +01:00
Timm Bäder
ab0869ecbc
gl renderer: Add builder offset correctly for non-affine modelviews
2020-01-24 06:19:16 +01:00
Timm Bäder
cff8304133
GskTransform: Add gsk_transform_transform_point()
...
Equivalent of gsk_transform_transform_bounds() and
graphene_matrix_transform_point() respectively.
2020-01-24 06:19:12 +01:00
Timm Bäder
962e38c5c9
gl renderer: Shorten shaders a bit
2020-01-24 06:08:39 +01:00
Timm Bäder
685288216f
gl renderer: Move rect transformation to the vertex shader
...
No need to do this for every fragment.
2020-01-24 06:08:39 +01:00
Timm Bäder
c8fa1f19db
gl renderer: Transform rounded rect on the GPU
...
Change the RoundedRect struct we use in our shaders so we can transform
it using (affine) matrices.
2020-01-24 06:08:39 +01:00
Matthias Clasen
1565f597c8
gl: Disambiguate profiler marks
...
"render" was used for both GL and widgets. Oops.
2020-01-22 16:37:48 -05:00
Timm Bäder
433c8307b2
gl renderer: Pull a local variable in the closest scope
2020-01-18 08:49:52 +01:00
Timm Bäder
dc8dedce07
gl renderer: Draw outset shadows white
...
and only apply the actual shadow color when we draw them from the
texture. This way we can reuse the cached shadows during color
transitions.
2020-01-18 08:49:52 +01:00
Timm Bäder
3091679ffa
gl renderer: Render simple border nodes in a simple way
...
Roughly 80% of the border nodes are just one color and have the same
width on all sides, so we can draw them by uploading just one rect and
not four.
2020-01-18 08:49:52 +01:00
Timm Bäder
afa991752c
gl renderer: Look at shadow color in the outset shadow cache
...
It would probably be better to not do this and always render the outline
in plain white, then later recolor it but do this for no, just for
correctness.
2020-01-18 08:49:51 +01:00
Chun-wei Fan
a9b1d4a389
build: Check for sincosf()
...
sincosf() is really a GCC-specific function that may more may not be
supported on non-GCC compilers, so we want to check for it, otherwise we
use a fallback implementation, not unlike the one in
demos/gtk-demo/gtkgears.c.
2020-01-08 17:15:29 +08:00
Timm Bäder
ea810f176b
gl renderer: Handle repeat nodes with invisible children
...
We can handle this pretty easily by normally drawing the other
(visible) child node, if any.
2020-01-07 17:27:19 +01:00
Timm Bäder
7669e6e42e
transform: Properly compare scale transforms
...
If the epsilon we use there is too much, we can run into rendering
errors because the GPU will use the actual scale value.
2020-01-07 17:27:19 +01:00
Timm Bäder
6ba6f361be
gltextureatlas: Packing must succeed here
2020-01-07 17:27:18 +01:00
Timm Bäder
7a27122dab
transform: Scale+translate bounds directyl
...
Make these two code paths look the same.
2020-01-07 17:27:18 +01:00
Timm Bäder
ca4ae81170
transform: Compare class before ->next
2020-01-07 17:27:18 +01:00
Timm Bäder
76795ffba9
gl renderer: Sprinkle some const around
2020-01-07 17:27:18 +01:00
Timm Bäder
eebe67cf0a
gl renderer: Add util to load vertex data with texture region
2020-01-07 17:27:18 +01:00
Timm Bäder
b9726901a5
gl renderer: Fix inverted dy in inset shadows
2020-01-07 17:27:17 +01:00
Timm Bäder
8b1af398a0
gl renderer: Avoid another manual rounded rect transform
...
We have transform_rect() for this now.
2020-01-07 17:27:17 +01:00
Timm Bäder
b8d1c3ab55
gl renderer: Don't force repeat node child offscreen
2020-01-07 17:27:17 +01:00
Timm Bäder
054d69aaf9
gl renderer: Fix a misleading comment
2020-01-07 17:27:17 +01:00
Timm Bäder
1dea6d4fc7
gl renderer: Speed up bounds transformation
...
We started saving the scale of the current modelview directly in the
RenderOpBuilder, so we don't need to poke the modelview stack anymore.
2020-01-07 17:27:17 +01:00
Timm Bäder
022d19a4c6
gl renderer: Add debug code for color nodes
2020-01-07 17:27:17 +01:00
Timm Bäder
ef7276c398
gl renderer: Trivial variable reordering
2020-01-07 17:27:17 +01:00
Timm Bäder
0a8ca49b5e
gl renderer: transform border outline like everything else
2020-01-07 17:27:17 +01:00
Timm Bäder
74f18f71d3
gl renderer: Move work to the blur vertex shader
2020-01-07 17:27:17 +01:00
Timm Bäder
c0d4a6fc81
gl renderer: Avoid copying a matrix
2020-01-07 17:27:17 +01:00
Timm Bäder
766d4dff76
GskTransform: Compute sin/deg of 90deg rotations manually
...
Otherwise we might end up with inaccuracies, e.g. when
gsk_transform_transform_bounds()'ing bounds.
2020-01-07 17:27:17 +01:00
Timm Bäder
e62f135c6a
GskTransform: Normalize angles
...
Make sure all angles are in the [0..365) range
2020-01-07 17:27:17 +01:00
Timm Bäder
587bc82c37
gl renderer: Print debug node message
2020-01-07 17:27:17 +01:00
Timm Bäder
750dc8dbe2
gl driver: Inline function into only caller
2020-01-07 17:27:17 +01:00
Timm Bäder
cb2f523994
rendernodes: Use floats for everything
2020-01-07 17:27:16 +01:00
Timm Bäder
db91b6dc61
gl renderer: Load vertex data directly into vertices GArray
2020-01-07 17:27:16 +01:00
Timm Bäder
44ac2d5abb
gl renderer: Pass linear gradient stops to shaders directly
...
No need to copy them into the render ops like this.
2020-01-07 17:27:16 +01:00
Timm Bäder
d7df56b6cb
gsk: Make GskColorStop.offset a float
...
Doesn't make sense for this to be double if everything else is float.
Also makes it possible to 'easily' pass this to the GPU.
2020-01-07 17:27:16 +01:00
Timm Bäder
b8aa51d522
gl renderer: Move more work to the vertex shaders
2020-01-07 17:27:16 +01:00
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
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
ecc40cf115
rendernodeparser: Only report a GError* if we have one
2019-11-19 09:37:26 +01:00
Timm Bäder
3d7817154c
rendernodeparser: Handle resolving NULL urls
2019-11-19 09:37:03 +01:00
Matthias Clasen
8ccf2a722a
gsk: Stop using deprecated pango api
...
Shape engines are not used anymore.
2019-11-01 13:01:54 -04:00
Matthias Clasen
d4c97ea2b4
gl: Use the fallback debug flag
...
This debug flag was unused; use it to enable
fallback highlighting at runtime.
2019-10-30 22:31:47 -04:00
Matthias Clasen
5b508ea94a
Revert "gl: Speed up icon cache lookups"
...
This reverts commit dd5ee87b5b
.
2019-10-22 07:16:41 -04:00
Matthias Clasen
472d8eebbe
gl: Avoid pointless iteration
2019-10-22 07:16:41 -04:00
Matthias Clasen
dd316c8051
gl: Add some comments
2019-10-22 07:16:41 -04:00
Matthias Clasen
1038bc781a
Revert "Cache glyph textures in render nodes"
...
This reverts commit c5af463843
.
2019-10-22 07:16:41 -04:00
Matthias Clasen
d3431f569c
Revert "inspector: Fix node recording"
...
This reverts commit ba7649b388
.
2019-10-22 01:32:51 -04:00
Matthias Clasen
ba7649b388
inspector: Fix node recording
...
When attaching renderer-specific data, we need to
make sure that we key it off the renderer that is
in use, and cope with the absence of render data.
This fixes recording nodes in the inspector.
2019-10-18 09:33:45 -05:00
Matthias Clasen
fdbb925654
gl: Remove an unimplemented profiler counter
2019-10-17 07:59:34 -05:00
Matthias Clasen
aeabe3c40e
gl: Add debug spew to texture atlas
2019-10-17 07:59:34 -05:00
Matthias Clasen
222b6c2b58
glyph cache: Go back to memcmp
...
Be careful to avoid padding data, and only
compare the relevant parts, leaving out the
hash key.
2019-10-17 07:59:34 -05:00
Matthias Clasen
5ab5ff7677
Cosmetics
2019-10-17 07:59:34 -05:00
Matthias Clasen
6c92b824f3
Merge branch 'wip/chergert/opbuffer' into 'master'
...
Add OpBuffer helper for building op buffer
See merge request GNOME/gtk!1131
2019-10-17 11:37:07 +00:00
Matthias Clasen
d777300d4e
Fix a crash with glyph caching
...
We need to treat atlas-less cached glyphs like
atlases, when it comes to invalidating text node
render data.
2019-10-15 22:52:28 -04:00
Matthias Clasen
173bb2e1e8
gsk: Fix uninitialized memory
...
This was causing crashes in some circumstances.
2019-10-15 20:54:24 -04:00
Matthias Clasen
dd5ee87b5b
gl: Speed up icon cache lookups
...
Use gdk_texture_set_render_data to avoid
hash table lookups when we can.
2019-10-15 19:44:26 -04:00
Matthias Clasen
e34d1b8a26
gl: Slightly rework the icon cache api
...
Return a pointer to the IconData struct. This is
closer to the glyph cache api, and will allow us
to add similar shortcuts. For now, just store
texture coords in the form we need, avoiding
converting them over and over.
2019-10-15 19:44:26 -04:00
Matthias Clasen
c5af463843
Cache glyph textures in render nodes
...
This is a quick implementation that avoids many
glyph cache lookups. We keep an array of direct
pointers in the text render node, and throw those
cached pointers away whenever any atlases have
been dropped (since that may invalidate the cached
glyphs).
2019-10-15 19:44:26 -04:00
Matthias Clasen
49748c9c23
Some more vertex data reshuffling
...
In some cases, the vertex data is just a trivial
modification of the default data, so do that instead
of recalculating it.
2019-10-15 19:44:26 -04:00
Matthias Clasen
b53fa48794
Fix load_vertex_data
...
There was a copy-paste error that set all
uv coordinates to 0,0.
2019-10-15 19:44:26 -04:00
Christian Hergert
97f3371709
gl: avoid calculating vertex_data until necessary
...
In many cases of the switch, we do not need the vertex data. This moves
the creation of the vertex_data array into a secondary function and only
calculates it the cases for which it is required.
2019-10-15 19:44:26 -04:00
Matthias Clasen
58d57e1087
gl: Drop buffer_size
...
No need to maintain buffer_size separately.
It is always vertices->len * sizeof (GskQuadVertex).
2019-10-15 19:44:26 -04:00
Matthias Clasen
571068af12
Drop OP_CHANGE_VAO
...
Instead, we accumulate vertices in a separate
array, which simplifies various things and lets
us avoid the extra copying step for the vao.
2019-10-15 19:44:26 -04:00
Christian Hergert
a00d12c62a
prototype OpBuffer helper for building op buffer
2019-10-15 19:44:26 -04:00
Timm Bäder
5ea21f7910
gl renderer: Fix an out of bounds read
...
Fixes #2200
2019-10-15 07:13:14 +02:00
Matthias Clasen
7bff3abe8e
glyph cache: Fix handling of big glyphs
...
We were putting big glyphs in the cache, in their
own texture, but forgetting to mark the texture
as permanent, so it could be reused, leading to
occasional misrendering. Fix this by marking these
textures as permanent, and explicitly freeing them
when the cache entry gets old.
2019-10-12 18:53:22 -04:00
Matthias Clasen
e46a7ca706
shadow cache: Remove outdated comments
...
No comments are better than outdated comments.
2019-10-12 17:06:39 -04:00
Matthias Clasen
e9ba7eda47
gl: Increate the cache check frequency
...
Otherwise, we spread the cache over more atlases
than necessary, increasing the amount of texture
changes in each frame.
2019-10-12 12:37:11 -04:00
Matthias Clasen
88649b6aae
gl: Interleave cache aging
...
Every few frames, we do extra work for the
cache aging. Arrange for the glyph and icon
caches to not cause extra work on the same
frame, to smooth things out.
2019-10-12 12:37:11 -04:00
Matthias Clasen
60d63bbada
gl: Improve debug spew for caches
...
Dump similar information for both caches,
and correct the unused percentage for
the atlases.
2019-10-12 12:37:11 -04:00
Matthias Clasen
123cbd42bb
gl: Make icon cache work like glyph cache
...
Replace timestamp tracking with an accessed bit
here too, to keep the glyph and icon cache code
similar.
2019-10-12 11:46:10 -04:00
Matthias Clasen
977ac2b31f
gl: Do less work on glyph caching
...
There is no need for us to be very precise about
aging the glyph entries. It is enough to check
occasionally and mark old entries. This reduces
the overhead of work we do every frame on the
caches, at the cost of letting glyphs linger
a bit longer in the cache.
2019-10-12 11:35:46 -04:00
Timm Bäder
bcdc3b706c
iconcache: Fix icon padding
2019-10-12 09:17:24 +02:00
Matthias Clasen
61db797f29
gl: Simplify glyph cache lookup
...
Make this function more similar to the icon
cache equivalent, and simplify it a bit. We
don't use the boolean return, and we don't need
to look at the age of entry when marking it
used.
2019-10-12 01:35:13 -04:00
Matthias Clasen
0a876f11a0
gl: Don't use memcmp for comparing cache keys
...
Some innocent change made us use a stack-allocated
key, and things broke. Lets go back to comparing
cache keys field by field.
2019-10-12 01:00:08 -04:00
Matthias Clasen
1c17316f9c
gl: Handle row stride for icon cache upload
...
Same as the previous commit: Downloading a texture
may in theory give us data with a stride, so handle
that.
2019-10-11 21:17:30 -04:00
Matthias Clasen
646c5f369f
gl: Handle row stride for glyph cache upload
...
In theory, we can have data with a stride here,
so set the necessary parameters to tell GL about
it.
2019-10-11 21:16:40 -04:00
Matthias Clasen
8839e10d44
gl: Do less work to maintain caches
...
Remember which atlases were removed, and only
check those when looking for icons or glyphs
to remove. For most frames, we don't have to
check at all since no atlases were removed.
2019-10-11 20:42:24 -04:00
Matthias Clasen
9b61bfb3c8
gl: Speed up icon caching
...
Avoid expensive padding, and just upload the
image in several slices.
2019-10-11 19:36:26 -04:00