OLD | NEW |
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 "chrome/browser/android/vr_shell/vr_shell.h" | 5 #include "chrome/browser/android/vr_shell/vr_shell.h" |
6 | 6 |
7 #include <android/native_window_jni.h> | 7 #include <android/native_window_jni.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 if (vr_shell_enabled_) | 406 if (vr_shell_enabled_) |
407 ui_->HandleAppButtonClicked(); | 407 ui_->HandleAppButtonClicked(); |
408 } | 408 } |
409 | 409 |
410 void VrShell::ContentPhysicalBoundsChanged(JNIEnv* env, | 410 void VrShell::ContentPhysicalBoundsChanged(JNIEnv* env, |
411 const JavaParamRef<jobject>& object, | 411 const JavaParamRef<jobject>& object, |
412 jint width, | 412 jint width, |
413 jint height, | 413 jint height, |
414 jfloat dpr) { | 414 jfloat dpr) { |
415 TRACE_EVENT0("gpu", "VrShell::ContentPhysicalBoundsChanged"); | 415 TRACE_EVENT0("gpu", "VrShell::ContentPhysicalBoundsChanged"); |
| 416 // TODO(acondor): Set the device scale factor for font rendering on the |
| 417 // VR Shell textures. |
416 PostToGlThreadWhenReady(base::Bind(&VrShellGl::ContentPhysicalBoundsChanged, | 418 PostToGlThreadWhenReady(base::Bind(&VrShellGl::ContentPhysicalBoundsChanged, |
417 gl_thread_->GetVrShellGl(), width, | 419 gl_thread_->GetVrShellGl(), width, |
418 height)); | 420 height)); |
419 compositor_->SetWindowBounds(gfx::Size(width, height)); | 421 compositor_->SetWindowBounds(gfx::Size(width, height)); |
420 } | 422 } |
421 | 423 |
422 void VrShell::DoUiAction(const UiAction action, | 424 void VrShell::DoUiAction(const UiAction action, |
423 const base::DictionaryValue* arguments) { | 425 const base::DictionaryValue* arguments) { |
424 // Actions that can be handled natively. | 426 // Actions that can be handled natively. |
425 switch (action) { | 427 switch (action) { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 jboolean for_web_vr, | 565 jboolean for_web_vr, |
564 jlong gvr_api, | 566 jlong gvr_api, |
565 jboolean reprojected_rendering) { | 567 jboolean reprojected_rendering) { |
566 return reinterpret_cast<intptr_t>(new VrShell( | 568 return reinterpret_cast<intptr_t>(new VrShell( |
567 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), | 569 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), |
568 for_web_vr, VrShellDelegate::GetNativeVrShellDelegate(env, delegate), | 570 for_web_vr, VrShellDelegate::GetNativeVrShellDelegate(env, delegate), |
569 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); | 571 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); |
570 } | 572 } |
571 | 573 |
572 } // namespace vr_shell | 574 } // namespace vr_shell |
OLD | NEW |