Chromium Code Reviews| Index: remoting/android/java/src/org/chromium/chromoting/jni/GlDisplay.java |
| diff --git a/remoting/android/java/src/org/chromium/chromoting/jni/GlDisplay.java b/remoting/android/java/src/org/chromium/chromoting/jni/GlDisplay.java |
| index dedbbb4e0361a6c33121c0b22a15f8cd5dc2cdb8..eedef18fef779c2a0d77f87018d55a5d3bf54dad 100644 |
| --- a/remoting/android/java/src/org/chromium/chromoting/jni/GlDisplay.java |
| +++ b/remoting/android/java/src/org/chromium/chromoting/jni/GlDisplay.java |
| @@ -11,18 +11,15 @@ import android.view.SurfaceHolder; |
| import org.chromium.base.annotations.CalledByNative; |
| import org.chromium.base.annotations.JNINamespace; |
| -import org.chromium.chromoting.Desktop; |
| import org.chromium.chromoting.DesktopView; |
| -import org.chromium.chromoting.DesktopViewFactory; |
| import org.chromium.chromoting.Event; |
| -import org.chromium.chromoting.GlDesktopView; |
| import org.chromium.chromoting.InputFeedbackRadiusMapper; |
| import org.chromium.chromoting.RenderStub; |
| import org.chromium.chromoting.SizeChangedEventParameter; |
| /** |
| - * This class is the JNI interface class that helps bridging GlDesktopView with the OpenGL renderer |
| - * in native code. The lifetime of this class is managed by the native JniGlDisplayHandler. |
| + * This class is a RenderStub implementation that uses the OpenGL renderer in native code to render |
| + * the remote desktop. The lifetime of this class is managed by the native JniGlDisplayHandler. |
| * |
| * This class works entirely on the UI thread: |
| * Functions should all be called on UI. |
| @@ -35,8 +32,7 @@ public class GlDisplay implements SurfaceHolder.Callback, RenderStub { |
| new Event.Raisable<>(); |
| private final Event.Raisable<SizeChangedEventParameter> mOnHostSizeChanged = |
| new Event.Raisable<>(); |
| - private final Event.Raisable<Void> mOnCanvasRendered = |
| - new Event.Raisable<>(); |
| + private final Event.Raisable<Void> mOnCanvasRendered = new Event.Raisable<>(); |
| private InputFeedbackRadiusMapper mFeedbackRadiusMapper; |
|
Hzj_jie
2016/09/10 02:06:32
Move regular fields after final fields.
Yuwei
2016/09/12 18:56:14
Done. Just moving mNativeJniGlDisplay below?
Hzj_jie
2016/09/12 21:28:04
Since mNativeJniGlDisplay needs to be mutable, thi
Yuwei
2016/09/12 21:50:04
Acknowledged.
|
| private float mScaleFactor = 0; |
| @@ -90,6 +86,7 @@ public class GlDisplay implements SurfaceHolder.Callback, RenderStub { |
| @Override |
| public void setDesktopView(DesktopView view) { |
| + view.getHolder().addCallback(this); |
| mFeedbackRadiusMapper = new InputFeedbackRadiusMapper(view); |
| } |
| @@ -179,12 +176,7 @@ public class GlDisplay implements SurfaceHolder.Callback, RenderStub { |
| @CalledByNative |
| private void initializeClient(Client client) { |
| - client.setDesktopViewFactory(new DesktopViewFactory() { |
| - @Override |
| - public DesktopView createDesktopView(Desktop desktop, Client client) { |
| - return new GlDesktopView(GlDisplay.this, desktop, client); |
| - } |
| - }); |
| + client.setRenderStub(this); |
| } |
| @CalledByNative |