| 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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 mailbox)); | 363 mailbox)); |
| 364 } | 364 } |
| 365 | 365 |
| 366 void VrShell::SubmitControllerModel(std::unique_ptr<VrControllerModel> model) { | 366 void VrShell::SubmitControllerModel(std::unique_ptr<VrControllerModel> model) { |
| 367 PostToGlThreadWhenReady(base::Bind(&VrShellGl::SetControllerModel, | 367 PostToGlThreadWhenReady(base::Bind(&VrShellGl::SetControllerModel, |
| 368 gl_thread_->GetVrShellGl(), | 368 gl_thread_->GetVrShellGl(), |
| 369 base::Passed(&model))); | 369 base::Passed(&model))); |
| 370 } | 370 } |
| 371 | 371 |
| 372 void VrShell::UpdateWebVRTextureBounds(int16_t frame_index, | 372 void VrShell::UpdateWebVRTextureBounds(int16_t frame_index, |
| 373 const gvr::Rectf& left_bounds, | 373 const gfx::RectF& left_bounds, |
| 374 const gvr::Rectf& right_bounds, | 374 const gfx::RectF& right_bounds, |
| 375 const gvr::Sizei& source_size) { | 375 const gfx::Size& source_size) { |
| 376 PostToGlThreadWhenReady(base::Bind(&VrShellGl::UpdateWebVRTextureBounds, | 376 PostToGlThreadWhenReady(base::Bind(&VrShellGl::UpdateWebVRTextureBounds, |
| 377 gl_thread_->GetVrShellGl(), frame_index, | 377 gl_thread_->GetVrShellGl(), frame_index, |
| 378 left_bounds, right_bounds, source_size)); | 378 left_bounds, right_bounds, source_size)); |
| 379 } | 379 } |
| 380 | 380 |
| 381 void VrShell::CreateVRDisplayInfo( | 381 void VrShell::CreateVRDisplayInfo( |
| 382 const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, | 382 const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, |
| 383 uint32_t device_id) { | 383 uint32_t device_id) { |
| 384 PostToGlThreadWhenReady(base::Bind(&VrShellGl::CreateVRDisplayInfo, | 384 PostToGlThreadWhenReady(base::Bind(&VrShellGl::CreateVRDisplayInfo, |
| 385 gl_thread_->GetVrShellGl(), callback, | 385 gl_thread_->GetVrShellGl(), callback, |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 jboolean reprojected_rendering) { | 686 jboolean reprojected_rendering) { |
| 687 return reinterpret_cast<intptr_t>(new VrShell( | 687 return reinterpret_cast<intptr_t>(new VrShell( |
| 688 env, obj, reinterpret_cast<ui::WindowAndroid*>(content_window_android), | 688 env, obj, reinterpret_cast<ui::WindowAndroid*>(content_window_android), |
| 689 content::WebContents::FromJavaWebContents(ui_web_contents), | 689 content::WebContents::FromJavaWebContents(ui_web_contents), |
| 690 reinterpret_cast<ui::WindowAndroid*>(ui_window_android), for_web_vr, | 690 reinterpret_cast<ui::WindowAndroid*>(ui_window_android), for_web_vr, |
| 691 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), | 691 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), |
| 692 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); | 692 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); |
| 693 } | 693 } |
| 694 | 694 |
| 695 } // namespace vr_shell | 695 } // namespace vr_shell |
| OLD | NEW |