commit d58b50e7d0186f7a8d0a7e4cb2a7aacb959439df
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Mon Mar 2 16:11:44 2020 +0000

    Remove width & height from InternalSurface and move it to InternalOutputSurface.

diff --git a/src/main/java/org/distorted/library/main/DistortedNode.java b/src/main/java/org/distorted/library/main/DistortedNode.java
index b004b2d..316e6db 100644
--- a/src/main/java/org/distorted/library/main/DistortedNode.java
+++ b/src/main/java/org/distorted/library/main/DistortedNode.java
@@ -313,13 +313,15 @@ public class DistortedNode implements InternalChildrenList.Parent
         }
       else if( node.mSurface instanceof DistortedFramebuffer )
         {
-        int w = node.mSurface.getWidth();
-        int h = node.mSurface.getHeight();
+        DistortedFramebuffer fbo = (DistortedFramebuffer)node.mSurface;
+
+        int w = fbo.getWidth();
+        int h = fbo.getHeight();
         int depthStencil = DistortedFramebuffer.NO_DEPTH_NO_STENCIL;
 
-        if( ((DistortedFramebuffer) node.mSurface).hasDepth() )
+        if( fbo.hasDepth() )
           {
-          boolean hasStencil = ((DistortedFramebuffer) node.mSurface).hasStencil();
+          boolean hasStencil = fbo.hasStencil();
           depthStencil = (hasStencil ? DistortedFramebuffer.BOTH_DEPTH_STENCIL:DistortedFramebuffer.DEPTH_NO_STENCIL);
           }
 
diff --git a/src/main/java/org/distorted/library/main/DistortedTexture.java b/src/main/java/org/distorted/library/main/DistortedTexture.java
index 62637ff..939e041 100644
--- a/src/main/java/org/distorted/library/main/DistortedTexture.java
+++ b/src/main/java/org/distorted/library/main/DistortedTexture.java
@@ -115,7 +115,7 @@ public class DistortedTexture extends InternalSurface
 
   public DistortedTexture(int type)
     {
-    super(0,0,NOT_CREATED_YET,1,1,type);
+    super(NOT_CREATED_YET,1,1,type);
     mBmp= null;
     }
 
@@ -157,10 +157,7 @@ public class DistortedTexture extends InternalSurface
  */
   public void setTexture(Bitmap bmp)
     {
-    mBmp   = bmp;
-    mWidth = bmp.getWidth();
-    mHeight= bmp.getHeight();
-
+    mBmp= bmp;
     markForCreation();
     }
 
@@ -176,12 +173,9 @@ public class DistortedTexture extends InternalSurface
     paint.setColor(argb);
     paint.setStyle(Paint.Style.FILL);
 
-    mWidth = 1;
-    mHeight= 1;
-
-    mBmp = Bitmap.createBitmap(mWidth,mHeight, Bitmap.Config.ARGB_8888);
+    mBmp = Bitmap.createBitmap(1,1, Bitmap.Config.ARGB_8888);
     Canvas canvas = new Canvas(mBmp);
-    canvas.drawRect(0,0,mWidth,mHeight,paint);
+    canvas.drawRect(0,0,1,1,paint);
 
     markForCreation();
     }
diff --git a/src/main/java/org/distorted/library/main/InternalOutputSurface.java b/src/main/java/org/distorted/library/main/InternalOutputSurface.java
index e756621..029b577 100644
--- a/src/main/java/org/distorted/library/main/InternalOutputSurface.java
+++ b/src/main/java/org/distorted/library/main/InternalOutputSurface.java
@@ -45,6 +45,7 @@ public abstract class InternalOutputSurface extends InternalSurface implements I
   int mRealWidth;   // the Surface can be backed up by a texture larger than the viewport we have to it.
   int mRealHeight;  // mWidth,mHeight are the sizes of the Viewport, those - sizes of the backing up texture.
   int mCurrFBO;     // internal current FBO (see DistortedLibrary.FBO_QUEUE_SIZE)
+  int mWidth, mHeight;
 
   private static DistortedFramebuffer[] mBuffer=null; // Global buffers used for postprocessing.
   private long[] mTime;
@@ -57,7 +58,7 @@ public abstract class InternalOutputSurface extends InternalSurface implements I
 
   InternalOutputSurface(int width, int height, int createColor, int numfbos, int numcolors, int depthStencil, int fbo, int type)
     {
-    super(width,height,createColor,numfbos,numcolors,type);
+    super(createColor,numfbos,numcolors,type);
 
     mRenderWayOIT = false;
     mCurrFBO      = 0;
@@ -68,8 +69,8 @@ public abstract class InternalOutputSurface extends InternalSurface implements I
     mTime = new long[numfbos];
     for(int i=0; i<mNumFBOs;i++) mTime[i]=0;
 
-    mRealWidth = width;
-    mRealHeight= height;
+    mRealWidth = mWidth = width;
+    mRealHeight= mHeight= height;
 
     mProjectionMatrix = new float[16];
 
@@ -936,4 +937,26 @@ public void setOrderIndependentTransparency(boolean oit, float initialSize)
     {
     mChildren.detachAll();
     }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+/**
+ * Return the width of this Surface.
+ *
+ * @return width of the Object, in pixels.
+ */
+  public int getWidth()
+    {
+    return mWidth;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+/**
+ * Return the height of this Surface.
+ *
+ * @return height of the Object, in pixels.
+ */
+  public int getHeight()
+    {
+    return mHeight;
+    }
 }
diff --git a/src/main/java/org/distorted/library/main/InternalSurface.java b/src/main/java/org/distorted/library/main/InternalSurface.java
index 06e65a2..9afa40d 100644
--- a/src/main/java/org/distorted/library/main/InternalSurface.java
+++ b/src/main/java/org/distorted/library/main/InternalSurface.java
@@ -29,18 +29,15 @@ abstract class InternalSurface extends InternalObject
   int mNumColors;
   int mNumFBOs;
   int[] mColorH;
-  int mWidth, mHeight;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  InternalSurface(int width, int height, int create, int numfbos, int numcolors, int type)
+  InternalSurface(int create, int numfbos, int numcolors, int type)
     {
     super(type);
 
     mNumFBOs      = numfbos;
     mNumColors    = numcolors;
-    mWidth        = width ;
-    mHeight       = height;
     mColorCreated = create;
 
     int total = mNumFBOs*mNumColors;
@@ -57,33 +54,11 @@ abstract class InternalSurface extends InternalObject
 
   String printDetails()
     {
-    return getClass().getSimpleName()+" "+mWidth+"x"+mHeight;
+    return getClass().getSimpleName();
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // PUBLIC API
-///////////////////////////////////////////////////////////////////////////////////////////////////
-/**
- * Return the width of this Surface.
- *
- * @return width of the Object, in pixels.
- */
-  public int getWidth()
-    {
-    return mWidth;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-/**
- * Return the height of this Surface.
- *
- * @return height of the Object, in pixels.
- */
-  public int getHeight()
-    {
-    return mHeight;
-    }
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Bind the underlying rectangle of pixels as a OpenGL Texture.
