Alexander Larsson
391727bd0d
GdkWindow -> GdkSurface initial type rename
...
This renames the GdkWindow class and related classes (impl, backend
subclasses) to surface. Additionally it renames related types:
GdkWindowAttr, GdkWindowPaint, GdkWindowWindowClass, GdkWindowType,
GdkWindowTypeHint, GdkWindowHints, GdkWindowState, GdkWindowEdge
This is an automatic conversion using the below commands:
git sed -f g GdkWindowWindowClass GdkSurfaceSurfaceClass
git sed -f g GdkWindow GdkSurface
git sed -f g "gdk_window\([ _\(\),;]\|$\)" "gdk_surface\1" # Avoid hitting gdk_windowing
git sed -f g "GDK_WINDOW\([ _\(]\|$\)" "GDK_SURFACE\1" # Avoid hitting GDK_WINDOWING
git sed "GDK_\([A-Z]*\)IS_WINDOW\([_ (]\|$\)" "GDK_\1IS_SURFACE\2"
git sed GDK_TYPE_WINDOW GDK_TYPE_SURFACE
git sed -f g GdkPointerWindowInfo GdkPointerSurfaceInfo
git sed -f g "BROADWAY_WINDOW" "BROADWAY_SURFACE"
git sed -f g "broadway_window" "broadway_surface"
git sed -f g "BroadwayWindow" "BroadwaySurface"
git sed -f g "WAYLAND_WINDOW" "WAYLAND_SURFACE"
git sed -f g "wayland_window" "wayland_surface"
git sed -f g "WaylandWindow" "WaylandSurface"
git sed -f g "X11_WINDOW" "X11_SURFACE"
git sed -f g "x11_window" "x11_surface"
git sed -f g "X11Window" "X11Surface"
git sed -f g "WIN32_WINDOW" "WIN32_SURFACE"
git sed -f g "win32_window" "win32_surface"
git sed -f g "Win32Window" "Win32Surface"
git sed -f g "QUARTZ_WINDOW" "QUARTZ_SURFACE"
git sed -f g "quartz_window" "quartz_surface"
git sed -f g "QuartzWindow" "QuartzSurface"
git checkout NEWS* po-properties
2018-03-20 11:40:08 +01:00
Timm Bäder
0124740fa0
gl renderer: Support large textures
...
By tiling them.
2018-03-20 09:40:10 +01:00
Timm Bäder
4240119d64
gl renderer: add basic code to support texture tiling
2018-03-20 09:40:10 +01:00
Timm Bäder
a9fec38680
rendernode: Don't use gdk_texture_download_surface
...
It can't handle the texture sizes we'd like to support
2018-03-20 09:40:10 +01:00
Timm Bäder
22780044ec
rendernode: Don't use gdk_texture_download_surface
...
It can't handle the texture sizes we'd like to support
2018-03-20 09:37:59 +01:00
Timm Bäder
9e9db8607b
Revert "gl renderer: Limit texture node size to clip"
...
This reverts commit 0234e8e2c9
.
This broke partially clipped-away nodes when they are being transformed,
e.g. by a rotation
2018-03-20 09:37:59 +01:00
Timm Bäder
8ef2b10f70
gldriver: Name driver instances 'self'
2018-03-20 09:37:59 +01:00
Benjamin Otte
d54ca3c74f
gdk: Add GDK_MEMORY_DEFAULT
...
This is the default memory format.
I added it because it is way better than including a private header and
using GDK_MEMORY_CAIRO_FORMAT_ARGB32.
2018-03-18 05:57:07 +01:00
Benjamin Otte
ee8e42f19b
gdk: Remove gdk_texture_new_from_data()
...
Use gdk_memory_texture_new() instead.
2018-03-18 05:57:07 +01:00
Timm Bäder
ba52be36c2
gl renderer: Set border program outline state
2018-03-15 18:17:57 +01: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
a475e6671c
shaderbuilder: Remove unused API
2018-03-15 16:30:48 +01:00
Timm Bäder
e35132054e
gl: Move shaderbuilder into gl/ subdirectory
...
It only handles OpenGL shaders.
2018-03-15 15:06:46 +01:00
Timm Bäder
ebfadae568
gl renderer: Draw offscreen nodes in device pixels
...
We need to draw them upscaled, of course. This fixes button hover (or,
more generally, crossfade nodes) in hidpi setups.
2018-03-15 13:52:07 +01:00
Timm Bäder
3a5630358f
gl renderer: Fix rounded clips in hidpi
2018-03-15 11:01:53 +01:00
Timm Bäder
04fadc508b
GskGLDriver: Use g_assert_cmphex for GL constants
2018-03-15 09:25:42 +01:00
Timm Bäder
d417595a05
gl renderer: Draw rounded clip child to a texture
...
And then clip the texture using the current (maybe also rounded) clip.
This way, the result is correct. We don't necessarily have to do the
offscreen drawing in any case, but got the safe route for now.
2018-03-14 17:28:41 +01:00
Timm Bäder
90c8619f42
gl renderer: Properly draw gl textures from a different context
...
Temporarily switch to the texture's gl context, download the texture and
create a new one in our context for it.
2018-03-14 17:28:41 +01:00
Benjamin Otte
160e6ad6f6
gdk: Split out GL texture
...
Put GdkGLTexture into its own file and rename the API to
gdk_gl_texture_foo() instead of gdk_texture_foo_for_gl().
Apart from naming, no actual code changes.
2018-03-07 16:17:15 +01:00
Timm Bäder
2d50d9ebe6
rendernodes: Add gsk_text_node_new_with_bounds
...
An alternative GskTextNode constructor that does no text measuring. That
way, we can measure the text before and check if the node will be
outside of the current clip anyway.
2018-03-04 19:12:04 +01:00
Timm Bäder
ee8132a439
rendernodes: Add missing nullable annotation
2018-03-04 19:12:04 +01:00
Timm Bäder
0234e8e2c9
gl renderer: Limit texture node size to clip
2018-03-04 19:12:04 +01:00
Timm Bäder
da431b2a43
glglyphcache: Pass lookup key to g_hash_table_lookup directly
2018-03-04 19:12:04 +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
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
Timm Bäder
825608af2a
gl renderer: Remove unused parameter
2017-12-29 05:48:43 +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
aeaab5557b
gl renderer: Only draw what we have to
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
9f2674077a
gl renderer: Properly flip texture in render_texture path
...
Just do this on the CPU instead.
2017-12-28 16:48:35 +01:00
Timm Bäder
a720a63fa3
gl renderer: Insert render target op in render_texture path
2017-12-28 16:48:35 +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
f044b01549
gl renderer: Don't crash if the first op is an opacity one
2017-12-21 19:12:32 +01:00
Timm Bäder
490e15021c
gl renderer: Force cross-fade nodes offscreen
2017-12-21 19:12:32 +01:00
Timm Bäder
48be2aed23
gl renderer: Use one function per op type to apply data
2017-12-21 19:12:32 +01:00
Timm Bäder
28499032da
gl renderer: Don't leak gl resources
2017-12-21 19:12:32 +01:00
Timm Bäder
ee27b17a12
gl renderer: Fix indentation mishap
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
075e6ac266
gl renderer: Fix shadow nodes if the child is a container
2017-12-21 19:12:32 +01:00
Timm Bäder
18e7d777a2
gl renderer: Move declarations to the beginning of the block
2017-12-21 19:12:32 +01:00
Timm Bäder
e9be72a73e
gl renderer: Fix use of uninitialized values
2017-12-21 19:12:32 +01:00
Timm Bäder
33457b4035
gl renderer: Ensure texture sizes arent 0
...
We already ceil() the given float texture sizes here, so if they are
valid, the result should definitely be > 0. Textures with size 0 can't
be properly used, especially not as render targets, where they will
trigger an assertion failure later in a glCheckFramebuffer call.
2017-12-21 19:12:32 +01:00
Timm Bäder
49c7cf36e4
gl renderer: Fix inset and outset shadows in hidpi
2017-12-21 19:12:32 +01:00
Timm Bäder
b03f08960b
gl renderer: Fix cairo node surface size in hidpi
2017-12-21 19:12:32 +01:00
Timm Bäder
d9e135dcb5
gl renderer: Fix rounded clips in hidpi
2017-12-21 19:12:32 +01:00
Timm Bäder
3411e648b4
gl renderer: Handle borders in hidpi better
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
703c4cf003
gl renderer: Ignore render ops before we have a valid program
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
a59f380d31
gl renderer: Use one function per node-type
...
So a profiler can actually tell me what's slow and not just point at
_add_render_ops in all cases.
2017-12-21 19:12:32 +01:00
Timm Bäder
ab53ee7377
gl renderer: Don't render opacity nodes offscreen
...
We already drag a u_alpha uniform around in every shader, so use that
one.
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
476450b93e
gl renderer: Ignore shadow color matrix nodes...
...
... if the color matrix nodes don't touch the child alpha.
2017-12-21 19:12:32 +01:00
Timm Bäder
98ba28b5d7
gl renderer: Add a helper function
...
We'll use this for the common case of a color matrix node inside a
shadow node.
2017-12-21 19:12:32 +01:00
Timm Bäder
49785974cf
gl renderer: Don't zero initialize render ops GArray
2017-12-21 19:12:32 +01:00
Timm Bäder
7cc868910b
gl renderer: Avoid crashing tooltips
2017-12-21 19:12:31 +01:00
Timm Bäder
39a241b763
gl renderer: Sort border sides by color
2017-12-21 19:12:31 +01:00
Timm Bäder
c9af94f6db
gl renderer: Keep track of border program state
2017-12-21 19:12:31 +01:00
Timm Bäder
f978bf057f
gl renderer: Avoid using a new modelview for shadow nodes
...
We can just move the vertex data directly.
2017-12-21 19:12:31 +01:00
Timm Bäder
7ad8f211c6
gl renderer: Default to GL_LINEAR scaling filters
2017-12-21 19:12:31 +01:00
Timm Bäder
5cdd46e38e
gl renderer: Remove superfluous modelview matrix changes
2017-12-21 19:12:31 +01:00
Timm Bäder
1fce25c7af
gl renderer: Remove unused struct member
2017-12-21 19:12:31 +01:00
Timm Bäder
9479bb6bfc
gl renderer: Keep track of color matrix op state
2017-12-21 19:12:31 +01:00
Timm Bäder
b33d85b594
gl renderer: Avoid consecutive opacity ops
2017-12-21 19:12:31 +01:00
Timm Bäder
a0e033b2cd
gl renderer: Define debug structs inline
2017-12-21 19:12:31 +01:00
Timm Bäder
5d0c279351
gl renderer: Add more detailed render op output
2017-12-21 19:12:31 +01:00
Timm Bäder
7831d9a463
gl renderer: Only draw blurred shadow nodes once
2017-12-21 19:12:31 +01:00
Timm Bäder
7dc6a46cff
gl renderer: Remove consecutive clip ops
2017-12-21 19:12:31 +01:00
Timm Bäder
bb69d64a0f
gl renderer: Rename a macro
2017-12-21 19:12:31 +01:00
Timm Bäder
8463040ad1
gl renderer: Fix debugging output
2017-12-21 19:12:31 +01:00
Timm Bäder
3b7cfd068b
gl renderer: Implement simple border nodes
2017-12-21 19:12:31 +01:00
Timm Bäder
8089cde977
gl renderer: Don't render unblurred text shadows to a texture
...
We can do the same thing by simply drawing the text in the given shadow
color.
2017-12-21 19:12:31 +01:00
Timm Bäder
d5a759652f
gl renderer: Split out text rendering function
...
We'll use that for text shadow 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
c524ac7bb5
gl renderer: Split out a utility function
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
ff1cacb54a
gl renderer: Remove some unused members
2017-12-21 19:12:31 +01:00
Timm Bäder
19700fccb2
gl renderer: Keep track of current program color value
2017-12-21 19:12:31 +01:00
Timm Bäder
2865ab84a9
gl renderer: Don't draw texture nodes to a framebuffer
...
We don't need to create a texture from a texture node. We can simply use
its texture instead and draw it however we want.
2017-12-21 19:12:31 +01:00
Timm Bäder
e3264d5fd3
gl renderer: Implement color matrix nodes again
2017-12-21 19:12:31 +01:00
Timm Bäder
cb9c4e362c
gl render ops: Rename a member
2017-12-21 19:12:31 +01:00
Timm Bäder
b56a7afd19
gl renderer: Factor out a helper function for offscreen drawing
2017-12-21 19:12:30 +01:00
Timm Bäder
95051e13c3
gl ops: Remove dead code
...
This is already checked further up in that function
2017-12-21 19:12:30 +01:00
Timm Bäder
832920c6ba
gl renderer: Optimize text drawing
...
Text nodes will almost always end up using the exact same texture and
the same program. So, in that case we can simply add vertex data for all
the characters we need to draw and use just one draw call.
2017-12-21 19:12:30 +01:00
Timm Bäder
fa564e1f93
gl renderer: Remove unused VAO
2017-12-21 19:12:30 +01:00
Timm Bäder
d5eeb9d6f0
gl renderer: Stop collecting VAOs in clear_tree
...
We don't use that part of the gl driver anymore.
2017-12-21 19:12:30 +01:00
Timm Bäder
6606c1f682
gl renderer: Only check for color glyphs once per text node
...
It does not depend on the glyph, so no need to do it once for every
glyph.
2017-12-21 19:12:30 +01:00
Timm Bäder
5615fd26c2
gl renderer: Implement cairo nodes again
2017-12-21 19:12:30 +01:00
Timm Bäder
a1d3e77347
gl renderer: Move render ops into separate file
2017-12-21 19:12:30 +01:00
Timm Bäder
823369f275
gsk: Move all gskgl* files into gl/
2017-12-21 19:12:30 +01:00
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
Matthias Clasen
dc0570cc17
gsk: Drop the GskRenderer::scale-factor property
...
This is can always be obtained from the window that is already
associated with the renderer, no need to maintain a separate
property for it.
2017-10-28 11:49:39 -04:00
Matthias Clasen
ea91ab1d99
gsk: Make text nodes more compact
...
The copy of the PangoGlyphString we do here was showing up
in some profiles. To avoid it, allocate the PangoGlyphInfo array
as part of the node itself. Update all callers to deal with
the slight api change required for this.
2017-10-27 17:13:40 -04: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