/* Test that the GeglNode is processed when invalidated. */ static void test_processing(void) { ViewHelperTest test; gboolean got_computed_event = FALSE; GeglRectangle invalidated_rect = {0, 0, 128, 128}; setup_helper_test(&test); /* Setup will invalidate the node, make sure those events are processed. */ while (gtk_events_pending()) { gtk_main_iteration(); } gegl_node_process(test.out); g_signal_connect(test.out, "computed", G_CALLBACK(computed_event), &got_computed_event); gegl_node_invalidated(test.out, &invalidated_rect, FALSE); g_timeout_add(300, test_utils_quit_gtk_main, NULL); gtk_main(); /* FIXME: test that the computed events span the invalidated area */ g_assert(got_computed_event); teardown_helper_test(&test); }
void gegl_operation_invalidate (GeglOperation *operation, const GeglRectangle *roi, gboolean clear_cache) { GeglNode *node = NULL; if (!operation) return; g_return_if_fail (GEGL_IS_OPERATION (operation)); node = operation->node; gegl_node_invalidated (node, roi, TRUE); }
static gpointer test (gpointer data) { GeglNode *node; GeglNode *input; GeglNode *last; gint i; node = gegl_node_new (); input = gegl_node_get_input_proxy (node, "input"); last = input; for (i = 0; i < 64; i++) { GeglNode *over; over = gegl_node_new_child (node, "operation", "gegl:over", NULL); gegl_node_connect_to (last, "output", over, "input"); gegl_node_connect_to (last, "output", over, "aux"); last = over; } gegl_node_invalidated (input, NULL, FALSE); g_object_unref (node); g_mutex_lock (&mutex); finished = TRUE; g_cond_signal (&cond); g_mutex_unlock (&mutex); return NULL; }