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_gl.h" | 5 #include "chrome/browser/android/vr_shell/vr_shell_gl.h" |
6 | 6 |
7 #include <chrono> | 7 #include <chrono> |
8 #include <limits> | 8 #include <limits> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 CreateContentSurface(); | 304 CreateContentSurface(); |
305 content_surface_texture_->SetFrameAvailableCallback(base::Bind( | 305 content_surface_texture_->SetFrameAvailableCallback(base::Bind( |
306 &VrShellGl::OnContentFrameAvailable, weak_ptr_factory_.GetWeakPtr())); | 306 &VrShellGl::OnContentFrameAvailable, weak_ptr_factory_.GetWeakPtr())); |
307 webvr_surface_texture_->SetFrameAvailableCallback(base::Bind( | 307 webvr_surface_texture_->SetFrameAvailableCallback(base::Bind( |
308 &VrShellGl::OnWebVRFrameAvailable, weak_ptr_factory_.GetWeakPtr())); | 308 &VrShellGl::OnWebVRFrameAvailable, weak_ptr_factory_.GetWeakPtr())); |
309 content_surface_texture_->SetDefaultBufferSize( | 309 content_surface_texture_->SetDefaultBufferSize( |
310 content_tex_physical_size_.width(), content_tex_physical_size_.height()); | 310 content_tex_physical_size_.width(), content_tex_physical_size_.height()); |
311 | 311 |
312 InitializeRenderer(); | 312 InitializeRenderer(); |
313 | 313 |
314 scene_->OnGLInitialized(); | 314 browser_->OnGLInitialized(); |
315 | 315 |
316 gfx::Size webvr_size = | 316 gfx::Size webvr_size = |
317 device::GvrDelegate::GetRecommendedWebVrSize(gvr_api_.get()); | 317 device::GvrDelegate::GetRecommendedWebVrSize(gvr_api_.get()); |
318 DVLOG(1) << __FUNCTION__ << ": resize initial to " << webvr_size.width() | 318 DVLOG(1) << __FUNCTION__ << ": resize initial to " << webvr_size.width() |
319 << "x" << webvr_size.height(); | 319 << "x" << webvr_size.height(); |
320 | 320 |
321 CreateOrResizeWebVRSurface(webvr_size); | 321 CreateOrResizeWebVRSurface(webvr_size); |
322 | 322 |
323 vsync_task_.Reset(base::Bind(&VrShellGl::OnVSync, base::Unretained(this))); | 323 vsync_task_.Reset(base::Bind(&VrShellGl::OnVSync, base::Unretained(this))); |
324 OnVSync(); | 324 OnVSync(); |
(...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1632 // This assumes that the initial webvr_surface_size_ was set to the | 1632 // This assumes that the initial webvr_surface_size_ was set to the |
1633 // appropriate recommended render resolution as the default size during | 1633 // appropriate recommended render resolution as the default size during |
1634 // InitializeGl. Revisit if the initialization order changes. | 1634 // InitializeGl. Revisit if the initialization order changes. |
1635 device::mojom::VRDisplayInfoPtr info = | 1635 device::mojom::VRDisplayInfoPtr info = |
1636 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), | 1636 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), |
1637 webvr_surface_size_, device_id); | 1637 webvr_surface_size_, device_id); |
1638 browser_->RunVRDisplayInfoCallback(callback, &info); | 1638 browser_->RunVRDisplayInfoCallback(callback, &info); |
1639 } | 1639 } |
1640 | 1640 |
1641 } // namespace vr_shell | 1641 } // namespace vr_shell |
OLD | NEW |