Skip to content

Commit c733a79

Browse files
author
Ruei-sung Lin
committed
Fix b/7087723 Patch leftover after tapping the red eye area
Change-Id: I06f5c491b09cf13698f001e8b11f42506fda5bbd
1 parent f4fd2eb commit c733a79

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

media/mca/filterpacks/java/android/filterpacks/imageproc/RedEyeFilter.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ public class RedEyeFilter extends Filter {
7272
"void main() {\n" +
7373
" vec4 color = texture2D(tex_sampler_0, v_texcoord);\n" +
7474
" vec4 mask = texture2D(tex_sampler_1, v_texcoord);\n" +
75-
" gl_FragColor = vec4(mask.a, mask.a, mask.a, 1.0) * intensity + color * (1.0 - intensity);\n" +
7675
" if (mask.a > 0.0) {\n" +
77-
" gl_FragColor.r = 0.0;\n" +
7876
" float green_blue = color.g + color.b;\n" +
7977
" float red_intensity = color.r / green_blue;\n" +
8078
" if (red_intensity > intensity) {\n" +
@@ -105,8 +103,8 @@ public void initProgram(FilterContext context, int target) {
105103
ShaderProgram shaderProgram = new ShaderProgram(context, mRedEyeShader);
106104
shaderProgram.setMaximumTileSize(mTileSize);
107105
mProgram = shaderProgram;
106+
mProgram.setHostValue("intensity", DEFAULT_RED_INTENSITY);
108107
break;
109-
110108
default:
111109
throw new RuntimeException("Filter RedEye does not support frames of " +
112110
"target " + target + "!");
@@ -180,8 +178,6 @@ private void createRedEyeFrame(FilterContext context) {
180178
}
181179

182180
private void updateProgramParams() {
183-
mProgram.setHostValue("intensity", DEFAULT_RED_INTENSITY);
184-
185181
if ( mCenters.length % 2 == 1) {
186182
throw new RuntimeException("The size of center array must be even.");
187183
}

0 commit comments

Comments
 (0)