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

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

Issue 2550803002: WebVR: avoid race conditions for partially-initialized display (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.h ('k') | chrome/browser/android/vr_shell/vr_shell_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/vr_shell.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell.cc b/chrome/browser/android/vr_shell/vr_shell.cc
index a649757d1fa4bf7b6a466cbc35e1883bab7bf3bf..90456fd60192c92960f1e2210719bb461e36cc6a 100644
--- a/chrome/browser/android/vr_shell/vr_shell.cc
+++ b/chrome/browser/android/vr_shell/vr_shell.cc
@@ -569,6 +569,10 @@ void VrShell::DrawFrame(JNIEnv* env, const JavaParamRef<jobject>& obj) {
if (html_interface_->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_);
}
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.h ('k') | chrome/browser/android/vr_shell/vr_shell_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698