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

Unified Diff: chrome/browser/android/vr_shell/vr_shell_gl.cc

Issue 2571713006: Fix some thread safety violations in device::GvrDelegate implementation. (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell_gl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/vr_shell_gl.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell_gl.cc b/chrome/browser/android/vr_shell/vr_shell_gl.cc
index a2ac61588d22344527cf9a215cd35587f0e756c6..16c061416795471028b1da0a8793614b395b9137 100644
--- a/chrome/browser/android/vr_shell/vr_shell_gl.cc
+++ b/chrome/browser/android/vr_shell/vr_shell_gl.cc
@@ -214,25 +214,25 @@ bool VrShellGl::InitializeGl() {
if (gl::GetGLImplementation() == gl::kGLImplementationNone &&
!gl::init::InitializeGLOneOff()) {
LOG(ERROR) << "gl::init::InitializeGLOneOff failed";
- ForceExitVR();
+ ForceExitVr();
return false;
}
surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size());
if (!surface_.get()) {
LOG(ERROR) << "gl::init::CreateOffscreenGLSurface failed";
- ForceExitVR();
+ ForceExitVr();
return false;
}
context_ = gl::init::CreateGLContext(nullptr, surface_.get(),
gl::GLContextAttribs());
if (!context_.get()) {
LOG(ERROR) << "gl::init::CreateGLContext failed";
- ForceExitVR();
+ ForceExitVr();
return false;
}
if (!context_->MakeCurrent(surface_.get())) {
LOG(ERROR) << "gl::GLContext::MakeCurrent() failed";
- ForceExitVR();
+ ForceExitVr();
return false;
}
@@ -317,7 +317,6 @@ void VrShellGl::InitializeRenderer() {
// For kFramePrimaryBuffer (primary VrShell and WebVR content)
specs.push_back(gvr_api_->CreateBufferSpec());
render_size_primary_ = specs[kFramePrimaryBuffer].GetSize();
- render_size_primary_vrshell_ = render_size_primary_;
// For kFrameHeadlockedBuffer (for WebVR insecure content warning).
// Set this up at fixed resolution, the (smaller) FOV gets set below.
@@ -610,25 +609,6 @@ void VrShellGl::DrawFrame() {
// DrawVrShell if needed.
buffer_viewport_list_->SetToRecommendedBufferViewports();
- // TODO(klausw): Fix this. Resizing buffers here leads to webVR mode showing
- // nothing but a black screen.
-// if (vr_shell_->GetUiInterface()->GetMode() == UiInterface::Mode::WEB_VR) {
-// // If needed, resize the primary buffer for use with WebVR.
-// if (render_size_primary_ != render_size_primary_webvr_) {
-// if (!render_size_primary_webvr_.width) {
-// VLOG(2) << "WebVR rendering size not known yet, dropping frame";
-// return;
-// }
-// render_size_primary_ = render_size_primary_webvr_;
-// swap_chain_->ResizeBuffer(kFramePrimaryBuffer, render_size_primary_);
-// }
-// } else {
-// if (render_size_primary_ != render_size_primary_vrshell_) {
-// render_size_primary_ = render_size_primary_vrshell_;
-// swap_chain_->ResizeBuffer(kFramePrimaryBuffer, render_size_primary_);
-// }
-// }
-
gvr::Frame frame = swap_chain_->AcquireFrame();
gvr::ClockTimePoint target_time = gvr::GvrApi::GetTimePointNow();
target_time.monotonic_system_time_nanos += kPredictionTimeWithoutVsyncNanos;
@@ -755,13 +735,6 @@ void VrShellGl::DrawVrShell(const gvr::Mat4f& head_pose,
}
}
-void VrShellGl::SetWebVRRenderSurfaceSize(int width, int height) {
- render_size_primary_webvr_.width = width;
- render_size_primary_webvr_.height = height;
- // TODO(klausw,crbug.com/655722): set the WebVR render surface size here once
- // we have that.
-}
-
gvr::Sizei VrShellGl::GetWebVRCompositorSurfaceSize() {
// This is a stopgap while we're using the WebVR compositor rendering path.
// TODO(klausw,crbug.com/655722): Remove this method and member once we're
@@ -1005,9 +978,9 @@ void VrShellGl::ScheduleNextDrawFrame() {
task_runner_->PostDelayedTask(FROM_HERE, draw_task_.callback(), target - now);
}
-void VrShellGl::ForceExitVR() {
+void VrShellGl::ForceExitVr() {
main_thread_task_runner_->PostTask(
- FROM_HERE, base::Bind(&VrShell::ForceExitVR, weak_vr_shell_));
+ FROM_HERE, base::Bind(&VrShell::ForceExitVr, weak_vr_shell_));
}
} // namespace vr_shell
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell_gl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698