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

Unified Diff: chrome/browser/android/vr_shell/vr_shell.cc

Issue 2464373005: Fix VR Shell crashing when renderer crashes or native page is shown. (Closed)
Patch Set: Rebase + address comment Created 4 years, 1 month 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
« no previous file with comments | « chrome/browser/android/vr_shell/vr_input_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/vr_shell.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell.cc b/chrome/browser/android/vr_shell/vr_shell.cc
index 84233c1bad8f1f2a0c75a53536a6901435f6ebec..14af361791e57e1b35c0c03278d663ec7eea227b 100644
--- a/chrome/browser/android/vr_shell/vr_shell.cc
+++ b/chrome/browser/android/vr_shell/vr_shell.cc
@@ -21,11 +21,12 @@
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/referrer.h"
-#include "content/public/common/screen_info.h"
#include "jni/VrShellImpl_jni.h"
#include "ui/android/view_android.h"
#include "ui/android/window_android.h"
#include "ui/base/page_transition_types.h"
+#include "ui/display/display.h"
+#include "ui/display/screen.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/init/gl_factory.h"
@@ -749,11 +750,10 @@ void VrShell::ContentSurfaceChanged(JNIEnv* env,
jint height,
const JavaParamRef<jobject>& surface) {
content_compositor_->SurfaceChanged((int)width, (int)height, surface);
- content::ScreenInfo result;
- main_contents_->GetRenderWidgetHostView()->GetRenderWidgetHost()
- ->GetScreenInfo(&result);
- content_tex_width_ = width / result.device_scale_factor;
- content_tex_height_ = height / result.device_scale_factor;
+ float scale_factor = display::Screen::GetScreen()
+ ->GetPrimaryDisplay().device_scale_factor();
+ content_tex_width_ = width / scale_factor;
+ content_tex_height_ = height / scale_factor;
}
void VrShell::UiSurfaceChanged(JNIEnv* env,
@@ -762,11 +762,10 @@ void VrShell::UiSurfaceChanged(JNIEnv* env,
jint height,
const JavaParamRef<jobject>& surface) {
ui_compositor_->SurfaceChanged((int)width, (int)height, surface);
- content::ScreenInfo result;
- ui_contents_->GetRenderWidgetHostView()->GetRenderWidgetHost()->GetScreenInfo(
- &result);
- ui_tex_width_ = width / result.device_scale_factor;
- ui_tex_height_ = height / result.device_scale_factor;
+ float scale_factor = display::Screen::GetScreen()
+ ->GetPrimaryDisplay().device_scale_factor();
+ ui_tex_width_ = width / scale_factor;
+ ui_tex_height_ = height / scale_factor;
}
UiScene* VrShell::GetScene() {
« no previous file with comments | « chrome/browser/android/vr_shell/vr_input_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698