summaryrefslogtreecommitdiff
path: root/libs/hwui/ProgramCache.cpp
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2013-04-08 19:45:40 -0700
committerRomain Guy <romainguy@google.com>2013-04-09 10:12:47 -0700
commit032d47af737d803e841ab79f38ac9068a46c9aeb (patch)
treec3428ff4c80f1274cd4a1ada4567ab1ed940c1b5 /libs/hwui/ProgramCache.cpp
parent50b9eb1c7375a87525d44a036337a8ba18eba55b (diff)
Change the dither texture's swizzling
This is a more elegant way to sample from a float alpha texture. Instead of sampling from the red channel in the fragment shader we can set the alpha channel swizzle to redirect it to the red channel. This lets us sample from the alpha channel in the fragment shader and get the correct value. Change-Id: I95bbf7a82964e1bf42c0fee1b782b6bdbbcef618
Diffstat (limited to 'libs/hwui/ProgramCache.cpp')
-rw-r--r--libs/hwui/ProgramCache.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/hwui/ProgramCache.cpp b/libs/hwui/ProgramCache.cpp
index 2479630daea5..8eb85e5547eb 100644
--- a/libs/hwui/ProgramCache.cpp
+++ b/libs/hwui/ProgramCache.cpp
@@ -186,7 +186,7 @@ const char* gFS_Main_Dither[2] = {
// ES 2.0
"texture2D(ditherSampler, ditherTexCoords).a * " STR(DITHER_KERNEL_SIZE_INV_SQUARE),
// ES 3.0
- "texture2D(ditherSampler, ditherTexCoords).r"
+ "texture2D(ditherSampler, ditherTexCoords).a"
};
const char* gFS_Main_AddDitherToGradient =
" gradientColor += %s;\n";