Fix blit_plane
This edit will make sure blit_plane only acts if all workers have completed their drawing, since it's not much use otherwise.
This commit is contained in:
parent
99fc7ce405
commit
64f921eff7
1 changed files with 11 additions and 2 deletions
9
visor.c
9
visor.c
|
@ -342,8 +342,17 @@ void blit_plane(GtkDrawingArea *da, cairo_t *cr, int width, int height, gpointer
|
||||||
(void) width;
|
(void) width;
|
||||||
(void) height;
|
(void) height;
|
||||||
(void) data;
|
(void) data;
|
||||||
|
bool allWritersHadCompleted = true;
|
||||||
|
for (int32_t i = 0; i < thread_count; i++) {
|
||||||
|
if (!threads[i].complete) {
|
||||||
|
allWritersHadCompleted = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (allWritersHadCompleted) {
|
||||||
cairo_set_source_surface(cr, surface, 0, 0);
|
cairo_set_source_surface(cr, surface, 0, 0);
|
||||||
cairo_paint(cr);
|
cairo_paint(cr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void plane_resize(GtkWidget *widget)
|
void plane_resize(GtkWidget *widget)
|
||||||
|
|
Loading…
Add table
Reference in a new issue