Skip to content

Created a shader for drawing brush tool outline.

Emmet O'Neill requested to merge (removed):gl/toolshader into master

Made a new GLSL shader for drawing the brush tool's preview outline. The canvas is rendered to a texture (FBO) which is used as a uniform input in the outline shader.

(Note: Right now the shader is called xorshader but it seems as if GLSL doesn't support bitwise XOR, so we're currently just multiplying the user-configurable input color against the inverted canvas texel color.)

Hopefully this should help us move to Angle by default on Windows. =] See: https://bugs.kde.org/show_bug.cgi?id=415772

(Pair programmed with Eoin.)

Test Plan

Please help test to make sure that the addition of this shader and extra render to texture stage doesn't negatively impact performance or memory. In addition, make sure that the brush preview outline is sufficiently visible over all kinds of different colors.

We could also use a quick glance at the OpenGL state juggling to make sure we aren't doing anything wasteful or leaving anything important out!

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.
Edited by Emmet O'Neill

Merge request reports