Commit 68b39a47 authored by Benjamin Otte's avatar Benjamin Otte

gsk: Add GSK_RENDERING_MODE=full-redraw

Forces a full redraw every frame.
This is done generically, so it's supported on every renderer.

For widget-factory first page (with the spinner spinning and progressbar
pulsing), I get these numbers per frame:

action                  clipped         full redraw
snapshot                   0ms           7-10ms
cairo rendering            0ms          10-15ms
Vulkan rendering         3-5ms          18-20ms
Vulkan expected *          0ms            1-2ms
GL rendering            unsupported     55-62ms

* expected means disabling rendering of unsupported render nodes,
instead of doing fallback drawing. So it overestimates the performance,
because borders and box-shadows are disabled.
parent a5f8a74e
......@@ -18,6 +18,7 @@ static const GDebugKey gsk_rendering_keys[] = {
{ "geometry", GSK_RENDERING_MODE_GEOMETRY },
{ "shaders", GSK_RENDERING_MODE_SHADERS },
{ "sync", GSK_RENDERING_MODE_SYNC },
{ "full-redraw", GSK_RENDERING_MODE_FULL_REDRAW},
{ "staging-image", GSK_RENDERING_MODE_STAGING_IMAGE },
{ "staging-buffer", GSK_RENDERING_MODE_STAGING_BUFFER }
};
......
......@@ -21,8 +21,9 @@ typedef enum {
GSK_RENDERING_MODE_GEOMETRY = 1 << 0,
GSK_RENDERING_MODE_SHADERS = 1 << 1,
GSK_RENDERING_MODE_SYNC = 1 << 2,
GSK_RENDERING_MODE_STAGING_IMAGE = 1 << 3,
GSK_RENDERING_MODE_STAGING_BUFFER = 1 << 4
GSK_RENDERING_MODE_FULL_REDRAW = 1 << 3,
GSK_RENDERING_MODE_STAGING_IMAGE = 1 << 4,
GSK_RENDERING_MODE_STAGING_BUFFER = 1 << 5
} GskRenderingMode;
gboolean gsk_check_debug_flags (GskDebugFlags flags);
......
......@@ -916,7 +916,24 @@ gsk_renderer_begin_draw_frame (GskRenderer *renderer,
g_return_val_if_fail (region != NULL, NULL);
g_return_val_if_fail (priv->drawing_context == NULL, NULL);
priv->drawing_context = GSK_RENDERER_GET_CLASS (renderer)->begin_draw_frame (renderer, region);
if (GSK_RENDER_MODE_CHECK (FULL_REDRAW))
{
cairo_region_t *full_window;
full_window = cairo_region_create_rectangle (&(GdkRectangle) {
0, 0,
gdk_window_get_width (priv->window),
gdk_window_get_height (priv->window)
});
priv->drawing_context = GSK_RENDERER_GET_CLASS (renderer)->begin_draw_frame (renderer, full_window);
cairo_region_destroy (full_window);
}
else
{
priv->drawing_context = GSK_RENDERER_GET_CLASS (renderer)->begin_draw_frame (renderer, region);
}
return priv->drawing_context;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment