Bug 362600

Summary: Incorrect hue values of the colours displayed by Krita (splashscreen/interface/canvas) while using mesa
Product: [Applications] krita Reporter: LeStr4wberry <strawberry>
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: halla, osxyz, strawberry
Priority: NOR Keywords: regression
Version: 3.0 Beta   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
URL: http://imgur.com/iiBSNOT
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description LeStr4wberry 2016-05-02 19:17:01 UTC
What is the problem: 
When using the most recent mesa drivers (Mesa 11.3.0-devel) the hue values of the colours displayed by Krita, including the overview window and the splash screen, seem to have been swapped. The whites/black/grays are not affected. The way the canvas is affected depends on whether or not the OpenGL is turned on. 

Canvas behaviour with OpenGL turned on: 
- when an existing image is opened, the colours are displayed correctly, but the overview window has their hue value swapped. The colour selector tool displays the opposite colour from the one on the canvas (but if one attempts to paint with the chosen colour, it is actually the right one; i.e. you pick a blue colour, the selector tool seems to have picked a reddish colour, but if you draw a line, it is in fact blue). 
- if you pick colours via the colour selector dockers, you end up painting with a colour opposite in hue from the intended one.
Screenshot: 
http://imgur.com/RAKiVs5

Canvas behaviour with OpenGL turned off:
- when an existing image is opened, the colors are "swapped". Everything else happens exactly the same as when OpenGL is turned on.
Screenshots: 
http://imgur.com/HhTBvTN
http://imgur.com/rjcpAIm

Is OCIO enabled: no, enabling/disabling doesn't affect the issue in any way.

Krita versions affected: only the appimage alpha/beta releases. The most recent stable release (2.9.11) displays colours correctly. 

Is any other software affected?:  No, as far as I can tell. Tested: GIMP/Pixeluvo/MyPaint/Inkscape/Karbon/etc..

Reproducible: Always

Steps to Reproduce:
1. Fresh install.
2. Install drivers from either the Oibaf or Padoka repository.
3. Start Krita (an appimage version).

Executing ppa-purge restores the colours to normal.

Actual Results:  
The hue values of colours displayed is the opposite from the correct one.

Expected Results:  
Correctly display colours.

System specs:
CPU: Pentium G2030
GPU: AMD HD 7770
RAM: 8GB
System: Xubuntu 15.10
Kernel: 4.5.0-040500-generic
Drivers: open source
OpenGL renderer string: Gallium 0.4 on AMD CAPE VERDE (DRM 2.43.0, LLVM 3.9.0)
OpenGL core profile version string: 4.2 (Core Profile) Mesa 11.3.0-devel (padoka PPA)

The issue started occuring roughly at the time when the drivers in the Oibaf and Padoka repositories started shipping Mesa 11.3.0-devel. It is present both when using the drivers from the Oibaf repository and the Padoka repository. Sadly, I don't have enough time to compile mesa from git to check for issues there.
Comment 1 Halla Rempt 2016-05-18 21:28:44 UTC
Er...

I doubt this is a bug in Krita! The splash screen is drawn by Qt, and so is the image in the overview window. The actual effect looks like an old-fashioned endianness issue... It could be a problem with the appimages, in that they're built on CentOS 6.7, though I wouldn't know how I could fix that then. Did you also report the issue to the people behind those ppa's you mention?
Comment 2 Halla Rempt 2016-06-16 12:52:50 UTC
I'm sorry, but this isn't something we control.
Comment 3 LeStr4wberry 2016-06-18 18:43:21 UTC
This seems something to be strictly tied to mesa 11.3, after all. After upgrading to 12.1, the issue is gone on all of my AMD machines.

I apologize for the belated report, I was dealing with a hellish client breathing down my neck and didn't dare to tweak my settings lest I mess something up at the least appropriate moment ...
Comment 4 Halla Rempt 2016-06-18 20:09:45 UTC
Don't worry! I know the feeling!