Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4424)

Unified Diff: blimp/client/app/android/java/src/org/chromium/blimp/BlimpView.java

Issue 1925863003: Changed Blimp client to start with white screen before drawing contents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: blimp/client/app/android/java/src/org/chromium/blimp/BlimpView.java
diff --git a/blimp/client/app/android/java/src/org/chromium/blimp/BlimpView.java b/blimp/client/app/android/java/src/org/chromium/blimp/BlimpView.java
index 212d15db17a1b7d194ef1ba018f79d0cd08b9da8..8df52f596b2490d646829386b82fe916adc1020b 100644
--- a/blimp/client/app/android/java/src/org/chromium/blimp/BlimpView.java
+++ b/blimp/client/app/android/java/src/org/chromium/blimp/BlimpView.java
@@ -5,6 +5,7 @@
package org.chromium.blimp;
import android.content.Context;
+import android.graphics.Color;
import android.graphics.Point;
import android.os.Build;
import android.util.AttributeSet;
@@ -14,6 +15,7 @@ import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.WindowManager;
+import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.blimp.session.BlimpClientSession;
@@ -57,6 +59,7 @@ public class BlimpView extends SurfaceView implements SurfaceHolder.Callback {
mNativeBlimpViewPtr = nativeInit(blimpClientSession, physicalSize.x, physicalSize.y,
displaySize.x, displaySize.y, deviceScaleFactor);
getHolder().addCallback(this);
+ setBackgroundColor(Color.WHITE);
setVisibility(VISIBLE);
}
@@ -172,6 +175,18 @@ public class BlimpView extends SurfaceView implements SurfaceHolder.Callback {
|| eventAction == MotionEvent.ACTION_POINTER_UP;
}
+ @CalledByNative
+ public void onSwapBuffersCompleted() {
+ if (getBackground() != null) {
+ post(new Runnable() {
Khushal 2016/04/28 03:32:26 Is there a reason why this is done as a separate t
shaktisahu 2016/04/28 21:38:15 Done. It's better to remove this since we are cert
Khushal 2016/04/28 21:45:35 I actually asked yusuf@ about this and he said its
+ @Override
+ public void run() {
+ setBackgroundResource(0);
+ }
+ });
+ }
+ }
+
// Native Methods
private native long nativeInit(BlimpClientSession blimpClientSession, int physicalWidth,
int physicalHeight, int displayWidth, int displayHeight, float dpToPixel);

Powered by Google App Engine
This is Rietveld 408576698