Merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/night-shader into lp:ubuntu-docviewer-app

Proposed by Stefano Verzegnassi
Status: Merged
Approved by: Stefano Verzegnassi
Approved revision: 260
Merged at revision: 263
Proposed branch: lp:~verzegnassi-stefano/ubuntu-docviewer-app/night-shader
Merge into: lp:ubuntu-docviewer-app
Diff against target: 25 lines (+5/-5)
1 file modified
src/app/qml/common/NightModeShader.qml (+5/-5)
To merge this branch: bzr merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/night-shader
Reviewer Review Type Date Requested Status
Jenkins Bot continuous-integration Approve
Alan Pope 🍺🐧🐱 πŸ¦„ (community) Approve
Review via email: mp+282041@code.launchpad.net

Commit message

Night shader updated

Description of the change

Night shader updated

Some screenshot: https://imgur.com/a/xUk8B
(left: old shader - right: new one)

List of changes:
* Use a standard greyscale formula (from NTSC and PAL specs)
  The difference is not visible though, but the previous values were only found in Qt examples (therefore not standard).

* Colors in the [0...255] range are now compressed into a [26...230] range.
* Colors between [204 and 230] are clipped to 204.

Recently I've tested the night mode with no ambient light.
Even if the amount of white is sensibly reduced by inverting the colors, I found the pure black (RGB 0,0,0) too bright.
Also, I found annoying to scroll a document with images, since the amount of white (or anyway light colors) was a bit high on average. With a further clipping of light tones, reading a document seems to be less tiring.

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Loving this change. It's quite a difference not having the stark blacks. Thanks!

review: Approve
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://core-apps-jenkins.ubuntu.com/job/run-ap-tests-autolanding/37/
Executed test runs:
    None: https://core-apps-jenkins.ubuntu.com/job/generic-land-mp/1438/console

review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://core-apps-jenkins.ubuntu.com/job/docviewer-app-autolanding/44/
Executed test runs:
    None: https://core-apps-jenkins.ubuntu.com/job/generic-land-mp/1453/console

review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/qml/common/NightModeShader.qml'
2--- src/app/qml/common/NightModeShader.qml 2015-10-10 12:03:30 +0000
3+++ src/app/qml/common/NightModeShader.qml 2016-01-08 18:01:24 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright (C) 2015 Canonical, Ltd.
7+ * Copyright (C) 2015, 2016 Stefano Verzegnassi
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11@@ -24,10 +24,10 @@
12
13 void main() {
14 lowp vec4 p = texture2D(source, qt_TexCoord0);
15- p.r = 1.0 - p.r;
16- p.g = 1.0 - p.g;
17- p.b = 1.0 - p.b;
18- gl_FragColor = vec4(vec3(dot(p.rgb, vec3(0.344, 0.5, 0.156))), p.a) * qt_Opacity;
19+ p.r = min(0.8, (1.0 - p.r) * 0.8 + 0.1);
20+ p.g = min(0.8, (1.0 - p.g) * 0.8 + 0.1);
21+ p.b = min(0.8, (1.0 - p.b) * 0.8 + 0.1);
22+ gl_FragColor = vec4(vec3(dot(p.rgb, vec3(0.299, 0.587, 0.114))), p.a) * qt_Opacity;
23 }
24 "
25 }

Subscribers

People subscribed via source and target branches