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
diff --git a/services/surfaceflinger/RenderEngine/ProgramCache.h b/services/surfaceflinger/RenderEngine/ProgramCache.h
index fcbeffd..e8b9dcd 100644
--- a/services/surfaceflinger/RenderEngine/ProgramCache.h
+++ b/services/surfaceflinger/RenderEngine/ProgramCache.h
@@ -65,6 +65,10 @@
             TEXTURE_EXT             =       0x00000008,
             TEXTURE_2D              =       0x00000010,
             TEXTURE_MASK            =       0x00000018,
+
+            COLOR_MATRIX_OFF        =       0x00000000,
+            COLOR_MATRIX_ON         =       0x00000020,
+            COLOR_MATRIX_MASK       =       0x00000020,
         };
 
         inline Key() : mKey(0) { }
@@ -90,6 +94,9 @@
         inline bool hasPlaneAlpha() const {
             return (mKey & PLANE_ALPHA_MASK) == PLANE_ALPHA_LT_ONE;
         }
+        inline bool hasColorMatrix() const {
+            return (mKey & COLOR_MATRIX_MASK) == COLOR_MATRIX_ON;
+        }
 
         // this is the definition of a friend function -- not a method of class Needs
         friend inline int strictly_order_type(const Key& lhs, const Key& rhs) {