Chromium Code Reviews| Index: content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java |
| diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java |
| index 797d87273e2003a8d33d1c51c33e8d0a6d1ae8eb..aebd18e8edd89d2676af1b87e095edfcb097f3c0 100644 |
| --- a/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java |
| +++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewRenderView.java |
| @@ -8,6 +8,7 @@ import android.content.Context; |
| import android.graphics.Bitmap; |
| import android.graphics.Canvas; |
| import android.graphics.Color; |
| +import android.graphics.PixelFormat; |
| import android.os.Build; |
| import android.os.Handler; |
| import android.view.Surface; |
| @@ -61,6 +62,7 @@ public class ContentViewRenderView extends FrameLayout { |
| assert mNativeContentViewRenderView != 0; |
| mSurfaceView = createSurfaceView(getContext()); |
| + mSurfaceView.setZOrderMediaOverlay(true); |
| mSurfaceCallback = new SurfaceHolder.Callback() { |
| @Override |
| public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { |
| @@ -237,6 +239,15 @@ public class ContentViewRenderView extends FrameLayout { |
| return mSurfaceView.getHolder().getSurface() != null; |
| } |
| + /** |
| + * Enter or leave overlay video mode. |
|
Ted C
2013/12/26 23:06:15
Should have an:
@param enabled Whether overlay mo
|
| + */ |
| + public void setOverlayVideoMode(boolean enabled) { |
| + int format = enabled ? PixelFormat.TRANSLUCENT : PixelFormat.OPAQUE; |
| + mSurfaceView.getHolder().setFormat(format); |
| + nativeSetOverlayVideoMode(mNativeContentViewRenderView, enabled); |
| + } |
| + |
| @CalledByNative |
| private void requestRender() { |
| ContentViewCore contentViewCore = mCurrentContentView != null ? |
| @@ -311,4 +322,6 @@ public class ContentViewRenderView extends FrameLayout { |
| int width, int height); |
| private native boolean nativeComposite(long nativeContentViewRenderView); |
| private native boolean nativeCompositeToBitmap(long nativeContentViewRenderView, Bitmap bitmap); |
| + private native void nativeSetOverlayVideoMode(long nativeContentViewRenderView, |
| + boolean enabled); |
| } |