| 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 #ifndef REMOTING_CLIENT_JNI_JNI_GL_DISPLAY_HANDLER_H_ | 5 #ifndef REMOTING_CLIENT_JNI_JNI_GL_DISPLAY_HANDLER_H_ |
| 6 #define REMOTING_CLIENT_JNI_JNI_GL_DISPLAY_HANDLER_H_ | 6 #define REMOTING_CLIENT_JNI_JNI_GL_DISPLAY_HANDLER_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "remoting/client/jni/display_updater_factory.h" | 13 #include "remoting/client/jni/display_updater_factory.h" |
| 14 | 14 |
| 15 namespace remoting { | 15 namespace remoting { |
| 16 | 16 |
| 17 class ChromotingJniRuntime; | 17 class ChromotingJniRuntime; |
| 18 | 18 |
| 19 // Handles OpenGL display operations. Draws desktop and cursor on the OpenGL | 19 // Handles OpenGL display operations. Draws desktop and cursor on the OpenGL |
| 20 // surface. | 20 // surface. |
| 21 // JNI functions should all be called on the UI thread. The display handler | 21 // JNI functions should all be called on the UI thread. The display handler |
| 22 // itself should be deleted on the display thread. | 22 // itself should be deleted on the display thread. |
| 23 // Please see GlDisplay.java for documentations. | 23 // Please see GlDisplay.java for documentations. |
| 24 class JniGlDisplayHandler : public DisplayUpdaterFactory { | 24 class JniGlDisplayHandler : public DisplayUpdaterFactory { |
| 25 public: | 25 public: |
| 26 JniGlDisplayHandler(ChromotingJniRuntime* runtime); | 26 JniGlDisplayHandler(ChromotingJniRuntime* runtime); |
| 27 ~JniGlDisplayHandler() override; | 27 ~JniGlDisplayHandler() override; |
| 28 | 28 |
| 29 base::android::ScopedJavaLocalRef<jobject> GetJavaDisplay(); | 29 base::android::ScopedJavaLocalRef<jobject> CreateDesktopViewFactory(); |
| 30 | 30 |
| 31 // DisplayUpdaterFactory overrides. | 31 // DisplayUpdaterFactory overrides. |
| 32 std::unique_ptr<protocol::CursorShapeStub> CreateCursorShapeStub() override; | 32 std::unique_ptr<protocol::CursorShapeStub> CreateCursorShapeStub() override; |
| 33 std::unique_ptr<protocol::VideoRenderer> CreateVideoRenderer() override; | 33 std::unique_ptr<protocol::VideoRenderer> CreateVideoRenderer() override; |
| 34 | 34 |
| 35 static bool RegisterJni(JNIEnv* env); | 35 static bool RegisterJni(JNIEnv* env); |
| 36 | 36 |
| 37 void OnSurfaceCreated( | 37 void OnSurfaceCreated( |
| 38 JNIEnv* env, | 38 JNIEnv* env, |
| 39 const base::android::JavaParamRef<jobject>& caller, | 39 const base::android::JavaParamRef<jobject>& caller, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 ChromotingJniRuntime* runtime_; | 88 ChromotingJniRuntime* runtime_; |
| 89 | 89 |
| 90 base::android::ScopedJavaGlobalRef<jobject> java_display_; | 90 base::android::ScopedJavaGlobalRef<jobject> java_display_; |
| 91 | 91 |
| 92 DISALLOW_COPY_AND_ASSIGN(JniGlDisplayHandler); | 92 DISALLOW_COPY_AND_ASSIGN(JniGlDisplayHandler); |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 } // namespace remoting | 95 } // namespace remoting |
| 96 | 96 |
| 97 #endif // REMOTING_CLIENT_JNI_JNI_GL_DISPLAY_HANDLER_H_ | 97 #endif // REMOTING_CLIENT_JNI_JNI_GL_DISPLAY_HANDLER_H_ |
| OLD | NEW |