Commit Graph

608 Commits

Author SHA1 Message Date
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
cac3e7705d gsk: Increase blur node bounds by blur radius
Otherwise, the resulting node will be too small and the result looks
clipped.
2018-02-27 14:12:25 +01:00
Benjamin Otte
710c39027b vulkan: Keep track of command buffers
Fixes a rather large memleak.
2018-02-17 08:04:43 +01:00
Timm Bäder
ad776cc57b gl renderer: Increase offscreen texture size
This fixes blurry checkbutton marks in hidpi setups, but breaks button
hover effects. That's another problem.
2018-02-16 18:00:06 +01:00
Timm Bäder
fab9449414 build: install gsk-autocleanup.h 2018-02-06 11:26:47 +01:00
Timm Bäder
0a51f38963 gl renderer: Check the scale factor for every render
This way we pick up changes in the GdkWindow's scale_factor.
2018-02-06 09:19:40 +01:00
Matthias Clasen
4c150d8eb5 The big versioning cleanup
Remove all the old 2.x and 3.x version annotations.
GTK+ 4 is a new start, and from the perspective of a
GTK+ 4 developer all these APIs have been around since
the beginning.
2018-02-06 01:16:32 -05:00
Matthias Clasen
1772cfd4d8 gsk: Add autocleanup definitions
This may be useful for applications using render nodes.
2018-02-06 01:16:32 -05:00
Matthias Clasen
66a3b07183 Don't put gdk types into a gsk header
This is a leftover from when GskTexture was moved
to gdk.
2018-02-05 07:50:17 +01:00
Timm Bäder
5aaf752013 roundedrect: Fix coordinate mixup in contains_point
This together with the optimizations in GtkSnapshot was causing circular
buttons to become squared when partially scrolled out of view.
2018-02-04 14:56:41 +01:00
Timm Bäder
c739db0e29 gl renderer: Use a gl texture in render_texture
Get rid of the manual y flipping and cairo business. This keeps the gl
unit tests working at least.
2018-02-04 13:10:51 +01:00
Benjamin Otte
83a687f891 rendernode: Don't alloca() 8MB
This happens when deserializing testcases and it really confuses
valgrind into thinking we're longjmp()ing.

