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

Side by Side Diff: remoting/client/jni/jni_gl_display_handler.cc

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
« no previous file with comments | « remoting/client/display/gl_canvas.cc ('k') | remoting/ios/app/host_view_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "remoting/client/jni/jni_gl_display_handler.h" 5 #include "remoting/client/jni/jni_gl_display_handler.h"
6 6
7 #include <android/native_window_jni.h> 7 #include <android/native_window_jni.h>
8 #include <array> 8 #include <array>
9 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 renderer_->OnSurfaceCreated(base::MakeUnique<GlCanvas>( 152 renderer_->OnSurfaceCreated(base::MakeUnique<GlCanvas>(
153 static_cast<int>(egl_context_->client_version()))); 153 static_cast<int>(egl_context_->client_version())));
154 154
155 runtime_->network_task_runner()->PostTask( 155 runtime_->network_task_runner()->PostTask(
156 FROM_HERE, base::Bind(&DualBufferFrameConsumer::RequestFullDesktopFrame, 156 FROM_HERE, base::Bind(&DualBufferFrameConsumer::RequestFullDesktopFrame,
157 frame_consumer_)); 157 frame_consumer_));
158 } 158 }
159 159
160 void JniGlDisplayHandler::Core::SurfaceChanged(int width, int height) { 160 void JniGlDisplayHandler::Core::SurfaceChanged(int width, int height) {
161 DCHECK(runtime_->display_task_runner()->BelongsToCurrentThread()); 161 DCHECK(runtime_->display_task_runner()->BelongsToCurrentThread());
162 // Note that this doesn't resize the OpenGL viewport. The OpenGL viewport is
163 // initialized once it is first bound to the surface. We don't need to call
164 // glViewport() since the activity/surface is recreated and hence the viewport
165 // is re-initialized every time the surface size is changed.
162 renderer_->OnSurfaceChanged(width, height); 166 renderer_->OnSurfaceChanged(width, height);
163 } 167 }
164 168
165 void JniGlDisplayHandler::Core::SurfaceDestroyed() { 169 void JniGlDisplayHandler::Core::SurfaceDestroyed() {
166 DCHECK(runtime_->display_task_runner()->BelongsToCurrentThread()); 170 DCHECK(runtime_->display_task_runner()->BelongsToCurrentThread());
167 DCHECK(egl_context_); 171 DCHECK(egl_context_);
168 DCHECK(window_); 172 DCHECK(window_);
169 renderer_->OnSurfaceDestroyed(); 173 renderer_->OnSurfaceDestroyed();
170 egl_context_.reset(); 174 egl_context_.reset();
171 ANativeWindow_release(window_); 175 ANativeWindow_release(window_);
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 java_display_); 326 java_display_);
323 } 327 }
324 328
325 void JniGlDisplayHandler::OnCanvasSizeChanged(int width, int height) { 329 void JniGlDisplayHandler::OnCanvasSizeChanged(int width, int height) {
326 DCHECK(runtime_->ui_task_runner()->BelongsToCurrentThread()); 330 DCHECK(runtime_->ui_task_runner()->BelongsToCurrentThread());
327 Java_GlDisplay_changeCanvasSize(base::android::AttachCurrentThread(), 331 Java_GlDisplay_changeCanvasSize(base::android::AttachCurrentThread(),
328 java_display_, width, height); 332 java_display_, width, height);
329 } 333 }
330 334
331 } // namespace remoting 335 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/display/gl_canvas.cc ('k') | remoting/ios/app/host_view_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698