commit f44ea59108e330bf5bdad00f66f77f1dcb790570
Author: Leszek Koltunski <leszek@distoretedandroid.org>
Date:   Wed Jan 18 17:03:52 2017 +0000

    Debugging

diff --git a/src/main/java/org/distorted/library/DistortedEffects.java b/src/main/java/org/distorted/library/DistortedEffects.java
index b4decac..9da288b 100644
--- a/src/main/java/org/distorted/library/DistortedEffects.java
+++ b/src/main/java/org/distorted/library/DistortedEffects.java
@@ -86,6 +86,8 @@ public class DistortedEffects
 
   private boolean matrixCloned, vertexCloned, fragmentCloned, postprocessCloned;
 
+private int mL, mR, mT, mB;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
   static void createProgram(Resources resources)
@@ -191,6 +193,8 @@ public class DistortedEffects
     int maxy = Integer.MIN_VALUE;
     int wx,wy;
 
+int l=-1,r=-1,t=-1,b=-1;
+
     float x,y,z, X,Y,W, ndcX,ndcY;
 
     for(int i=0; i<len; i++)
@@ -209,10 +213,10 @@ public class DistortedEffects
       wx = (int)(df.mWidth *(ndcX+1)/2);
       wy = (int)(df.mHeight*(ndcY+1)/2);
 
-      if( wx<minx ) minx = wx;
-      if( wx>maxx ) maxx = wx;
-      if( wy<miny ) miny = wy;
-      if( wy>maxy ) maxy = wy;
+      if( wx<minx ) { minx = wx; l = i; }
+      if( wx>maxx ) { maxx = wx; r = i; }
+      if( wy<miny ) { miny = wy; t = i; }
+      if( wy>maxy ) { maxy = wy; b = i; }
       }
 
     mDebugProgram.useProgram();
@@ -232,6 +236,12 @@ public class DistortedEffects
 
     GLES20.glVertexAttribPointer(mDebugProgram.mAttribute[0], 2, GLES20.GL_FLOAT, false, 0, mQuadPositions);
     GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
+
+    if( l!=mL )
+      {
+      mL = l;
+      android.util.Log.e("effects", "l="+l+" ("+vertices[3*l]+","+vertices[3*l+1]+","+vertices[3*l+2]+")");
+      }
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