And deserializing rendernodes is slow anyway, so who cares about a few
more malloc()s.
2018-02-03 16:24:13 +01:00
Timm Bäder
4fa4b8525e gl renderer: Clear resources after render_texture
This makes multiple consecutive render_texture calls on the same
renderer work.
2018-02-03 13:24:55 +01:00
Timm Bäder
6e70079e63 gl renderer: Reset clip when drawing offscreen
Just like we reset the scissor test and the viewport, we also can't use
the current clip anymore in this case.
2018-01-27 12:13:37 +01:00
Timm Bäder
c1882fe44e GskRoundedRect: Fix GSK_ROUNDED_RECT_INIT macro
GskRoundedRect does not have a .rect member, it's 'bounds'. Also,
properly initialize all fields, i.e. all the corners.
2018-01-27 12:11:49 +01:00
Timm Bäder
684624005a gl renderer: Fix hidpi cairo node rendering
We can't just unconditionally create a larger texture here, since the
incoming cairo surface might have a device scale that doesn't fit our
scale_factor. Instead, look up the surface device scale and use that.
2018-01-27 11:06:38 +01:00
Timm Bäder
1fb5d389db gl renderer: Make width/height relation more obvious
In add_offscreen_ops, we use the max_x/min_x values for the texture and
viewport width, and the max_y/min_y for the texture and viewport height.
2018-01-27 11:00:59 +01:00
Timm Bäder
e3557f681c gl renderer: Fix outset shadow outline transform
This fixes hidpi blurred outset shadows
2018-01-23 21:46:31 +01:00
Timm Bäder
8f4e0705dc gl renderer: Fix shadow node child offset
We shouldn't apply the shadow offset when drawing the child offscreen,
instead apply it afterwards when we draw it to the current render
target.
2018-01-19 15:00:22 +01:00
Timm Bäder
41a922928e gl renderer: Render GL textures upside down
These come from an FBO so we need to flip the texture coords on the y
axis, just like we do everywhere else.
2018-01-18 08:21:11 +01:00
Timm Bäder
5e7b3030b9 rendernodeimpl: Fix a crash
We may get a NULL renderer here.
2018-01-17 21:57:20 +01:00
Matthias Clasen
31fcf5b3a7 gsk: Handle GL textures
These textures already have a GL texture in them,
no need to create a new one.
2018-01-17 11:57:25 -05: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
df35d00a1d gskcairoblur: Don't apply y_scale twice
A version of 29f36fed08 but for the blur
we use in gsk.
2018-01-15 10:56:43 +01:00
Matthias Clasen
2be16f36ed gsk: Add a setter for debug flags
We need to set the global flags, since these are picked
up initially by new renderers.
2018-01-14 17:05:04 -05:00
Matthias Clasen
ba21a7764b gsk: Reorganize env vars
Get rid of GSK_RENDERING_MODE and add the flags to GSK_DEBUG,
following the same pattern we use in gdk now.
2018-01-14 17:05:04 -05:00
Matthias Clasen
c56419818f gsk: make logging per-renderer
Add a setter for per-renderer debug flags, and use
them where possible. Some places don't have easy access
to a renderer, so this is not complete.
Also, use g_message instead of g_print throughout.
2018-01-14 17:05:04 -05:00
Matthias Clasen
782c76c146 gsk: Drop unused debug flags
We are not logging anything for transforms or rendernodes atm.
2018-01-14 17:05:04 -05:00
Matthias Clasen
55585aec73 gsk: Clarify a debug message
We are printing a window type, not a display.
2018-01-14 17:05:04 -05:00
Timm Bäder
b9a05be2da gl renderer: Sprinkle some const around 2018-01-10 08:46:22 +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
f7ba3224b9 gl renderer: Bring back hexbox drawing 2018-01-08 17:44:37 +01:00
Timm Bäder
3176ae7e51 gl renderer: Use alpha uniform in inset shadow shader 2018-01-08 17:44:33 +01:00
Matthias Clasen
3771c95c72 gsk: Move Vulkan sources to a subdirectory
Following what was already done for GL.
2018-01-06 09:36:55 -05:00
Matthias Clasen
550f4bc854 gsk: Fix hexbox drawing for the Vulkan renderer
Just as in the cairo renderer, we can get this back
by using pango_cairo_show_glyph_string for populating
the cache.
2018-01-05 20:30:14 -05:00
Matthias Clasen
2bab983ecf gsk: Fix hexbox drawing for fallback rendering
pango does not currently export api for drawing hex boxes,
but by using pango_cairo_show_glyph_string, we can reuse its
implementation.
2018-01-05 18:55:23 -05:00
Timm Bäder
f729cbb760 gl renderer: Fix text color pre-multiplication 2018-01-04 12:20:27 +01:00
Rico Tzschichholz
543b21430b gsk: Add docs for gsk_texture_node_get_texture 2018-01-03 08:17:23 +01:00
Timm Bäder
fcc8d778b5 gl renderer: Avoid some code duplication 2018-01-02 08:10:06 +01:00
Timm Bäder
d1a08aa2a9 gl driver: Remove some type checks in a hot path 2018-01-02 08:10:06 +01:00
Timm Bäder
0e57d173b3 gl renderer: Remove an unnecessary block 2018-01-02 08:10:06 +01:00
Timm Bäder
f92cca5229 gl renderer: Fix release build 2017-12-29 08:59:47 +01:00
Timm Bäder
86a6131510 build: Rename a variable
Those aren't source headers...
2017-12-29 05:48:43 +01:00
Timm Bäder
6587864824 gl driver: Remove more unused API 2017-12-29 05:48:43 +01:00
Timm Bäder
e0436b3d59 gl renderer: Properly delete all shader programs 2017-12-29 05:48:43 +01:00
Timm Bäder
d2d18f74f8 gl driver: Remove gl-context property
No need for this to be a property.
2017-12-29 05:48:43 +01:00
Timm Bäder
1cbd4d229e gl driver: Remove dead warning code
_get_fbo never returns NULL.
2017-12-29 05:48:43 +01:00
Timm Bäder
c9656e2864 gl driver: Only support one fbo per texture 2017-12-29 05:48:43 +01:00
Timm Bäder
352590cf9f gl driver: Remove vao API
Unused.
2017-12-29 05:48:43 +01:00