New issue
Advanced search Search tips

Issue 698923 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug
Proj-XR

Blocking:
issue 655722
issue 701465



Sign in to add a comment

WebVR: pause standard compositor while presenting on Android

Project Member Reported by klausw@chromium.org, Mar 7 2017

Issue description

We should suppress compositor updates while presenting on Android
since they aren't needed, and they do a fair amount of extra work.

Unfortunately hiding the view doesn't currently work, it
causes an assertion failure (!m_isHidden) in
DrawingBuffer::prepareTextureMailboxInternal() via FrameView.cpp:

        if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
          if (view.compositor()->inCompositingMode())
            scrollingCoordinator()->updateAfterCompositingChangeIfNeeded();

Disabling compositing mode works but seems irreversible, the view
is frozen after exiting presentation.

Do this only when we're actually presenting (m_isPresenting
is true), see corresponding show() in forceExitPresent().
Otherwise the view may remain hidden for failing DON flow.

Here's my current attempt:

  // hide in beginPresent() if no external display:
  auto doc = m_navigatorVR->document();
  doc->view()->hide();
  doc->layoutView()->compositor()->setCompositingModeEnabled(false);

  // unhide in stopPresenting()
  auto doc = m_navigatorVR->document();
  doc->layoutView()->compositor()->setCompositingModeEnabled(true);
  doc->view()->show();

This isn't technically a blocker since the compositor bypass can
still work while the normal compositor is also running, it's
just inefficient.
 
Status: Started (was: Untriaged)
Changing the FrameView.cpp check as follows seemed to work with just view()->hide() / show(), but this may not be the right approach:

if (view.compositor()->inCompositingMode() && isSelfVisible())
Probably best to just not request VSyncs in VrWindowAndroid?
Blocking: 701465
Project Member

Comment 5 by bugdroid1@chromium.org, Mar 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b10e886bab7da85506656b4bb83e707cc2170209

commit b10e886bab7da85506656b4bb83e707cc2170209
Author: mthiesse <mthiesse@chromium.org>
Date: Thu Mar 16 21:09:33 2017

Disables the standard compositing path while in WebVR Presentation by pausing VSync. This prevents rAFs and other unnecessary compositor work from happening.

BUG= 698923 

Review-Url: https://codereview.chromium.org/2754493002
Cr-Commit-Position: refs/heads/master@{#457552}

[modify] https://crrev.com/b10e886bab7da85506656b4bb83e707cc2170209/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
[modify] https://crrev.com/b10e886bab7da85506656b4bb83e707cc2170209/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java
[modify] https://crrev.com/b10e886bab7da85506656b4bb83e707cc2170209/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrWindowAndroid.java
[modify] https://crrev.com/b10e886bab7da85506656b4bb83e707cc2170209/content/public/android/BUILD.gn
[add] https://crrev.com/b10e886bab7da85506656b4bb83e707cc2170209/content/public/android/javatests/src/org/chromium/content/browser/VSyncPausedTest.java
[add] https://crrev.com/b10e886bab7da85506656b4bb83e707cc2170209/content/test/data/android/vsync.html
[modify] https://crrev.com/b10e886bab7da85506656b4bb83e707cc2170209/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java
[modify] https://crrev.com/b10e886bab7da85506656b4bb83e707cc2170209/ui/android/window_android.cc
[modify] https://crrev.com/b10e886bab7da85506656b4bb83e707cc2170209/ui/android/window_android.h

Status: Fixed (was: Started)
Labels: M-59
Owner: mthiesse@chromium.org
Components: Blink>WebXR

Sign in to add a comment