Commit c1c99e94 authored by Bo Liu's avatar Bo Liu Committed by Commit Bot

weblayer: Fix fullscreen video

The compositor surface is opaque, which means when video is lifted
into a separate surface during fullscreen below the compositor
surface, it is never showing through.

Always set the compositor surface to translucent for now, which will
use more memory even when not in fullscreen.

Bug: 1022042
Change-Id: I2ff368dfa2a04ba0e62891039244c0bcb148e6fb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899901Reviewed-by: default avatarFrank Liberato <liberato@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713178}
parent 23e61bb4
...@@ -6,6 +6,7 @@ package org.chromium.weblayer_private; ...@@ -6,6 +6,7 @@ package org.chromium.weblayer_private;
import android.content.Context; import android.content.Context;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.PixelFormat;
import android.graphics.SurfaceTexture; import android.graphics.SurfaceTexture;
import android.view.Surface; import android.view.Surface;
import android.view.SurfaceHolder; import android.view.SurfaceHolder;
...@@ -193,6 +194,10 @@ public class ContentViewRenderView extends FrameLayout { ...@@ -193,6 +194,10 @@ public class ContentViewRenderView extends FrameLayout {
mSurfaceView.getHolder().addCallback(mSurfaceCallback); mSurfaceView.getHolder().addCallback(mSurfaceCallback);
mSurfaceView.setVisibility(View.VISIBLE); mSurfaceView.setVisibility(View.VISIBLE);
// TODO(boliu): This is only needed when video is lifted into a separate surface.
// Keeping this constantly will use one more byte per pixel constantly.
mSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
mTextureView = null; mTextureView = null;
mSurfaceTextureListener = null; mSurfaceTextureListener = null;
} else if (mode == MODE_TEXTURE_VIEW) { } else if (mode == MODE_TEXTURE_VIEW) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment