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

Unified Diff: remoting/android/java/src/org/chromium/chromoting/cardboard/CardboardRenderer.java

Issue 1342883002: Fix the problem that VR desktop take a while to draw and black background of menu bar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/android/java/src/org/chromium/chromoting/cardboard/CardboardRenderer.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/cardboard/CardboardRenderer.java b/remoting/android/java/src/org/chromium/chromoting/cardboard/CardboardRenderer.java
index de3df39ed903c4b082c178a5626291d082523831..771819af4cb20b17762de9ad06a920f565bc95bf 100644
--- a/remoting/android/java/src/org/chromium/chromoting/cardboard/CardboardRenderer.java
+++ b/remoting/android/java/src/org/chromium/chromoting/cardboard/CardboardRenderer.java
@@ -102,13 +102,18 @@ public class CardboardRenderer implements CardboardView.StereoRenderer {
mForwardVector = new float[3];
}
- // This can be called on any thread.
- public void attachRedrawCallback() {
- JniInterface.provideRedrawCallback(new Runnable() {
- @Override
+ private void initializeRedrawCallback() {
+ mActivity.runOnUiThread(new Runnable() {
public void run() {
- mDesktop.reloadTexture();
- mCursor.reloadTexture();
+ JniInterface.provideRedrawCallback(new Runnable() {
+ @Override
+ public void run() {
+ mDesktop.reloadTexture();
+ mCursor.reloadTexture();
+ }
+ });
+
+ JniInterface.redrawGraphics();
}
});
}
@@ -129,7 +134,7 @@ public class CardboardRenderer implements CardboardView.StereoRenderer {
mPhotosphere = new Photosphere(mActivity);
mCursor = new Cursor();
- attachRedrawCallback();
+ initializeRedrawCallback();
}
@Override
@@ -177,8 +182,8 @@ public class CardboardRenderer implements CardboardView.StereoRenderer {
mProjectionMatrix = eye.getPerspective(Z_NEAR, Z_FAR);
drawDesktop();
- drawMenuBar();
drawPhotosphere();
+ drawMenuBar();
drawCursor();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698