![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Collaboration diagram for _shape_t:Data Fields | |
| const char * | name |
| dt_masks_type_t | type |
| const dt_masks_functions_t * | functions |
| gboolean | area_depends_on_geometry |
The rasterisation family answers the same question the same way for every shape.
It did not use to. The family returned a bare int on a "0 means success" convention that could not express the third outcome that actually occurs – a shape with nothing to draw – so each shape picked its own answer and they disagreed. A form with no points made a circle report failure, which aborted the whole group fold and blanked the mask, and made an ellipse report success, which folded it as zeros. Three shapes reported success from the outline builder while writing no outline at all, which stamped the outline cache over a NULL and hid the shape until the geometry next moved. Two more reported success from get_area/get_mask without writing a single out-parameter, which callers then read.
Every one of those was a disagreement between shapes about a contract nobody had written down, so these tests pin the contract rather than any one shape's behaviour: the degenerate input goes to every implementation, and they must all answer alike.
The forms are built on the stack instead of through dt_masks_create(), which reaches for conf and the supervisor. A shape struct plus its function table is the whole input the contract is about. Every shape whose rasteriser can be reached with a degenerate form and no pipeline.
Brush and polygon are deliberately absent: both check their module argument before they look at the geometry, so reaching their "no geometry" branch needs a live module and pipe. Their module-less branch is covered by the ERROR case below instead.
Definition at line 58 of file test_masks_raster_contract.c.
| gboolean _shape_t::area_depends_on_geometry |
Definition at line 67 of file test_masks_raster_contract.c.
| const dt_masks_functions_t* _shape_t::functions |
Definition at line 62 of file test_masks_raster_contract.c.
Referenced by _empty_form().
| const char* _shape_t::name |
Definition at line 60 of file test_masks_raster_contract.c.
| dt_masks_type_t _shape_t::type |
Definition at line 61 of file test_masks_raster_contract.c.
Referenced by _empty_form().