summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2015-04-28 17:15:57 -0700
committerSteve Kondik <steve@cyngn.com>2015-05-12 12:57:52 -0700
commit6d95355be30c41a919a25528d000777cf07c9552 (patch)
tree59a71b6d3c44eafe40956d484e87fae07a0973f9
parente2aeea56589be46cd147910ef4909f7635c33397 (diff)
downloadandroid_frameworks_native-6d95355be30c41a919a25528d000777cf07c9552.tar.gz
android_frameworks_native-6d95355be30c41a919a25528d000777cf07c9552.tar.bz2
android_frameworks_native-6d95355be30c41a919a25528d000777cf07c9552.zip
Remove gamma correction from color correction shader
Gamma correction was incorrectly skewing both color inversion and Daltonization, which resulted in washed-out colors. Bug: 20346301 Change-Id: I34d879f902c3be115b2d23f09c3ed3902799759e (cherry picked from commit 3acd9f1d8fdffc0ed0837ebbabcac0c4014015b3)
-rw-r--r--services/surfaceflinger/RenderEngine/ProgramCache.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/services/surfaceflinger/RenderEngine/ProgramCache.cpp b/services/surfaceflinger/RenderEngine/ProgramCache.cpp
index 3e66c4bc7..33ff7d0c9 100644
--- a/services/surfaceflinger/RenderEngine/ProgramCache.cpp
+++ b/services/surfaceflinger/RenderEngine/ProgramCache.cpp
@@ -237,10 +237,8 @@ String8 ProgramCache::generateFragmentShader(const Key& needs) {
// un-premultiply if needed before linearization
fs << "gl_FragColor.rgb = gl_FragColor.rgb/gl_FragColor.a;";
}
- fs << "gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(2.2));";
fs << "vec4 transformed = colorMatrix * vec4(gl_FragColor.rgb, 1);";
fs << "gl_FragColor.rgb = transformed.rgb/transformed.a;";
- fs << "gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(1.0 / 2.2));";
if (!needs.isOpaque() && needs.isPremultiplied()) {
// and re-premultiply if needed after gamma correction
fs << "gl_FragColor.rgb = gl_FragColor.rgb*gl_FragColor.a;";