enthought / enable

Enable: low-level drawing and interaction
Other
91 stars 45 forks source link

Celiagg and Image backend have different inital state #1047

Open corranwebster opened 1 year ago

corranwebster commented 1 year ago

It looks like the Celiagg backend starts out with a completely transparent image, but the Image/agg backend starts out filled with white. It looks like Quartz and Cairo also start out transparent, QPainter doesn't initialize to anything, so Agg is probably the odd-one out.

Celiagg initializes with zeros: https://github.com/enthought/enable/blob/0ae01f00da730bcc84821e7ab9eb394df777795e/kiva/celiagg.py#L112

Agg initializes with 255: https://github.com/enthought/enable/blob/0ae01f00da730bcc84821e7ab9eb394df777795e/kiva/agg/__init__.py#L38-L44

corranwebster commented 1 year ago

This is causing test failures for the Chaco test suite when run with non-agg backends: https://github.com/enthought/chaco/pull/891

corranwebster commented 1 year ago

Work-around is to explicitly call gc.clear() before drawing anything in tests.