Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #323 from axinging/XWALK_whitescreen_4809_4995
Browse files Browse the repository at this point in the history
[Android] Add SetBackgroundColor to avoid white screen on startup
  • Loading branch information
Raphael Kubo da Costa committed Mar 10, 2016
2 parents dfbc583 + 3ebfbeb commit 5c3da74
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions content/browser/android/content_view_core_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,11 @@ jint ContentViewCoreImpl::GetCurrentRenderProcessId(JNIEnv* env, jobject obj) {
web_contents_->GetRenderViewHost());
}

void ContentViewCoreImpl::SetBackgroundColor(JNIEnv* env, jobject jobj,
jint color) {
root_layer_->SetBackgroundColor(color);
}

void ContentViewCoreImpl::SetBackgroundOpaque(JNIEnv* env, jobject jobj,
jboolean opaque) {
if (GetRenderWidgetHostViewAndroid()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3256,6 +3256,12 @@ public void setSmartClipDataListener(SmartClipDataListener listener) {
mSmartClipDataListener = listener;
}

public void setBackgroundColor(int color) {
if (mNativeContentViewCore != 0) {
nativeSetBackgroundColor(mNativeContentViewCore, color);
}
}

public void setBackgroundOpaque(boolean opaque) {
if (mNativeContentViewCore != 0) {
nativeSetBackgroundOpaque(mNativeContentViewCore, opaque);
Expand Down Expand Up @@ -3470,5 +3476,7 @@ private native void nativeSetTextTrackSettings(long nativeContentViewCoreImpl,
private native void nativeExtractSmartClipData(long nativeContentViewCoreImpl,
int x, int y, int w, int h);

private native void nativeSetBackgroundColor(long nativeContentViewCoreImpl, int color);

private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl, boolean opaque);
}

0 comments on commit 5c3da74

Please sign in to comment.