Improve BaseFilter

egloo2
Mattia Iavarone 5 years ago
parent e65b7a33c0
commit 01cf05cfa6
  1. 12
      cameraview/src/main/java/com/otaliastudios/cameraview/filter/BaseFilter.java

@ -89,7 +89,7 @@ public abstract class BaseFilter implements Filter {
}
@VisibleForTesting GlTextureProgram program = null;
private final GlDrawable programDrawable = new GlRect();
private GlDrawable programDrawable = null;
@VisibleForTesting Size size;
@SuppressWarnings("WeakerAccess")
@ -121,17 +121,12 @@ public abstract class BaseFilter implements Filter {
@Override
public void onCreate(int programHandle) {
program = onCreateProgram(programHandle);
}
@SuppressWarnings("WeakerAccess")
@NonNull
protected GlTextureProgram onCreateProgram(int programHandle) {
return new GlTextureProgram(programHandle,
program = new GlTextureProgram(programHandle,
vertexPositionName,
vertexModelViewProjectionMatrixName,
vertexTextureCoordinateName,
vertexTransformMatrixName);
programDrawable = new GlRect();
}
@Override
@ -142,6 +137,7 @@ public abstract class BaseFilter implements Filter {
// would cause an error.
program.release();
program = null;
programDrawable = null;
}
@NonNull

Loading…
Cancel
Save