OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chromoting.jni; | 5 package org.chromium.chromoting.jni; |
6 | 6 |
| 7 import android.content.Context; |
7 import android.view.Surface; | 8 import android.view.Surface; |
8 | 9 |
9 import org.chromium.base.annotations.CalledByNative; | 10 import org.chromium.base.annotations.CalledByNative; |
10 import org.chromium.base.annotations.JNINamespace; | 11 import org.chromium.base.annotations.JNINamespace; |
| 12 import org.chromium.chromoting.AbstractDesktopView; |
| 13 import org.chromium.chromoting.DesktopViewFactory; |
11 import org.chromium.chromoting.Event; | 14 import org.chromium.chromoting.Event; |
12 import org.chromium.chromoting.SizeChangedEventParameter; | 15 import org.chromium.chromoting.SizeChangedEventParameter; |
13 | 16 |
14 /** | 17 /** |
15 * This class is the JNI interface class that helps bridging GlDesktopView with
the OpenGL renderer | 18 * This class is the JNI interface class that helps bridging GlDesktopView with
the OpenGL renderer |
16 * in native code. The lifetime of this class is managed by the native JniGlDisp
layHandler. | 19 * in native code. The lifetime of this class is managed by the native JniGlDisp
layHandler. |
17 * | 20 * |
18 * This class works entirely on the UI thread: | 21 * This class works entirely on the UI thread: |
19 * Functions should all be called on UI. | 22 * Functions should all be called on UI. |
20 * Events will only be triggered on UI. | 23 * Events will only be triggered on UI. |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 * Shows the cursor input feedback animation with the given diameter at the
given desktop | 152 * Shows the cursor input feedback animation with the given diameter at the
given desktop |
150 * location. | 153 * location. |
151 */ | 154 */ |
152 public void showCursorInputFeedback(int x, int y, float diameter) { | 155 public void showCursorInputFeedback(int x, int y, float diameter) { |
153 if (mNativeJniGlDisplay != 0) { | 156 if (mNativeJniGlDisplay != 0) { |
154 nativeOnCursorInputFeedback(mNativeJniGlDisplay, x, y, diameter); | 157 nativeOnCursorInputFeedback(mNativeJniGlDisplay, x, y, diameter); |
155 } | 158 } |
156 } | 159 } |
157 | 160 |
158 @CalledByNative | 161 @CalledByNative |
| 162 private DesktopViewFactory createDesktopViewFactory() { |
| 163 return new DesktopViewFactory() { |
| 164 @Override |
| 165 public AbstractDesktopView createDesktopView(Context context) { |
| 166 // UNIMPLEMENTED. |
| 167 return null; |
| 168 } |
| 169 }; |
| 170 } |
| 171 |
| 172 @CalledByNative |
159 private static GlDisplay createJavaDisplayObject(long nativeDisplayHandler)
{ | 173 private static GlDisplay createJavaDisplayObject(long nativeDisplayHandler)
{ |
160 return new GlDisplay(nativeDisplayHandler); | 174 return new GlDisplay(nativeDisplayHandler); |
161 } | 175 } |
162 | 176 |
163 private native void nativeOnSurfaceCreated(long nativeJniGlDisplayHandler, S
urface surface); | 177 private native void nativeOnSurfaceCreated(long nativeJniGlDisplayHandler, S
urface surface); |
164 private native void nativeOnSurfaceChanged(long nativeJniGlDisplayHandler, | 178 private native void nativeOnSurfaceChanged(long nativeJniGlDisplayHandler, |
165 int width, int height); | 179 int width, int height); |
166 private native void nativeOnSurfaceDestroyed(long nativeJniGlDisplayHandler)
; | 180 private native void nativeOnSurfaceDestroyed(long nativeJniGlDisplayHandler)
; |
167 private native void nativeOnPixelTransformationChanged(long nativeJniGlDispl
ayHandler, | 181 private native void nativeOnPixelTransformationChanged(long nativeJniGlDispl
ayHandler, |
168 float[] matrix); | 182 float[] matrix); |
169 private native void nativeOnCursorPixelPositionChanged(long nativeJniGlDispl
ayHandler, | 183 private native void nativeOnCursorPixelPositionChanged(long nativeJniGlDispl
ayHandler, |
170 int x, int y); | 184 int x, int y); |
171 private native void nativeOnCursorInputFeedback(long nativeJniGlDisplayHandl
er, | 185 private native void nativeOnCursorInputFeedback(long nativeJniGlDisplayHandl
er, |
172 int x, int y, float diameter
); | 186 int x, int y, float diameter
); |
173 private native void nativeOnCursorVisibilityChanged(long nativeJniGlDisplayH
andler, | 187 private native void nativeOnCursorVisibilityChanged(long nativeJniGlDisplayH
andler, |
174 boolean visible); | 188 boolean visible); |
175 private native void nativeSetRenderEventEnabled(long nativeJniGlDisplayHandl
er, | 189 private native void nativeSetRenderEventEnabled(long nativeJniGlDisplayHandl
er, |
176 boolean enabled); | 190 boolean enabled); |
177 } | 191 } |
OLD | NEW |