Skip to content

Commit 1c1d157

Browse files
committed
delay row dirty until recomp
stops subrows getting stuck
1 parent c231425 commit 1c1d157

File tree

6 files changed

+42
-26
lines changed

6 files changed

+42
-26
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
- fix a segv in Colour widget edit action
88
- much better next/prev/refresh in imagewindow
99
- much better imagewindow focus indicator
10+
- new tilecache flickers less and is faster
11+
- matching changes in libvips 8.18 improve render speed and improve
12+
cancellation of out of date renders
13+
- better sync of view settings between imagewindow and thumbnail
1014

1115
## 9.0.10 2025/06/22
1216

TODO

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
2-
- seeing unfixable dirty rows sometimes
3-
4-
happened in a row containing a region as a subobject
5-
6-
are we updating a row while it's also being computed? can this race?
7-
8-
we should modify the model and queue a scan and recomp, but not update
9-
the heap or mark the row dirty
10-
11-
exactly what variables are crashing into each opther when we mark the
12-
row dirty during row recomp? can we fix this?
13-
14-
much easier than reworking region into a scan model
15-
16-
17-
18-
191
- get judder with rotate and images smaller than the window
202

213
draw on update, then draw again on relayout

src/classmodel.c

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@
3333
#define DEBUG
3434
*/
3535

36-
G_DEFINE_TYPE(Classmodel, classmodel, HEAPMODEL_TYPE)
36+
G_DEFINE_TYPE(Classmodel, classmodel, HEAPMODEL_TYPE);
37+
38+
/* All the classmodel that have been updated ... recomp needs to mark these
39+
* dirty before pickng the next row.
40+
*/
41+
static GSList *classmodel_updated = NULL;
3742

3843
void
3944
image_value_init(ImageValue *image, Classmodel *classmodel)
@@ -602,6 +607,8 @@ classmodel_dispose(GObject *gobject)
602607
(SListMapFn) classmodel_iimage_unlink_rev, classmodel);
603608
VIPS_FREE(classmodel->filename);
604609

610+
classmodel_updated = g_slist_remove(classmodel_updated, classmodel);
611+
605612
G_OBJECT_CLASS(classmodel_parent_class)->dispose(gobject);
606613
}
607614

@@ -1217,11 +1224,6 @@ classmodel_set_edited(Classmodel *classmodel, gboolean edited)
12171224

12181225
classmodel->edited = edited;
12191226
iobject_changed(IOBJECT(classmodel));
1220-
1221-
if (HEAPMODEL(classmodel)->row &&
1222-
HEAPMODEL(classmodel)->row->expr)
1223-
expr_dirty(HEAPMODEL(classmodel)->row->expr,
1224-
link_serial_new());
12251227
}
12261228

12271229
/* Mark eds for application.
@@ -1252,7 +1254,8 @@ classmodel_update(Classmodel *classmodel)
12521254
* modified, we might be in parse.
12531255
*/
12541256
classmodel_set_edited(classmodel, TRUE);
1255-
expr_dirty(row->expr, link_serial_new());
1257+
1258+
classmodel_updated = g_slist_prepend(classmodel_updated, classmodel);
12561259
}
12571260

12581261
/* Model has been changed by a view. Mark for recomp, and since this was a
@@ -1267,6 +1270,28 @@ classmodel_update_view(Classmodel *classmodel)
12671270
if (row &&
12681271
row->expr)
12691272
workspace_set_modified(row->ws, TRUE);
1273+
1274+
symbol_recalculate_all();
1275+
}
1276+
1277+
static void *
1278+
classmodel_dirty_updated_sub(void *a, void *b)
1279+
{
1280+
Classmodel *classmodel = CLASSMODEL(a);
1281+
Row *row = HEAPMODEL(classmodel)->row;
1282+
1283+
if (row &&
1284+
row->expr)
1285+
expr_dirty(row->expr, link_serial_new());
1286+
1287+
return NULL;
1288+
}
1289+
1290+
void
1291+
classmodel_dirty_updated(void)
1292+
{
1293+
slist_map(classmodel_updated, classmodel_dirty_updated_sub, NULL);
1294+
VIPS_FREEF(g_slist_free, classmodel_updated);
12701295
}
12711296

12721297
/* Make a new classmodel subtype (eg. TYPE_PATHNAME) and link it on.

src/classmodel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,5 +153,6 @@ GType classmodel_get_type(void);
153153
void classmodel_update(Classmodel *classmodel);
154154
void classmodel_update_view(Classmodel *classmodel);
155155
void classmodel_set_edited(Classmodel *classmodel, gboolean edited);
156+
void classmodel_dirty_updated(void);
156157

157158
Classmodel *classmodel_new_classmodel(GType type, Rhs *rhs);

src/imageui.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1217,8 +1217,8 @@ imageui_drag_update(GtkEventControllerMotion *self,
12171217
imageui_regionview_update(imageui, imageui->grabbed);
12181218

12191219
/* And nudge background recomp.
1220-
*/
12211220
regionview_model_update(imageui->grabbed);
1221+
*/
12221222

12231223
break;
12241224

src/symbol.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,10 @@ symbol_recalculate_leaf(void)
11031103

11041104
recalculated = FALSE;
11051105

1106+
/* Mark any classmodels dirty that have updates ready.
1107+
*/
1108+
classmodel_dirty_updated();
1109+
11061110
#ifdef DEBUG
11071111
printf("symbol_recalculate_leaves: Leaf set: ");
11081112
slist_map(symbol_leaf_set, (SListMapFn) dump_tiny, NULL);

0 commit comments

Comments
 (0)