Commit Graph

486 Commits

Author SHA1 Message Date
Timm Bäder
358c139a43 gl renderer: Rework once more
Last time, I swear.
2017-12-21 19:12:30 +01:00
Timm Bäder
dd1a9745db gl renderer: Don't initialize modelview matrix twice 2017-12-21 19:12:30 +01:00
Timm Bäder
59a7584386 gl renderer: Group render node types by render item creation 2017-12-21 19:12:30 +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
3e23f6c22b gl renderer: Remove unused member 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
1f5fd4d564 gl renderer: Don't create framebuffer for texture opacity children
Slowly a pattern emerges...
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
cd730ccff5 gl renderer: save on some frame buffers
If the child of a color matrix node is a texture, we can directly use
that instead of drawing it to a texture first and then using that
texture.
2017-12-21 19:12:30 +01:00
Timm Bäder
1d1c6a98ce GskGLDriver: Add profiler
Count the newly created textures, the reused ones and the uploads from
cairo surfaces per frame.
2017-12-21 19:12:30 +01:00
Timm Bäder
ddb77d6c9b GskGLDriver: Use float for texture size in create_texture
Render nodes can end up with bounds < 1 since they are floats, and the
implicit cast to int ends up creating a texture with 0 width or height.
Use ceil() instead in create_texture so we don't have to do that on the
caller side everywhere.
2017-12-21 18:25:52 +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
Timm Bäder
5fa5008ee9 gl renderer: Remove some unused code 2017-12-21 18:25:52 +01:00
Timm Bäder
fe7db31663 gl driver: Make some members const 2017-12-21 18:25:52 +01:00
Timm Bäder
b488329104 GskRenderer: Remove viewport property 2017-12-21 18:25:52 +01:00
Georges Basile Stavracas Neto
8993a51893 vulkan: Destroy buffer before releasing associate memory
Exact same issue as the previous commit.
2017-12-13 23:14:58 -02:00
Georges Basile Stavracas Neto
147a455171 vulkan: Destroy image before releasing associate memory
VkImage contains a reference to the VkDeviceMemory and, because
the current code frees the VkDeviceMemory before destroying the
VkImage that references it, a warning is triggered by the validation
layers.

This is not critical, since we release both resources at the same
place. But the warning triggered by the validation layers sums up
adding 1 MB per second of extra debug logging, making the debugging
process much more painful.

This commit simply swaps the destruction order, and destroys the
VkImage first, then the now unused VkDeviceMemory.
2017-12-13 22:49:16 -02:00
Benjamin Otte
52b1cd40d1 gsk: Remove gsk_render_node_set_scaling_filters()
This is a leftover from the very early rendernode that we forgot to delete.

This can be seen by the fact that it is settable on an immutable object.
2017-12-03 21:57:21 +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
Timm Bäder
34e233e1c3 GskVulkanGlyphCache: Remove unused struct member 2017-12-01 07:30:25 +01:00
Alexander Larsson
521b09cc96 broadway: Send diffs of node trees
Reusing pre-created nodes is a lot faster both in terms of
dom modifications and of transfer sizes.
2017-11-30 21:57:42 +01:00
Matthias Clasen
9b582db492 gsk: Quiet a compiler warning
We insist on handling all cases in a switch, nowadays.
2017-11-24 08:51:22 -05:00
Alexander Larsson
820f999f14 broadway: Disable fallback spew by default 2017-11-23 10:48:29 +01:00
Alexander Larsson
12d3cd8f29 broadway: Handle cairo nodes
This means we can directly upload these as textures, rather than
create a new surface and draw it into that. We still have to upload,
but there isn't a lot we can do about this as for these nodes
we generally redraw everything each time.
2017-11-23 10:48:29 +01:00
Alexander Larsson
4d1eca0d57 broadway: Handle texture gsd nodes 2017-11-23 10:48:29 +01:00
Alexander Larsson
b74959a605 broadway: Add clip node 2017-11-23 10:48:29 +01:00
Alexander Larsson
7a180f554d broadway: Don't log cache hits 2017-11-23 10:48:29 +01:00
Alexander Larsson
0d4a26f148 broadway: Cache color translated textures
These happen a lot due to the recolored symbolics
2017-11-23 10:48:29 +01:00
Alexander Larsson
9e5a22bbe5 broadway: Add opacity node 2017-11-23 10:48:29 +01:00
Alexander Larsson
9b1f6acc2b broadway: Add shadow node 2017-11-23 10:48:29 +01:00
Alexander Larsson
cbbbf49043 broadway: Add node cache for text 2017-11-23 10:48:29 +01:00
Alexander Larsson
278370c8e5 broadway: Add linear gradient node 2017-11-23 10:48:29 +01:00
Alexander Larsson
f7ff6dbb66 broadway: Add RoundedClip node 2017-11-23 10:48:29 +01:00
Alexander Larsson
0083c084e4 broadway: Add inset shadow 2017-11-23 10:48:29 +01:00
Alexander Larsson
35ceb8e626 broadway: Add outset shadow node 2017-11-23 10:48:29 +01:00
Alexander Larsson
cf03229a99 broadway: Add border node 2017-11-23 10:48:29 +01:00
Alexander Larsson
0b38ab339e broadway: Add color nodes 2017-11-23 10:48:29 +01:00
Alexander Larsson
f7d8ee041b broadway: Initial version of using actual render nodes 2017-11-23 10:48:29 +01:00
Alexander Larsson
23845a57a9 broadway: Add GskBroadwayRenderer
This is a custom renderer for broadway windows, although at the
moment it doesn't really do anything other than the old cairo
fallbacks.
2017-11-23 10:46:47 +01:00
Emmanuele Bassi
481b5d1b89 Partially revert GskTexture → GdkTexture rename
Excessive use of sed when moving GskTexture to GDK; the GskTextureNode
should still live under the GSK namespace.
2017-11-04 15:06:00 +00:00
Benjamin Otte
bd287ba3cf renderer: Assert having been unrealized in dispose
We cannot unrealize a renderer in the dispose function, because that
would cause this chain to happen:
  gsk_gl_renderer_dispose
  gsk_renderer_dispose
  gsk_renderer_unrealize
  gsk_gl_renderer_unrealize
So we would call into thje GL renderers unrealize when it has already
(partially) disposed itself and ause accesses to dead variables.
2017-11-04 15:22:25 +01:00
Benjamin Otte
ca3c23662c GskTexture => GdkTexture
We want this thing to replace GdkPixbuf, so it has to live in GDK.
2017-11-04 00:07:13 +01:00
Benjamin Otte
6b3d979196 gskgl: Deal with being rerealized 2017-11-01 15:48:00 +01:00
Matthias Clasen
ca7c148687 gsk: Apply scale factor for fallback rendering
This fixes blurry text and icons whenever we apply shadows
in a hidpi window. Shadow nodes are the last ones that we
still use fallback for, and this was causing us to render
the text blurry.
2017-10-28 14:38:49 -04:00
Matthias Clasen
439e1054c4 Triival cleanup
No need to go to the window, we store a copy of the scale factor
in the render pass object.
2017-10-28 14:38:21 -04:00
Matthias Clasen
a0bbd14325 gsk: Scale glyphs in the glyph cache
Pass a scale factor when caching glyphs or looking them
up in the cache. The glyphs in the cache are rendered
with subpixel precision determined by the scale. Update
all callers to pass a scale factor according to the window
scale. This lets us render crisp glyphs on hidpi systems.
2017-10-28 13:13:31 -04:00