Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Krita Krita
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Bugzilla
    • Bugzilla
  • Merge requests 77
    • Merge requests 77
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • GraphicsGraphics
  • KritaKrita
  • Merge requests
  • !1437

452172: Fix painting on selection masks with various blending modes

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Mathias Wein requested to merge mwein/krita:bug-452172-mask-blending-modes into master Apr 30, 2022
  • Overview 2
  • Commits 3
  • Pipelines 3
  • Changes 51

This should allow painting on masks (such as transparency masks) with all blending modes available for Grayscale/Alpha, and also correctly display which modes are available.

Basically, all the prerequisites were there already, but actually using them failed in a few key places. It happened to work with Multiply for example, because the Alpha color space implements this composite op, but it has nothing to do with painting on a mask in multiply mode, since compositing paint strokes actually happens in Grayscale/Alpha.

I'm not sure if this is the most elegant solution, but just adding a ton of dummy ops to Alpha color space clearly felt like a hack, and with this solution, it also resolves a performance FIXME in KoColorSpace::bitBlt(), if used correctly. See commit messages for details.

Apologies for the long list of changes, I thought it's a good occasion to resolve another TODO and rename a KisPainter function touched here, turned out to be used in a lot of places...also, not even ccache is going to save you from a (nearly) full recompile.

Test Plan

Basically follow the instructions in BUG:452172

All blending modes of Grayscale/Alpha should work as expected to paint on masks. Also pay attention that the blending mode list correctly marks unavailable blending modes, and that the combo-box does not unexpectedly jump back to "Normal" anymore.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: bug-452172-mask-blending-modes