Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 148c5dad authored by Teng-Hui Zhu's avatar Teng-Hui Zhu Committed by Android (Google) Code Review
Browse files

Merge "Clean up Surface Texture on Java side"

parents 393acacd fdd646b2
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -92,6 +92,11 @@ public class HTML5VideoInline extends HTML5VideoView{

    @Override
    public void deleteSurfaceTexture() {
        cleanupSurfaceTexture();
        return;
    }

    public static void cleanupSurfaceTexture() {
        mSurfaceTexture = null;
        mVideoLayerUsingSurfaceTexture = -1;
        return;
+6 −0
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ import android.view.inputmethod.BaseInputConnection;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager;
import android.webkit.HTML5VideoInline;
import android.webkit.WebTextView.AutoCompleteAdapter;
import android.webkit.WebViewCore.DrawData;
import android.webkit.WebViewCore.EventHub;
@@ -842,6 +843,11 @@ public class WebView extends AbsoluteLayout
            if (DebugFlags.WEB_VIEW) {
                Log.d("WebView", "onTrimMemory: " + level);
            }
            // When framework reset EGL context during high memory pressure, all
            // the existing GL resources for the html5 video will be destroyed
            // at native side.
            // Here we just need to clean up the Surface Texture which is static.
            HTML5VideoInline.cleanupSurfaceTexture();
            WebView.nativeOnTrimMemory(level);
        }