Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Unified Diff: remoting/client/ios/app/example_view_controller.mm

Issue 2555803002: Adding the iOS app and integration example with GlRenderer. (Closed)
Patch Set: Cleaning up gl_display_handler for chromium. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/client/ios/app/example_view_controller.mm
diff --git a/remoting/client/ios/example_view_controller.mm b/remoting/client/ios/app/example_view_controller.mm
similarity index 59%
rename from remoting/client/ios/example_view_controller.mm
rename to remoting/client/ios/app/example_view_controller.mm
index 64fd9ac678507e7b0ce1e1106a22e9d0b700f695..27abe554454c7880220dbbc90df63d79dfcd3fcb 100644
--- a/remoting/client/ios/example_view_controller.mm
+++ b/remoting/client/ios/app/example_view_controller.mm
@@ -1,4 +1,4 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
+// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,11 +6,16 @@
#error "This file requires ARC support."
#endif
-#import "remoting/client/ios/example_view_controller.h"
+#import "remoting/client/ios/app/example_view_controller.h"
#import "remoting/client/display/sys_opengl.h"
-@interface ExampleViewController()
+#include "base/message_loop/message_loop.h"
+#include "remoting/protocol/frame_stats.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
+
+@interface ExampleViewController ()
// Helper functions dealing with the GL Context.
- (void)setupGL;
@@ -24,10 +29,10 @@
- (void)viewDidLoad {
[super viewDidLoad];
-
- _context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
+ _gestures = [[ClientGestures alloc] initWithView:self.view];
+ _context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
Yuwei 2017/01/23 21:56:15 Are you establishing the EGL context on the main t
Yuwei 2017/01/23 21:56:15 Does this handle the case if ES3 context is not su
nicholss 2017/01/26 18:00:16 ES3 is not supported for <=iPhone5. Not sure how m
Jamie 2017/01/26 18:06:12 Drive-by: We might be able to get this information
nicholss 2017/01/26 18:28:40 Looks like the iphone5 just makes the cut at conti
+ _runtime = new remoting::ios::AppRuntime();
static_cast<GLKView*>(self.view).context = _context;
-
[self setupGL];
}
@@ -42,11 +47,12 @@
}
- (void)setupGL {
- [EAGLContext setCurrentContext:_context];
+ displayHandler = [[GlDisplayHandler alloc] initWithRuntime:_runtime];
+ [displayHandler created];
}
- (void)tearDownGL {
- [EAGLContext setCurrentContext:_context];
+ // TODO(nicholss): Implement this in a real application.
}
- (void)viewWillAppear:(BOOL)animated {
@@ -54,6 +60,9 @@
}
- (void)viewDidAppear:(BOOL)animated {
+ video_renderer_ =
+ (remoting::SoftwareVideoRenderer*)[displayHandler CreateVideoRenderer]
+ .get();
}
- (void)viewWillDisappear:(BOOL)animated {
@@ -68,9 +77,9 @@
// In general, avoid expensive work in this function to maximize frame rate.
- (void)glkView:(GLKView*)view drawInRect:(CGRect)rect {
- // Clear to give the background color.
- glClearColor(0.0, 40.0, 0.0, 1.0);
- glClear(GL_COLOR_BUFFER_BIT);
+ if (displayHandler) {
+ [displayHandler glkView:view drawInRect:rect];
+ }
}
@end

Powered by Google App Engine
This is Rietveld 408576698