mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
line-visualizer-row: use scaled surface when available
If we have not yet received our proper draw for the new size allocation (likely right after the size allocate), then we can just use the old surface but at a scaled value. This is handy so that we don't block the main loop trying to do drawing of lots of data points. Instead we just scale the image and wait for the high-quality version to complete.
This commit is contained in:
@ -246,7 +246,10 @@ sp_line_visualizer_row_draw (GtkWidget *widget,
|
||||
*/
|
||||
if (width != alloc.width || height != alloc.height)
|
||||
{
|
||||
/* TODO: Handle intermediate scaling */
|
||||
cairo_rectangle (cr, 0, 0, width, height);
|
||||
cairo_scale (cr, (gdouble)alloc.width / (gdouble)width, (gdouble)alloc.height / (gdouble)height);
|
||||
cairo_set_source_surface (cr, priv->surface, 0, 0);
|
||||
cairo_fill (cr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user