Commit 32d9b484 authored by Klaus Weidner's avatar Klaus Weidner Committed by Commit Bot

WebXR: don't change frame background color

WebXR AR DOM overlay mode no longer needs the local frame view's
background color to be changed, this is now handled by CSS for the
:xr-overlay pseudoclass. Remove this code to avoid potential
complications such as incorrect background color restoration.

Bug: 1149708
Change-Id: I130842a80eff6d56f58590c8611b2c5e5f7f2878
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2543484Reviewed-by: default avatarPiotr Bialecki <bialpio@chromium.org>
Commit-Queue: Klaus Weidner <klausw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828271}
parent 0a44455c
......@@ -901,20 +901,6 @@ void XRSystem::ExitPresent(base::OnceClosure on_exited) {
if (doc->IsXrOverlay()) {
Element* fullscreen_element = Fullscreen::FullscreenElementFrom(*doc);
DVLOG(3) << __func__ << ": fullscreen_element=" << fullscreen_element;
// Restore the FrameView background color that was changed in
// OnRequestSessionReturned. The layout view can be null on navigation.
auto* layout_view = doc->GetLayoutView();
if (layout_view) {
auto* frame_view = layout_view->GetFrameView();
// SetBaseBackgroundColor updates composited layer mappings.
// That DCHECKs IsAllowedToQueryCompositingState which requires
// DocumentLifecycle >= kInCompositingUpdate.
frame_view->UpdateLifecycleToCompositingInputsClean(
DocumentUpdateReason::kBaseColor);
frame_view->SetBaseBackgroundColor(original_base_background_color_);
}
if (fullscreen_element) {
fullscreen_exit_observer_ =
MakeGarbageCollected<OverlayFullscreenExitObserver>(this);
......@@ -1520,18 +1506,6 @@ void XRSystem::OnRequestSessionReturned(
// element is already in fullscreen mode, and the session can
// proceed.
session->SetDOMOverlayElement(query->DOMOverlayElement());
// Save the current base background color (restored in ExitPresent),
// and set a transparent background for the FrameView.
auto* frame_view =
DomWindow()->document()->GetLayoutView()->GetFrameView();
// SetBaseBackgroundColor updates composited layer mappings.
// That DCHECKs IsAllowedToQueryCompositingState which requires
// DocumentLifecycle >= kInCompositingUpdate.
frame_view->UpdateLifecycleToCompositingInputsClean(
DocumentUpdateReason::kBaseColor);
original_base_background_color_ = frame_view->BaseBackgroundColor();
frame_view->SetBaseBackgroundColor(Color::kTransparent);
}
}
......
......@@ -467,9 +467,6 @@ class XRSystem final : public EventTargetWithInlineData,
// the session.
Member<OverlayFullscreenExitObserver> fullscreen_exit_observer_;
// In DOM overlay mode, save and restore the FrameView background color.
Color original_base_background_color_;
bool is_context_destroyed_ = false;
bool did_service_ever_disconnect_ = false;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment