android/source/src/java/org/mozilla/gecko/gfx/LayerView.java |   71 -----------
 1 file changed, 5 insertions(+), 66 deletions(-)

New commits:
commit 60e804f31cf2a9a3a36a4eb6551b7924253c479a
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Feb 17 08:59:13 2023 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Feb 17 12:06:41 2023 +0000

    android: Drop unused TextureView
    
    It's unused since
    
        commit 3860bff1013f9608b934c4cdb9ddb8d2dbbc3e52
        Date:   Fri Dec 19 16:25:23 2014 +0900
    
            android: never use TextureView for now (for performance reasons)
    
            Get align with latest Fennec code which also has this disabled.
    
            Change-Id: Ie4c27935bacd29218207e47593f073bdce0cf7e3
    
    Change-Id: I808ce73928120c10f4e3721a11b1e74bac3a413c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147196
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java 
b/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java
index 9d3502528670..c3f639ddf7d1 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java
@@ -11,14 +11,12 @@ import android.content.res.Resources;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
 import android.graphics.PixelFormat;
-import android.graphics.SurfaceTexture;
 import android.util.AttributeSet;
 import android.util.Log;
 import android.view.KeyEvent;
 import android.view.MotionEvent;
 import android.view.SurfaceHolder;
 import android.view.SurfaceView;
-import android.view.TextureView;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.inputmethod.EditorInfo;
@@ -54,7 +52,6 @@ public class LayerView extends FrameLayout {
     private boolean mFullScreen = false;
 
     private SurfaceView mSurfaceView;
-    private TextureView mTextureView;
 
     private Listener mListener;
     private OnInterceptTouchListener mTouchIntercepter;
@@ -67,41 +64,16 @@ public class LayerView extends FrameLayout {
     public static final int PAINT_BEFORE_FIRST = 1;
     public static final int PAINT_AFTER_FIRST = 2;
 
-    boolean shouldUseTextureView() {
-        // we can only use TextureView on ICS or higher
-        /*if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
-            Log.i(LOGTAG, "Not using TextureView: not on ICS+");
-            return false;
-        }
-
-        try {
-            // and then we can only use it if we have a hardware accelerated 
window
-            Method m = View.class.getMethod("isHardwareAccelerated", new 
Class[0]);
-            return (Boolean) m.invoke(this);
-        } catch (Exception e) {
-            Log.i(LOGTAG, "Not using TextureView: caught exception checking 
for hw accel: " + e.toString());
-            return false;
-        }*/
-        return false;
-    }
-
     public LayerView(Context context, AttributeSet attrs) {
         super(context, attrs);
         mContext = (LibreOfficeMainActivity) context;
 
-        if (shouldUseTextureView()) {
-            mTextureView = new TextureView(context);
-            mTextureView.setSurfaceTextureListener(new 
SurfaceTextureListener());
+        mSurfaceView = new SurfaceView(context);
+        addView(mSurfaceView, ViewGroup.LayoutParams.MATCH_PARENT, 
ViewGroup.LayoutParams.MATCH_PARENT);
 
-            addView(mTextureView, ViewGroup.LayoutParams.MATCH_PARENT, 
ViewGroup.LayoutParams.MATCH_PARENT);
-        } else {
-            mSurfaceView = new SurfaceView(context);
-            addView(mSurfaceView, ViewGroup.LayoutParams.MATCH_PARENT, 
ViewGroup.LayoutParams.MATCH_PARENT);
-
-            SurfaceHolder holder = mSurfaceView.getHolder();
-            holder.addCallback(new SurfaceListener());
+        SurfaceHolder holder = mSurfaceView.getHolder();
+        holder.addCallback(new SurfaceListener());
             holder.setFormat(PixelFormat.RGB_565);
-        }
 
         mGLController = new GLController(this);
     }
@@ -313,10 +285,7 @@ public class LayerView extends FrameLayout {
     }
 
     public Object getNativeWindow() {
-        if (mSurfaceView != null)
-            return mSurfaceView.getHolder();
-
-        return mTextureView.getSurfaceTexture();
+        return mSurfaceView.getHolder();
     }
 
     /** This function is invoked by Gecko (compositor thread) via JNI; be 
careful when modifying signature. */
@@ -364,29 +333,6 @@ public class LayerView extends FrameLayout {
         }
     }
 
-    private class SurfaceTextureListener implements 
TextureView.SurfaceTextureListener {
-        public void onSurfaceTextureAvailable(SurfaceTexture surface, int 
width, int height) {
-            // We don't do this for surfaceCreated above because it is always 
followed by a surfaceChanged,
-            // but that is not the case here.
-            if (mRenderControllerThread != null) {
-                mRenderControllerThread.surfaceCreated();
-            }
-            onSizeChanged(width, height);
-        }
-
-        public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
-            onDestroyed();
-            return true; // allow Android to call release() on the 
SurfaceTexture, we are done drawing to it
-        }
-
-        public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int 
width, int height) {
-            onSizeChanged(width, height);
-        }
-
-        public void onSurfaceTextureUpdated(SurfaceTexture surface) {
-        }
-    }
-
     private RenderControllerThread mRenderControllerThread;
 
     public synchronized void createGLThread() {
commit b60fc720d789602c6b5420365f4dcaa6cb17bf40
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Feb 17 08:55:33 2023 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Feb 17 12:06:31 2023 +0000

    android: Drop unused LayerView#isIMEEEnabled
    
    ... that always returns false anyway.
    
    (And the `InputConnectionHandler#isIMEEnabled`
    that would be called in the commented out code
    doesn't exist either.)
    
    Change-Id: I6031672ee2835c64a1efcab946574ca2ce94b6a1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147195
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java 
b/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java
index c9c5ca003297..9d3502528670 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java
@@ -219,13 +219,6 @@ public class LayerView extends FrameLayout {
         return mInputConnectionHandler != null && 
mInputConnectionHandler.onKeyUp(keyCode, event);
     }
 
-    public boolean isIMEEnabled() {
-        /*if (mInputConnectionHandler != null) {
-            return mInputConnectionHandler.isIMEEnabled();
-        }*/
-        return false;
-    }
-
     public void requestRender() {
         if (mListener != null) {
             mListener.renderRequested();

Reply via email to