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 class JniVideoRenderer; | 18 class JniVideoRenderer; |
19 | 19 |
20 // Handles OpenGL display operations. Draws desktop and cursor on the OpenGL | 20 // Handles OpenGL display operations. Draws desktop and cursor on the OpenGL |
21 // surface. | 21 // surface. |
22 class JniGlDisplayHandler : public DisplayUpdaterFactory { | 22 class JniGlDisplayHandler : public DisplayUpdaterFactory { |
23 public: | 23 public: |
24 JniGlDisplayHandler(); | 24 JniGlDisplayHandler(); |
25 ~JniGlDisplayHandler() override; | 25 ~JniGlDisplayHandler() override; |
26 | 26 |
27 // DisplayUpdaterFactory overrides. | 27 // DisplayUpdaterFactory overrides. |
28 std::unique_ptr<protocol::CursorShapeStub> CreateCursorShapeStub() override; | 28 std::unique_ptr<protocol::CursorShapeStub> CreateCursorShapeStub() override; |
29 std::unique_ptr<JniVideoRenderer> CreateVideoRenderer() override; | 29 std::unique_ptr<protocol::VideoRenderer> CreateVideoRenderer() override; |
30 | 30 |
31 static bool RegisterJni(JNIEnv* env); | 31 static bool RegisterJni(JNIEnv* env); |
32 | 32 |
33 void OnSurfaceCreated(JNIEnv* env, | 33 void OnSurfaceCreated(JNIEnv* env, |
34 const base::android::JavaParamRef<jobject>& caller); | 34 const base::android::JavaParamRef<jobject>& caller); |
35 | 35 |
36 void OnSurfaceChanged(JNIEnv* env, | 36 void OnSurfaceChanged(JNIEnv* env, |
37 const base::android::JavaParamRef<jobject>& caller, | 37 const base::android::JavaParamRef<jobject>& caller, |
38 int width, | 38 int width, |
39 int height); | 39 int height); |
40 | 40 |
41 void OnDrawFrame(JNIEnv* env, | 41 void OnDrawFrame(JNIEnv* env, |
42 const base::android::JavaParamRef<jobject>& caller); | 42 const base::android::JavaParamRef<jobject>& caller); |
43 | 43 |
44 private: | 44 private: |
45 DISALLOW_COPY_AND_ASSIGN(JniGlDisplayHandler); | 45 DISALLOW_COPY_AND_ASSIGN(JniGlDisplayHandler); |
46 }; | 46 }; |
47 | 47 |
48 } // namespace remoting | 48 } // namespace remoting |
49 | 49 |
50 #endif // REMOTING_CLIENT_JNI_JNI_GL_DISPLAY_HANDLER_H_ | 50 #endif // REMOTING_CLIENT_JNI_JNI_GL_DISPLAY_HANDLER_H_ |
OLD | NEW |