Skip to content

Use the correct color space to reset the cache in generator layer

Maciej Jesionowski requested to merge yavn/krita:fix-gradient-crash into master

This fixes the crash uncovered by b84ea913

It can be observed like this:

  1. Create a new document
  2. Add a new fill layer
  3. Switch to Gradient -- the application will crash

(For me the properties dialog starts in Color mode, and it crashes when I switch to Gradient).

Explanation:

If we get the color space from the paint device, it will return an incorrect value.
For example, it will be A/U8 instead of RGBA/U8. Then something else gets messed up and eventually KoColorSpace will fail to find a suitable dithering op and trigger an assert because the color depths will be different.

Edited by Maciej Jesionowski

Merge request reports