@@ -633,34 +633,42 @@ void dt_dev_pixelpipe_synch_top(dt_dev_pixelpipe_t *pipe, dt_develop_t *dev)
633
633
void dt_dev_pixelpipe_change (dt_dev_pixelpipe_t * pipe , dt_develop_t * dev )
634
634
{
635
635
dt_pthread_mutex_lock (& dev -> history_mutex );
636
-
637
- dt_print_pipe (DT_DEBUG_PIPE , "pipe state changing" ,
638
- pipe , NULL , DT_DEVICE_NONE , NULL , NULL , "%s%s%s%s" ,
636
+ dt_print_pipe (DT_DEBUG_PIPE , "dev_pixelpipe_change" ,
637
+ pipe , NULL , DT_DEVICE_NONE , NULL , NULL , "%s%s%s%s%s" ,
639
638
pipe -> changed & DT_DEV_PIPE_ZOOMED ? "zoomed, " : "" ,
640
639
pipe -> changed & DT_DEV_PIPE_TOP_CHANGED ? "top changed, " : "" ,
641
640
pipe -> changed & DT_DEV_PIPE_SYNCH ? "synch all, " : "" ,
642
- pipe -> changed & DT_DEV_PIPE_REMOVE ? "pipe remove" : "" );
643
- // case DT_DEV_PIPE_UNCHANGED: case DT_DEV_PIPE_ZOOMED:
644
- if (pipe -> changed & DT_DEV_PIPE_TOP_CHANGED )
645
- {
646
- // only top history item changed.
647
- dt_dev_pixelpipe_synch_top (pipe , dev );
648
- }
649
- if (pipe -> changed & DT_DEV_PIPE_SYNCH )
650
- {
651
- // pipeline topology remains intact, only change all params.
652
- dt_dev_pixelpipe_synch_all (pipe , dev );
653
- }
654
- if (pipe -> changed & DT_DEV_PIPE_REMOVE )
641
+ pipe -> changed & DT_DEV_PIPE_REMOVE ? "pipe remove" : "" ,
642
+ pipe -> changed == DT_DEV_PIPE_UNCHANGED ? "dimension" : "" );
643
+
644
+ if (pipe -> changed & (DT_DEV_PIPE_TOP_CHANGED | DT_DEV_PIPE_SYNCH | DT_DEV_PIPE_REMOVE ))
655
645
{
656
- // modules have been added in between or removed. need to rebuild
657
- // the whole pipeline.
658
- dt_dev_pixelpipe_cleanup_nodes (pipe );
659
- dt_dev_pixelpipe_create_nodes (pipe , dev );
660
- dt_dev_pixelpipe_synch_all (pipe , dev );
646
+ const gboolean sync_all = pipe -> changed & (DT_DEV_PIPE_SYNCH | DT_DEV_PIPE_REMOVE );
647
+ const gboolean sync_remove = pipe -> changed & DT_DEV_PIPE_REMOVE ;
648
+
649
+ if ((pipe -> changed & DT_DEV_PIPE_TOP_CHANGED ) && !sync_all )
650
+ {
651
+ // only top history item changed. Not required if we synch_all
652
+ dt_dev_pixelpipe_synch_top (pipe , dev );
653
+ }
654
+
655
+ if ((pipe -> changed & DT_DEV_PIPE_SYNCH ) && !sync_remove )
656
+ {
657
+ // pipeline topology remains intact but change all params. Not required if we rebuild all nodes
658
+ dt_dev_pixelpipe_synch_all (pipe , dev );
659
+ }
660
+
661
+ if (pipe -> changed & DT_DEV_PIPE_REMOVE )
662
+ {
663
+ // modules have been added in between or removed. need to rebuild the whole pipeline.
664
+ dt_dev_pixelpipe_cleanup_nodes (pipe );
665
+ dt_dev_pixelpipe_create_nodes (pipe , dev );
666
+ dt_dev_pixelpipe_synch_all (pipe , dev );
667
+ }
661
668
}
662
669
pipe -> changed = DT_DEV_PIPE_UNCHANGED ;
663
670
dt_pthread_mutex_unlock (& dev -> history_mutex );
671
+
664
672
dt_dev_pixelpipe_get_dimensions (pipe , dev ,
665
673
pipe -> iwidth , pipe -> iheight ,
666
674
& pipe -> processed_width ,
@@ -2906,6 +2914,8 @@ void dt_dev_pixelpipe_get_dimensions(dt_dev_pixelpipe_t *pipe,
2906
2914
{
2907
2915
dt_pthread_mutex_lock (& pipe -> busy_mutex );
2908
2916
dt_iop_roi_t roi_in = (dt_iop_roi_t ){ 0 , 0 , width_in , height_in , 1.0 };
2917
+ dt_print_pipe (DT_DEBUG_PIPE ,
2918
+ "get dimensions" , pipe , NULL , DT_DEVICE_NONE , & roi_in , NULL , "ID=%i" , pipe -> image .id );
2909
2919
dt_iop_roi_t roi_out ;
2910
2920
GList * modules = pipe -> iop ;
2911
2921
GList * pieces = pipe -> nodes ;
@@ -2922,8 +2932,7 @@ void dt_dev_pixelpipe_get_dimensions(dt_dev_pixelpipe_t *pipe,
2922
2932
module -> modify_roi_out (module , piece , & roi_out , & roi_in );
2923
2933
if ((darktable .unmuted & DT_DEBUG_PIPE ) && memcmp (& roi_out , & roi_in , sizeof (dt_iop_roi_t )))
2924
2934
dt_print_pipe (DT_DEBUG_PIPE ,
2925
- "modify roi OUT" , piece -> pipe , module , DT_DEVICE_NONE , & roi_in , & roi_out , "ID=%i" ,
2926
- pipe -> image .id );
2935
+ "modify roi OUT" , pipe , module , DT_DEVICE_NONE , & roi_in , & roi_out );
2927
2936
}
2928
2937
else
2929
2938
{
0 commit comments