summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2023-02-17 08:59:13 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2023-02-17 12:06:41 +0000
commit60e804f31cf2a9a3a36a4eb6551b7924253c479a (patch)
tree3228fc77a0cc4d1e62c6d0e141ea7c5fcd9f68c9 /android
parentb60fc720d789602c6b5420365f4dcaa6cb17bf40 (diff)
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.weghorn@posteo.de>
Diffstat (limited to 'android')
-rw-r--r--android/source/src/java/org/mozilla/gecko/gfx/LayerView.java64
1 files changed, 5 insertions, 59 deletions
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() {