| 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 } else { | 282 } else { |
| 283 CHECK(surfaceless_rendering_); | 283 CHECK(surfaceless_rendering_); |
| 284 surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size()); | 284 surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size()); |
| 285 } | 285 } |
| 286 if (!surface_.get()) { | 286 if (!surface_.get()) { |
| 287 LOG(ERROR) << "gl::init::CreateOffscreenGLSurface failed"; | 287 LOG(ERROR) << "gl::init::CreateOffscreenGLSurface failed"; |
| 288 ForceExitVr(); | 288 ForceExitVr(); |
| 289 return; | 289 return; |
| 290 } | 290 } |
| 291 | 291 |
| 292 gl::GLContextAttribs attribs; | 292 context_ = gl::init::CreateGLContext(nullptr, surface_.get(), |
| 293 attribs.context_priority = gl::ContextPriorityHigh; | 293 gl::GLContextAttribs()); |
| 294 context_ = gl::init::CreateGLContext(nullptr, surface_.get(), attribs); | |
| 295 if (!context_.get()) { | 294 if (!context_.get()) { |
| 296 LOG(ERROR) << "gl::init::CreateGLContext failed"; | 295 LOG(ERROR) << "gl::init::CreateGLContext failed"; |
| 297 ForceExitVr(); | 296 ForceExitVr(); |
| 298 return; | 297 return; |
| 299 } | 298 } |
| 300 if (!context_->MakeCurrent(surface_.get())) { | 299 if (!context_->MakeCurrent(surface_.get())) { |
| 301 LOG(ERROR) << "gl::GLContext::MakeCurrent() failed"; | 300 LOG(ERROR) << "gl::GLContext::MakeCurrent() failed"; |
| 302 ForceExitVr(); | 301 ForceExitVr(); |
| 303 return; | 302 return; |
| 304 } | 303 } |
| (...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1599 // This assumes that the initial webvr_surface_size_ was set to the | 1598 // This assumes that the initial webvr_surface_size_ was set to the |
| 1600 // appropriate recommended render resolution as the default size during | 1599 // appropriate recommended render resolution as the default size during |
| 1601 // InitializeGl. Revisit if the initialization order changes. | 1600 // InitializeGl. Revisit if the initialization order changes. |
| 1602 device::mojom::VRDisplayInfoPtr info = | 1601 device::mojom::VRDisplayInfoPtr info = |
| 1603 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), | 1602 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), |
| 1604 webvr_surface_size_, device_id); | 1603 webvr_surface_size_, device_id); |
| 1605 browser_->RunVRDisplayInfoCallback(callback, &info); | 1604 browser_->RunVRDisplayInfoCallback(callback, &info); |
| 1606 } | 1605 } |
| 1607 | 1606 |
| 1608 } // namespace vr_shell | 1607 } // namespace vr_shell |
| OLD | NEW |