Commit d6a779bd authored by Ian Vollick's avatar Ian Vollick Committed by Commit Bot

[vr] Pass ShouldUpdateWorldSpaceTransform to descendants

With this change, we should revert to the behavior prior to
crrev.com/c/1087170, however the reported dirtiness will still only be
true if the transform is actually updated.

Bug:850210

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_vr
Change-Id: I6a038953e0b658d9ea0b9a64a599faf5073cde9b
Reviewed-on: https://chromium-review.googlesource.com/1089854Reviewed-by: default avatarChristopher Grant <cjgrant@chromium.org>
Commit-Queue: Ian Vollick <vollick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565067}
parent 418507c6
...@@ -1016,7 +1016,8 @@ bool UiElement::UpdateWorldSpaceTransform(bool parent_changed) { ...@@ -1016,7 +1016,8 @@ bool UiElement::UpdateWorldSpaceTransform(bool parent_changed) {
return false; return false;
bool changed = false; bool changed = false;
if (ShouldUpdateWorldSpaceTransform(parent_changed)) { bool should_update = ShouldUpdateWorldSpaceTransform(parent_changed);
if (should_update) {
gfx::Transform transform; gfx::Transform transform;
transform.Translate(local_origin_.x(), local_origin_.y()); transform.Translate(local_origin_.x(), local_origin_.y());
...@@ -1042,7 +1043,10 @@ bool UiElement::UpdateWorldSpaceTransform(bool parent_changed) { ...@@ -1042,7 +1043,10 @@ bool UiElement::UpdateWorldSpaceTransform(bool parent_changed) {
bool child_changed = false; bool child_changed = false;
set_update_phase(kUpdatedWorldSpaceTransform); set_update_phase(kUpdatedWorldSpaceTransform);
for (auto& child : children_) { for (auto& child : children_) {
child_changed |= child->UpdateWorldSpaceTransform(changed); // TODO(crbug.com/850260): it's unfortunate that we're not passing down the
// same dirtiness signal that we return. I.e., we'd ideally use |changed|
// here.
child_changed |= child->UpdateWorldSpaceTransform(should_update);
} }
OnUpdatedWorldSpaceTransform(); OnUpdatedWorldSpaceTransform();
......
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