![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Background stroke worker API for drawlayer realtime painting. More...
Include dependency graph for worker.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | dt_drawlayer_worker_snapshot_t |
Typedefs | |
| typedef struct dt_drawlayer_worker_t | dt_drawlayer_worker_t |
| Opaque worker state (thread, queue, stroke runtime). | |
| typedef enum dt_drawlayer_worker_state_t | dt_drawlayer_worker_state_t |
| typedef struct dt_drawlayer_worker_snapshot_t | dt_drawlayer_worker_snapshot_t |
Functions | |
| void | dt_drawlayer_worker_init (dt_iop_module_t *self, dt_drawlayer_worker_t **worker, gboolean *painting, gboolean *finish_commit_pending, guint *stroke_sample_count, uint32_t *current_stroke_batch) |
| Initialize worker and bind external state mirrors. | |
| void | dt_drawlayer_worker_cleanup (dt_drawlayer_worker_t **worker) |
| Stop worker and release all resources. | |
| gboolean | dt_drawlayer_worker_active (const dt_drawlayer_worker_t *worker) |
| Query whether realtime/backend worker still has pending activity. | |
| gboolean | dt_drawlayer_worker_any_active (const dt_drawlayer_worker_t *worker) |
| Query whether any worker still has pending activity. | |
| void | dt_drawlayer_worker_get_snapshot (const dt_drawlayer_worker_t *worker, dt_drawlayer_worker_snapshot_t *snapshot) |
| Return a thread-safe worker snapshot for runtime scheduling. | |
| void | dt_drawlayer_worker_request_commit (dt_drawlayer_worker_t *worker) |
| Request asynchronous commit once queues become idle. | |
| void | dt_drawlayer_worker_flush_pending (dt_drawlayer_worker_t *worker) |
| Flush pending events and force commit transition. | |
| gboolean | dt_drawlayer_worker_ensure_running (dt_iop_module_t *self, dt_drawlayer_worker_t *worker) |
| Ensure realtime/backend worker threads are started. | |
| void | dt_drawlayer_worker_stop (dt_iop_module_t *self, dt_drawlayer_worker_t *worker) |
| Stop realtime and full-resolution worker threads. | |
| void | dt_drawlayer_worker_seal_for_commit (dt_drawlayer_worker_t *worker) |
| Seal current stroke for synchronous commit. | |
| void | dt_drawlayer_worker_publish_backend_stroke_damage (dt_iop_module_t *self) |
| Publish accumulated backend stroke damage into drawlayer process/runtime state. | |
| void | dt_drawlayer_worker_reset_backend_path (dt_drawlayer_worker_t *worker) |
| Reset worker-owned backend damage accumulator. | |
| void | dt_drawlayer_worker_reset_live_publish (dt_drawlayer_worker_t *worker) |
| Reset worker-owned transient live-publish state. | |
| void | dt_drawlayer_worker_reset_stroke (dt_drawlayer_worker_t *worker) |
| Clear preserved stroke runtime/history after a completed commit. | |
| GArray * | dt_drawlayer_worker_raw_inputs (dt_drawlayer_worker_t *worker) |
| Read-only access to preserved raw input queue for current stroke (valid only while worker is idle). | |
| dt_drawlayer_paint_stroke_t * | dt_drawlayer_worker_stroke (dt_drawlayer_worker_t *worker) |
| Read-only access to preserved stroke runtime (valid only while worker is idle). | |
| guint | dt_drawlayer_worker_pending_dab_count (const dt_drawlayer_worker_t *worker) |
| Return the number of interpolated-but-not-yet-rasterized dabs in the current stroke batch. | |
| gboolean | dt_drawlayer_worker_enqueue_input (dt_drawlayer_worker_t *worker, const dt_drawlayer_paint_raw_input_t *input) |
| Enqueue one raw input event (FIFO, no coalescing). | |
| gboolean | dt_drawlayer_worker_enqueue_stroke_end (dt_drawlayer_worker_t *worker, const dt_drawlayer_paint_raw_input_t *input) |
| Enqueue stroke-end marker carrying final raw input sample. | |
Background stroke worker API for drawlayer realtime painting.
| typedef struct dt_drawlayer_worker_snapshot_t dt_drawlayer_worker_snapshot_t |
| typedef enum dt_drawlayer_worker_state_t dt_drawlayer_worker_state_t |
| typedef struct dt_drawlayer_worker_t dt_drawlayer_worker_t |
Opaque worker state (thread, queue, stroke runtime).
| gboolean dt_drawlayer_worker_active | ( | const dt_drawlayer_worker_t * | worker | ) |
Query whether realtime/backend worker still has pending activity.
Query whether realtime/backend worker still has pending activity.
References _rt_workers_active().
Referenced by dt_drawlayer_begin_gui_stroke_capture().
| gboolean dt_drawlayer_worker_any_active | ( | const dt_drawlayer_worker_t * | worker | ) |
Query whether any worker still has pending activity.
Query whether any worker still has pending activity.
References _rt_workers_any_active().
Referenced by _drawlayer_modal_wait_tick(), dt_drawlayer_flush_layer_cache(), and dt_drawlayer_wait_for_rasterization_modal().
| void dt_drawlayer_worker_cleanup | ( | dt_drawlayer_worker_t ** | worker | ) |
Stop worker and release all resources.
Stop worker and release all resources.
References _rt_cleanup_state().
Referenced by gui_cleanup().
| gboolean dt_drawlayer_worker_enqueue_input | ( | dt_drawlayer_worker_t * | worker, |
| const dt_drawlayer_paint_raw_input_t * | input | ||
| ) |
Enqueue one raw input event (FIFO, no coalescing).
Enqueue one raw input event (FIFO, no coalescing).
References _enqueue_input(), and dt_drawlayer_worker_t::self.
Referenced by dt_drawlayer_runtime_manager_update().
| gboolean dt_drawlayer_worker_enqueue_stroke_end | ( | dt_drawlayer_worker_t * | worker, |
| const dt_drawlayer_paint_raw_input_t * | input | ||
| ) |
Enqueue stroke-end marker carrying final raw input sample.
Enqueue stroke-end marker carrying final raw input sample.
References _enqueue_stroke_end(), and dt_drawlayer_worker_t::self.
Referenced by dt_drawlayer_runtime_manager_update().
| gboolean dt_drawlayer_worker_ensure_running | ( | dt_iop_module_t * | self, |
| dt_drawlayer_worker_t * | worker | ||
| ) |
Ensure realtime/backend worker threads are started.
References _start_worker().
Referenced by dt_drawlayer_runtime_manager_update().
| void dt_drawlayer_worker_flush_pending | ( | dt_drawlayer_worker_t * | worker | ) |
Flush pending events and force commit transition.
Flush pending events and force commit transition.
References _wait_worker_idle(), IS_NULL_PTR, and dt_drawlayer_worker_t::self.
| void dt_drawlayer_worker_get_snapshot | ( | const dt_drawlayer_worker_t * | worker, |
| dt_drawlayer_worker_snapshot_t * | snapshot | ||
| ) |
Return a thread-safe worker snapshot for runtime scheduling.
References _backend_worker_const(), dt_drawlayer_worker_snapshot_t::backend_queue_count, dt_drawlayer_worker_snapshot_t::backend_state, dt_drawlayer_worker_snapshot_t::commit_pending, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_drawlayer_worker_t::finish_commit_pending, IS_NULL_PTR, drawlayer_rt_worker_t::ring_count, drawlayer_rt_worker_t::state, and dt_drawlayer_worker_t::worker_mutex.
Referenced by _collect_runtime_inputs().
| void dt_drawlayer_worker_init | ( | dt_iop_module_t * | self, |
| dt_drawlayer_worker_t ** | worker, | ||
| gboolean * | painting, | ||
| gboolean * | finish_commit_pending, | ||
| guint * | stroke_sample_count, | ||
| uint32_t * | current_stroke_batch | ||
| ) |
Initialize worker and bind external state mirrors.
Initialize worker and bind external state mirrors.
References _rt_init_state().
Referenced by gui_init().
| guint dt_drawlayer_worker_pending_dab_count | ( | const dt_drawlayer_worker_t * | worker | ) |
Return the number of interpolated-but-not-yet-rasterized dabs in the current stroke batch.
References dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), IS_NULL_PTR, dt_drawlayer_paint_stroke_t::pending_dabs, dt_drawlayer_worker_t::stroke, and dt_drawlayer_worker_t::worker_mutex.
| void dt_drawlayer_worker_publish_backend_stroke_damage | ( | dt_iop_module_t * | self | ) |
Publish accumulated backend stroke damage into drawlayer process/runtime state.
References dt_drawlayer_paint_merge_runtime_stroke_damage(), dt_drawlayer_paint_runtime_note_dab_damage(), g, dt_iop_module_t::gui_data, IS_NULL_PTR, and TRUE.
Referenced by dt_drawlayer_commit_dabs().
| GArray * dt_drawlayer_worker_raw_inputs | ( | dt_drawlayer_worker_t * | worker | ) |
Read-only access to preserved raw input queue for current stroke (valid only while worker is idle).
Read-only access to preserved raw input queue for current stroke (valid only while worker is idle).
References dt_drawlayer_worker_t::stroke_raw_inputs.
| void dt_drawlayer_worker_request_commit | ( | dt_drawlayer_worker_t * | worker | ) |
Request asynchronous commit once queues become idle.
Request asynchronous commit once queues become idle.
References dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_drawlayer_worker_t::finish_commit_pending, IS_NULL_PTR, TRUE, dt_drawlayer_worker_t::worker_cond, and dt_drawlayer_worker_t::worker_mutex.
Referenced by dt_drawlayer_commit_dabs(), and dt_drawlayer_runtime_manager_update().
| void dt_drawlayer_worker_reset_backend_path | ( | dt_drawlayer_worker_t * | worker | ) |
Reset worker-owned backend damage accumulator.
References _reset_backend_path(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), IS_NULL_PTR, and dt_drawlayer_worker_t::worker_mutex.
Referenced by _ensure_widget_cache(), _reset_stroke_session(), and dt_drawlayer_begin_gui_stroke_capture().
| void dt_drawlayer_worker_reset_live_publish | ( | dt_drawlayer_worker_t * | worker | ) |
Reset worker-owned transient live-publish state.
References _reset_live_publish(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), IS_NULL_PTR, and dt_drawlayer_worker_t::worker_mutex.
Referenced by _reset_stroke_session(), and dt_drawlayer_begin_gui_stroke_capture().
| void dt_drawlayer_worker_reset_stroke | ( | dt_drawlayer_worker_t * | worker | ) |
Clear preserved stroke runtime/history after a completed commit.
Clear preserved stroke runtime/history after a completed commit.
References _reset_live_publish(), _stroke_clear(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), IS_NULL_PTR, and dt_drawlayer_worker_t::worker_mutex.
Referenced by dt_drawlayer_commit_dabs().
| void dt_drawlayer_worker_seal_for_commit | ( | dt_drawlayer_worker_t * | worker | ) |
Seal current stroke for synchronous commit.
References void().
Referenced by dt_drawlayer_commit_dabs().
| void dt_drawlayer_worker_stop | ( | dt_iop_module_t * | self, |
| dt_drawlayer_worker_t * | worker | ||
| ) |
Stop realtime and full-resolution worker threads.
References _stop_worker().
Referenced by dt_drawlayer_runtime_manager_update().
| dt_drawlayer_paint_stroke_t * dt_drawlayer_worker_stroke | ( | dt_drawlayer_worker_t * | worker | ) |
Read-only access to preserved stroke runtime (valid only while worker is idle).
Read-only access to preserved stroke runtime (valid only while worker is idle).
References dt_drawlayer_worker_t::stroke.