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

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

Issue 2445083002: Fixed bad WebVR content judder when the HTTP warning was displayed (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | 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.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell.cc b/chrome/browser/android/vr_shell/vr_shell.cc
index 547a059ed77381d6eae2210603297c22bccf05d2..6473a6bade186fa9255299078a0af5d8cd7460bd 100644
--- a/chrome/browser/android/vr_shell/vr_shell.cc
+++ b/chrome/browser/android/vr_shell/vr_shell.cc
@@ -446,6 +446,19 @@ void VrShell::DrawFrame(JNIEnv* env, const JavaParamRef<jobject>& obj) {
if (webvr_mode_) {
DrawWebVr();
+
+ // When using async reprojection, we need to know which pose was used in
+ // the WebVR app for drawing this frame. Due to unknown amounts of
+ // buffering in the compositor and SurfaceTexture, we read the pose number
+ // from a corner pixel. There's no point in doing this for legacy
+ // distortion rendering since that doesn't need a pose, and reading back
+ // pixels is an expensive operation. TODO(klausw): stop doing this once we
+ // have working no-compositor rendering for WebVR.
+ if (gvr_api_->GetAsyncReprojectionEnabled()) {
+ uint32_t webvr_pose_frame = GetPixelEncodedPoseIndex();
+ head_pose = webvr_head_pose_[webvr_pose_frame % kPoseRingBufferSize];
+ }
+
// Wait for the DOM contents to be loaded before rendering to avoid drawing
// white rectangles with no content.
if (!webvr_secure_origin_ && IsUiTextureReady()) {
@@ -459,18 +472,6 @@ void VrShell::DrawFrame(JNIEnv* env, const JavaParamRef<jobject>& obj) {
frame.BindBuffer(kFrameHeadlockedBuffer);
DrawWebVrOverlay(target_time.monotonic_system_time_nanos);
}
-
- // When using async reprojection, we need to know which pose was used in
- // the WebVR app for drawing this frame. Due to unknown amounts of
- // buffering in the compositor and SurfaceTexture, we read the pose number
- // from a corner pixel. There's no point in doing this for legacy
- // distortion rendering since that doesn't need a pose, and reading back
- // pixels is an expensive operation. TODO(klausw): stop doing this once we
- // have working no-compositor rendering for WebVR.
- if (gvr_api_->GetAsyncReprojectionEnabled()) {
- uint32_t webvr_pose_frame = GetPixelEncodedPoseIndex();
- head_pose = webvr_head_pose_[webvr_pose_frame % kPoseRingBufferSize];
- }
} else {
DrawVrShell(head_pose);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698