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

Side by Side Diff: chrome/browser/android/vr_shell/vr_shell_gl.cc

Issue 2902863002: Implement EGL context priority if supported, use in VrShell (Closed)
Patch Set: Created 3 years, 7 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/gl/gl_context.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 surface_ = gl::init::CreateViewGLSurface(window); 270 surface_ = gl::init::CreateViewGLSurface(window);
271 } else { 271 } else {
272 CHECK(surfaceless_rendering_); 272 CHECK(surfaceless_rendering_);
273 surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size()); 273 surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size());
274 } 274 }
275 if (!surface_.get()) { 275 if (!surface_.get()) {
276 LOG(ERROR) << "gl::init::CreateOffscreenGLSurface failed"; 276 LOG(ERROR) << "gl::init::CreateOffscreenGLSurface failed";
277 ForceExitVr(); 277 ForceExitVr();
278 return; 278 return;
279 } 279 }
280 context_ = gl::init::CreateGLContext(nullptr, surface_.get(), 280
281 gl::GLContextAttribs()); 281 gl::GLContextAttribs attribs;
282 attribs.context_priority = gl::ContextPriorityHigh;
283 context_ = gl::init::CreateGLContext(nullptr, surface_.get(), attribs);
282 if (!context_.get()) { 284 if (!context_.get()) {
283 LOG(ERROR) << "gl::init::CreateGLContext failed"; 285 LOG(ERROR) << "gl::init::CreateGLContext failed";
284 ForceExitVr(); 286 ForceExitVr();
285 return; 287 return;
286 } 288 }
287 if (!context_->MakeCurrent(surface_.get())) { 289 if (!context_->MakeCurrent(surface_.get())) {
288 LOG(ERROR) << "gl::GLContext::MakeCurrent() failed"; 290 LOG(ERROR) << "gl::GLContext::MakeCurrent() failed";
289 ForceExitVr(); 291 ForceExitVr();
290 return; 292 return;
291 } 293 }
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1539 // This assumes that the initial webvr_surface_size_ was set to the 1541 // This assumes that the initial webvr_surface_size_ was set to the
1540 // appropriate recommended render resolution as the default size during 1542 // appropriate recommended render resolution as the default size during
1541 // InitializeGl. Revisit if the initialization order changes. 1543 // InitializeGl. Revisit if the initialization order changes.
1542 device::mojom::VRDisplayInfoPtr info = 1544 device::mojom::VRDisplayInfoPtr info =
1543 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(), 1545 device::GvrDelegate::CreateVRDisplayInfo(gvr_api_.get(),
1544 webvr_surface_size_, device_id); 1546 webvr_surface_size_, device_id);
1545 browser_->RunVRDisplayInfoCallback(callback, &info); 1547 browser_->RunVRDisplayInfoCallback(callback, &info);
1546 } 1548 }
1547 1549
1548 } // namespace vr_shell 1550 } // namespace vr_shell
OLDNEW
« no previous file with comments | « no previous file | ui/gl/gl_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698