summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/RenderEngine/Description.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2013-09-01 21:36:12 -0700
committerMathias Agopian <mathias@google.com>2013-09-04 22:11:15 -0700
commitff2ed70fa30f04b90dd1a2c06ec2319e157152d7 (patch)
treece07917c9844239d37b000afd2518b08028ed8be /services/surfaceflinger/RenderEngine/Description.cpp
parent1d4d8f94e2989b7c8667602304df9059d2701653 (diff)
downloadframeworks_native-ff2ed70fa30f04b90dd1a2c06ec2319e157152d7.zip
frameworks_native-ff2ed70fa30f04b90dd1a2c06ec2319e157152d7.tar.gz
frameworks_native-ff2ed70fa30f04b90dd1a2c06ec2319e157152d7.tar.bz2
color blindness enhancement
This is an attempt at improving the experience of users with color vision impairement. At this time this feature can only be enabled for debugging: adb shell service call SurfaceFlinger 1014 i32 PARAM with PARAM: 0 : disabled 1 : protanomaly/protanopia simulation 2 : deuteranomaly/deuteranopia simulation 3 : tritanopia/tritanomaly simulation 11, 12, 13: same as above w/ attempted correction/enhancement The enhancement algorithm tries to spread the "error" such that tones that would otherwise appear similar can be distinguished. Bug: 9465644 Change-Id: I860f7eed0cb81f54ef9cf24ad78155b6395ade48
Diffstat (limited to 'services/surfaceflinger/RenderEngine/Description.cpp')
-rw-r--r--services/surfaceflinger/RenderEngine/Description.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/services/surfaceflinger/RenderEngine/Description.cpp b/services/surfaceflinger/RenderEngine/Description.cpp
index b0325c6..1adcd1f 100644
--- a/services/surfaceflinger/RenderEngine/Description.cpp
+++ b/services/surfaceflinger/RenderEngine/Description.cpp
@@ -29,9 +29,10 @@ namespace android {
Description::Description() :
mUniformsDirty(true) {
mPlaneAlpha = 1.0f;
- mPremultipliedAlpha = true;
+ mPremultipliedAlpha = false;
mOpaque = true;
mTextureEnabled = false;
+ mColorMatrixEnabled = false;
memset(mColor, 0, sizeof(mColor));
}
@@ -81,4 +82,11 @@ void Description::setProjectionMatrix(const mat4& mtx) {
mUniformsDirty = true;
}
+void Description::setColorMatrix(const mat4& mtx) {
+ const mat4 identity;
+ mColorMatrix = mtx;
+ mColorMatrixEnabled = (mtx != identity);
+}
+
+
} /* namespace android */