Commit a6701b5b authored by Christopher Grant's avatar Christopher Grant Committed by Commit Bot

VR: Animate opacity of the loading indicator

This gives the fade in/out effect on the loading progress bar that 2D UI
now has.

BUG=853821
R=tiborg

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:linux_vr;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I3d07e2ea005c0fbaafb9042a257b3eac4979a4e9
Reviewed-on: https://chromium-review.googlesource.com/1104984
Commit-Queue: Christopher Grant <cjgrant@chromium.org>
Reviewed-by: default avatarTibor Goldschwendt <tiborg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568425}
parent 120f6870
...@@ -1425,6 +1425,7 @@ void UiSceneCreator::CreateContentQuad() { ...@@ -1425,6 +1425,7 @@ void UiSceneCreator::CreateContentQuad() {
indicator_bg->SetTranslate(0, kLoadingIndicatorYOffset, 0); indicator_bg->SetTranslate(0, kLoadingIndicatorYOffset, 0);
indicator_bg->SetCornerRadii( indicator_bg->SetCornerRadii(
{0, 0, kContentCornerRadius, kContentCornerRadius}); {0, 0, kContentCornerRadius, kContentCornerRadius});
indicator_bg->SetTransitionedProperties({OPACITY});
VR_BIND_VISIBILITY(indicator_bg, model->loading); VR_BIND_VISIBILITY(indicator_bg, model->loading);
VR_BIND_COLOR(model_, indicator_bg.get(), VR_BIND_COLOR(model_, indicator_bg.get(),
&ColorScheme::loading_indicator_background, &Rect::SetColor); &ColorScheme::loading_indicator_background, &Rect::SetColor);
......
...@@ -781,6 +781,7 @@ TEST_F(UiTest, LoadingIndicatorBindings) { ...@@ -781,6 +781,7 @@ TEST_F(UiTest, LoadingIndicatorBindings) {
model_->loading = true; model_->loading = true;
model_->load_progress = 0; model_->load_progress = 0;
RunForMs(100);
EXPECT_TRUE( EXPECT_TRUE(
VerifyVisibility({kLoadingIndicator, kLoadingIndicatorForeground}, true)); VerifyVisibility({kLoadingIndicator, kLoadingIndicatorForeground}, true));
EXPECT_EQ(foreground->GetClipRect(), gfx::RectF(0, 0, 0, 1)); EXPECT_EQ(foreground->GetClipRect(), gfx::RectF(0, 0, 0, 1));
......
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