Commit 95cec00d authored by Ian Vollick's avatar Ian Vollick Committed by Commit Bot

[vr] Fix opacity inheritance

This CL fixes a bug in UiElement::UpdateInheritedProperties where we
were accidentally pulling the parent's local, not combined opacity.

Bug: 767559
Change-Id: Ie8092299ec32229f73e89172b352959e75b7bfd6
Reviewed-on: https://chromium-review.googlesource.com/676664Reviewed-by: default avatarYash Malik <ymalik@chromium.org>
Commit-Queue: Ian Vollick <vollick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503541}
parent edb2ce24
...@@ -329,7 +329,7 @@ void UiElement::UpdateInheritedProperties() { ...@@ -329,7 +329,7 @@ void UiElement::UpdateInheritedProperties() {
if (parent_) { if (parent_) {
inheritable.ConcatTransform(parent_->inheritable_transform()); inheritable.ConcatTransform(parent_->inheritable_transform());
set_computed_opacity(computed_opacity() * parent_->opacity()); set_computed_opacity(computed_opacity() * parent_->computed_opacity());
} }
transform.ConcatTransform(inheritable); transform.ConcatTransform(inheritable);
......
...@@ -28,9 +28,6 @@ using TargetProperty::TRANSFORM; ...@@ -28,9 +28,6 @@ using TargetProperty::TRANSFORM;
using TargetProperty::OPACITY; using TargetProperty::OPACITY;
namespace { namespace {
std::set<UiElementName> kBackgroundElements = {
kBackgroundFront, kBackgroundLeft, kBackgroundBack,
kBackgroundRight, kBackgroundTop, kBackgroundBottom};
std::set<UiElementName> kFloorCeilingBackgroundElements = { std::set<UiElementName> kFloorCeilingBackgroundElements = {
kBackgroundFront, kBackgroundLeft, kBackgroundBack, kBackgroundRight, kBackgroundFront, kBackgroundLeft, kBackgroundBack, kBackgroundRight,
kBackgroundTop, kBackgroundBottom, kCeiling, kFloor}; kBackgroundTop, kBackgroundBottom, kCeiling, kFloor};
...@@ -263,7 +260,7 @@ TEST_F(UiSceneManagerTest, WebVrAutopresentedInsecureOrigin) { ...@@ -263,7 +260,7 @@ TEST_F(UiSceneManagerTest, WebVrAutopresentedInsecureOrigin) {
manager_->SetWebVrMode(true, false); manager_->SetWebVrMode(true, false);
// Initially, the security warnings should not be visible since the first // Initially, the security warnings should not be visible since the first
// WebVR frame is not received. // WebVR frame is not received.
auto initial_elements = kBackgroundElements; auto initial_elements = std::set<UiElementName>();
initial_elements.insert(kSplashScreenText); initial_elements.insert(kSplashScreenText);
initial_elements.insert(kSplashScreenBackground); initial_elements.insert(kSplashScreenBackground);
VerifyElementsVisible("Initial", initial_elements); VerifyElementsVisible("Initial", initial_elements);
...@@ -294,7 +291,7 @@ TEST_F(UiSceneManagerTest, WebVrAutopresented) { ...@@ -294,7 +291,7 @@ TEST_F(UiSceneManagerTest, WebVrAutopresented) {
manager_->SetWebVrSecureOrigin(true); manager_->SetWebVrSecureOrigin(true);
// Initially, we should only show the splash screen. // Initially, we should only show the splash screen.
auto initial_elements = kBackgroundElements; auto initial_elements = std::set<UiElementName>();
initial_elements.insert(kSplashScreenText); initial_elements.insert(kSplashScreenText);
initial_elements.insert(kSplashScreenBackground); initial_elements.insert(kSplashScreenBackground);
VerifyElementsVisible("Initial", initial_elements); VerifyElementsVisible("Initial", initial_elements);
......
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