| 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 0ecee71b94aa7a52280e0ee4dfcac6dd6c570379..5e0bb3ebf3c1a281582fa165dd6ec55742937450 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
|
| @@ -60,8 +60,6 @@ public class ContentViewRenderView extends FrameLayout {
|
| mNativeContentViewRenderView = nativeInit(rootWindow.getNativePointer());
|
| assert mNativeContentViewRenderView != 0;
|
|
|
| - setBackgroundColor(Color.WHITE);
|
| -
|
| mSurfaceView = createSurfaceView(getContext());
|
| mSurfaceCallback = new SurfaceHolder.Callback() {
|
| @Override
|
| @@ -88,6 +86,7 @@ public class ContentViewRenderView extends FrameLayout {
|
| }
|
| };
|
| mSurfaceView.getHolder().addCallback(mSurfaceCallback);
|
| + setSurfaceViewBackgroundColor(Color.WHITE);
|
|
|
| mVSyncAdapter = new VSyncAdapter(getContext());
|
| addView(mSurfaceView,
|
| @@ -161,6 +160,18 @@ public class ContentViewRenderView extends FrameLayout {
|
| }
|
|
|
| /**
|
| + * Sets the background color of the surface view. This method is necessary because the
|
| + * background color of ContentViewRenderView itself is covered by the background of
|
| + * SurfaceView.
|
| + * @param color The color of the background.
|
| + */
|
| + public void setSurfaceViewBackgroundColor(int color) {
|
| + if (mSurfaceView != null) {
|
| + mSurfaceView.setBackgroundColor(color);
|
| + }
|
| + }
|
| +
|
| + /**
|
| * Should be called when the ContentViewRenderView is not needed anymore so its associated
|
| * native resource can be freed.
|
| */
|
| @@ -279,11 +290,11 @@ public class ContentViewRenderView extends FrameLayout {
|
| boolean didDraw = nativeComposite(mNativeContentViewRenderView);
|
| if (didDraw) {
|
| mPendingSwapBuffers++;
|
| - if (getBackground() != null) {
|
| + if (mSurfaceView.getBackground() != null) {
|
| post(new Runnable() {
|
| @Override
|
| public void run() {
|
| - setBackgroundResource(0);
|
| + mSurfaceView.setBackgroundResource(0);
|
| }
|
| });
|
| }
|
|
|