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

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

Issue 1537183002: Refactor Chromoting JNI code to use jni/Client (Java changes only). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Suppress FindBugs warning Created 4 years, 10 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: remoting/android/java/src/org/chromium/chromoting/cardboard/Desktop.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/cardboard/Desktop.java b/remoting/android/java/src/org/chromium/chromoting/cardboard/Desktop.java
index ded464bf1d0bb22ca593b71b83adf1703a287a25..d987f6b3758f11751b588ec1c1cf83eb092ee457 100644
--- a/remoting/android/java/src/org/chromium/chromoting/cardboard/Desktop.java
+++ b/remoting/android/java/src/org/chromium/chromoting/cardboard/Desktop.java
@@ -11,7 +11,7 @@ import android.graphics.Bitmap;
import android.graphics.Point;
import android.opengl.GLES20;
-import org.chromium.chromoting.jni.JniInterface;
+import org.chromium.chromoting.jni.Client;
import java.nio.FloatBuffer;
@@ -61,6 +61,8 @@ public class Desktop {
// Number of vertices passed to glDrawArrays().
private static final int VERTICES_NUMBER = 6;
+ private final Client mClient;
+
private int mVertexShaderHandle;
private int mFragmentShaderHandle;
private int mProgramHandle;
@@ -87,7 +89,8 @@ public class Desktop {
// Lock to allow multithreaded access to mReloadTexture.
private final Object mReloadTextureLock = new Object();
- public Desktop() {
+ public Desktop(Client client) {
+ mClient = client;
mVertexShaderHandle =
ShaderHelper.compileShader(GLES20.GL_VERTEX_SHADER, VERTEX_SHADER);
mFragmentShaderHandle =
@@ -220,7 +223,7 @@ public class Desktop {
}
// TODO(shichengfeng): Record the time desktop drawing takes.
- Bitmap bitmap = JniInterface.getVideoFrame();
+ Bitmap bitmap = mClient.getVideoFrame();
if (bitmap == null) {
// This can happen if the client is connected, but a complete video frame has not yet
@@ -244,4 +247,4 @@ public class Desktop {
mReloadTexture = true;
}
}
-}
+}

Powered by Google App Engine
This is Rietveld 408576698