Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
_shape_t Struct Reference
+ Collaboration diagram for _shape_t:

Data Fields

const char * name
 
dt_masks_type_t type
 
const dt_masks_functions_tfunctions
 
gboolean area_depends_on_geometry
 

Detailed Description

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.

Field Documentation

◆ area_depends_on_geometry

gboolean _shape_t::area_depends_on_geometry

Definition at line 67 of file test_masks_raster_contract.c.

◆ functions

const dt_masks_functions_t* _shape_t::functions

Definition at line 62 of file test_masks_raster_contract.c.

Referenced by _empty_form().

◆ name

const char* _shape_t::name

Definition at line 60 of file test_masks_raster_contract.c.

◆ type

dt_masks_type_t _shape_t::type

Definition at line 61 of file test_masks_raster_contract.c.

Referenced by _empty_form().


The documentation for this struct was generated from the following file: