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

Side by Side Diff: remoting/ios/app/host_view_controller.mm

Issue 2874143002: [CRD iOS] Some fixes for rendering (Closed)
Patch Set: Just use presentRenderbuffer to swap buffers Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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 #if !defined(__has_feature) || !__has_feature(objc_arc) 5 #if !defined(__has_feature) || !__has_feature(objc_arc)
6 #error "This file requires ARC support." 6 #error "This file requires ARC support."
7 #endif 7 #endif
8 8
9 #import "remoting/ios/app/host_view_controller.h" 9 #import "remoting/ios/app/host_view_controller.h"
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 return YES; 68 return YES;
69 } 69 }
70 70
71 - (void)viewDidAppear:(BOOL)animated { 71 - (void)viewDidAppear:(BOOL)animated {
72 [super viewDidAppear:animated]; 72 [super viewDidAppear:animated];
73 GLKView* glView = (GLKView*)self.view; 73 GLKView* glView = (GLKView*)self.view;
74 glView.context = [_client.displayHandler GetEAGLContext]; 74 glView.context = [_client.displayHandler GetEAGLContext];
75 [_client.displayHandler onSurfaceCreated:glView]; 75 [_client.displayHandler onSurfaceCreated:glView];
76 76
77 // viewDidLayoutSubviews may be called before viewDidAppear, in which case 77 // viewDidLayoutSubviews may be called before viewDidAppear, in which case
78 // the surface is not ready and onSurfaceChanged will be no-op. 78 // the surface is not ready to handle the transformation matrix.
79 // Call onSurfaceChanged here to cover that case. 79 // Call onSurfaceChanged here to cover that case.
80 [_client surfaceChanged:self.view.frame]; 80 [_client surfaceChanged:self.view.frame];
81 } 81 }
82 82
83 - (void)viewDidDisappear:(BOOL)animated {
84 [super viewDidDisappear:animated];
85 [(GLKView*)self.view deleteDrawable];
86 }
87
83 - (void)viewWillAppear:(BOOL)animated { 88 - (void)viewWillAppear:(BOOL)animated {
84 [super viewWillAppear:animated]; 89 [super viewWillAppear:animated];
85 90
86 _clientGestures = 91 _clientGestures =
87 [[ClientGestures alloc] initWithView:self.view client:_client]; 92 [[ClientGestures alloc] initWithView:self.view client:_client];
88 } 93 }
89 94
90 - (void)viewWillDisappear:(BOOL)animated { 95 - (void)viewWillDisappear:(BOOL)animated {
91 [super viewWillDisappear:animated]; 96 [super viewWillDisappear:animated];
92 97
93 _clientGestures = nil; 98 _clientGestures = nil;
94 } 99 }
95 100
96 - (void)viewDidLayoutSubviews { 101 - (void)viewDidLayoutSubviews {
97 [super viewDidLayoutSubviews]; 102 [super viewDidLayoutSubviews];
98 103
99 [_client surfaceChanged:self.view.frame]; 104 if (((GLKView*)self.view).context != nil) {
105 // If the context is not set yet, the view size will be set in
106 // viewDidAppear.
107 [_client surfaceChanged:self.view.bounds];
108 }
100 109
101 CGSize btnSize = _floatingButton.frame.size; 110 CGSize btnSize = _floatingButton.frame.size;
102 _floatingButton.frame = 111 _floatingButton.frame =
103 CGRectMake(self.view.frame.size.width - btnSize.width - kFabInset, 112 CGRectMake(self.view.frame.size.width - btnSize.width - kFabInset,
104 self.view.frame.size.height - btnSize.height - kFabInset, 113 self.view.frame.size.height - btnSize.height - kFabInset,
105 btnSize.width, btnSize.height); 114 btnSize.width, btnSize.height);
106 } 115 }
107 116
108 #pragma mark - Private 117 #pragma mark - Private
109 118
110 - (void)didTap:(id)sender { 119 - (void)didTap:(id)sender {
111 // TODO(nicholss): The FAB is being used to close the window at the moment 120 // TODO(nicholss): The FAB is being used to close the window at the moment
112 // just as a demo as the integration continues. This will not be the case 121 // just as a demo as the integration continues. This will not be the case
113 // in the final app. 122 // in the final app.
114 [_client disconnectFromHost]; 123 [_client disconnectFromHost];
115 [self dismissViewControllerAnimated:YES completion:nil]; 124 [self dismissViewControllerAnimated:YES completion:nil];
116 } 125 }
117 126
118 @end 127 @end
OLDNEW
« no previous file with comments | « remoting/client/jni/jni_gl_display_handler.cc ('k') | remoting/ios/display/gl_display_handler.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698