OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_IOS_DISPLAY_GL_DISPLAY_HANDLER_H_ | 5 #ifndef REMOTING_CLIENT_IOS_DISPLAY_GL_DISPLAY_HANDLER_H_ |
6 #define REMOTING_CLIENT_IOS_DISPLAY_GL_DISPLAY_HANDLER_H_ | 6 #define REMOTING_CLIENT_IOS_DISPLAY_GL_DISPLAY_HANDLER_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 #import <GLKit/GLKit.h> | 9 #import <GLKit/GLKit.h> |
10 | 10 |
11 #import "remoting/client/display/sys_opengl.h" | 11 #import "remoting/client/display/sys_opengl.h" |
12 | 12 |
13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 14 #include "remoting/client/view_matrix.h" |
14 | 15 |
15 namespace remoting { | 16 namespace remoting { |
16 | 17 |
17 class ChromotingClientRuntime; | 18 class ChromotingClientRuntime; |
18 | 19 |
19 namespace protocol { | 20 namespace protocol { |
20 | 21 |
21 class VideoRenderer; | 22 class VideoRenderer; |
22 class CursorShapeStub; | 23 class CursorShapeStub; |
23 | 24 |
24 } // namespace protocol | 25 } // namespace protocol |
25 } // namespace remoting | 26 } // namespace remoting |
26 | 27 |
| 28 // This protocol is for receiving notifications from the renderer when its state |
| 29 // changes. Implementations can use this to reposition viewport, process |
| 30 // animations, etc. |
| 31 @protocol GlDisplayHandlerDelegate<NSObject> |
| 32 |
| 33 // Notifies the delegate that the size of the desktop image has changed. |
| 34 - (void)canvasSizeChanged:(CGSize)size; |
| 35 |
| 36 @end |
| 37 |
27 @interface GlDisplayHandler : NSObject { | 38 @interface GlDisplayHandler : NSObject { |
28 } | 39 } |
29 | 40 |
30 - (void)stop; | 41 - (void)stop; |
31 | 42 |
32 // Called once the GLKView created. | 43 // Called once the GLKView created. |
33 - (void)onSurfaceCreated:(GLKView*)view; | 44 - (void)onSurfaceCreated:(GLKView*)view; |
34 | 45 |
35 // Called every time the GLKView dimension is initialized or changed. | 46 // Called every time the GLKView dimension is initialized or changed. |
36 - (void)onSurfaceChanged:(const CGRect&)frame; | 47 - (void)onSurfaceChanged:(const CGRect&)frame; |
37 | 48 |
| 49 - (void)onPixelTransformationChanged:(const remoting::ViewMatrix&)matrix; |
| 50 |
38 - (std::unique_ptr<remoting::protocol::VideoRenderer>)CreateVideoRenderer; | 51 - (std::unique_ptr<remoting::protocol::VideoRenderer>)CreateVideoRenderer; |
39 - (std::unique_ptr<remoting::protocol::CursorShapeStub>)CreateCursorShapeStub; | 52 - (std::unique_ptr<remoting::protocol::CursorShapeStub>)CreateCursorShapeStub; |
40 | 53 |
41 - (EAGLContext*)GetEAGLContext; | 54 - (EAGLContext*)GetEAGLContext; |
42 | 55 |
| 56 // This is write-only but @property doesn't support write-only modifier. |
| 57 @property id<GlDisplayHandlerDelegate> delegate; |
| 58 - (id<GlDisplayHandlerDelegate>)delegate UNAVAILABLE_ATTRIBUTE; |
| 59 |
43 @end | 60 @end |
44 | 61 |
45 #endif // REMOTING_CLIENT_IOS_DISPLAY_GL_DISPLAY_HANDLER_H_ | 62 #endif // REMOTING_CLIENT_IOS_DISPLAY_GL_DISPLAY_HANDLER_H_ |
OLD | NEW |