Revert "Add color transformation for voice interaction overlay"
This reverts commit f25b3f25ae9a51ab84e3ad9fe70b0f96eeefdc4c.
Reason for revert: UX does not want to change the color anymore.
BUG=b:64614459
TEST=build locally and see changes
Original change's description:
> Add color transformation for voice interaction overlay
>
> TEST=locally build and flash, check animation
> BUG=b:35624617
>
> Change-Id: Ibc1a6ff218790c547138ca406bb923467bc4fb8a
> Reviewed-on: https://chromium-review.googlesource.com/581855
> Reviewed-by: Mitsuru Oshima <[email protected]>
> Commit-Queue: Xiaohui Chen <[email protected]>
> Cr-Commit-Position: refs/heads/master@{#490041}
Bug: b:35624617
Change-Id: I22948adb311ec3d1cac6dd7737447faad837d7f1
Reviewed-on: https://chromium-review.googlesource.com/612566
Reviewed-by: Mitsuru Oshima <[email protected]>
Commit-Queue: Xiaohui Chen <[email protected]>
Cr-Commit-Position: refs/heads/master@{#494494}
diff --git a/ash/shelf/voice_interaction_overlay.cc b/ash/shelf/voice_interaction_overlay.cc
index 2495e28..ff9f47e 100644
--- a/ash/shelf/voice_interaction_overlay.cc
+++ b/ash/shelf/voice_interaction_overlay.cc
@@ -87,8 +87,6 @@
constexpr float kBackgroundCornerRadiusDip = 12.f;
constexpr float kBackgroundPaddingDip = 6.f;
constexpr int kBackgroundMorphDurationMs = 150;
-constexpr SkColor kBackgroundColor = SK_ColorWHITE;
-constexpr SkColor kBackgroundFinalColor = static_cast<SkColor>(0xFFF5F5F5);
constexpr int kHideDurationMs = 200;
@@ -228,26 +226,18 @@
center_point_(
gfx::PointF(kBackgroundSizeDip / 2, kBackgroundSizeDip / 2)),
circle_layer_delegate_(base::MakeUnique<views::CircleLayerDelegate>(
- kBackgroundColor,
- kBackgroundSizeDip / 2)),
- bg_circle_layer_delegate_(base::MakeUnique<views::CircleLayerDelegate>(
- kBackgroundFinalColor,
+ SK_ColorWHITE,
kBackgroundSizeDip / 2)),
rect_layer_delegate_(base::MakeUnique<views::RectangleLayerDelegate>(
- kBackgroundColor,
- gfx::SizeF(small_size_))),
- bg_rect_layer_delegate_(base::MakeUnique<views::RectangleLayerDelegate>(
- kBackgroundFinalColor,
+ SK_ColorWHITE,
gfx::SizeF(small_size_))) {
set_name("VoiceInteractionOverlay:BACKGROUND_LAYER");
SetBounds(gfx::Rect(0, 0, kBackgroundInitSizeDip, kBackgroundInitSizeDip));
SetFillsBoundsOpaquely(false);
SetMasksToBounds(false);
- for (int i = 0; i < PAINTED_SHAPE_COUNT; ++i) {
- AddPaintLayer(static_cast<PaintedShape>(i), true);
- AddPaintLayer(static_cast<PaintedShape>(i), false);
- }
+ for (int i = 0; i < PAINTED_SHAPE_COUNT; ++i)
+ AddPaintLayer(static_cast<PaintedShape>(i));
shadow_values_ =
gfx::ShadowValue::MakeMdShadowValues(kBackgroundShadowElevationDip);
@@ -327,26 +317,18 @@
typedef gfx::Transform PaintedShapeTransforms[PAINTED_SHAPE_COUNT];
- void AddPaintLayer(PaintedShape painted_shape, bool is_background) {
+ void AddPaintLayer(PaintedShape painted_shape) {
ui::LayerDelegate* delegate = nullptr;
switch (painted_shape) {
case TOP_LEFT_CIRCLE:
case TOP_RIGHT_CIRCLE:
case BOTTOM_RIGHT_CIRCLE:
case BOTTOM_LEFT_CIRCLE:
- if (is_background) {
- delegate = bg_circle_layer_delegate_.get();
- } else {
- delegate = circle_layer_delegate_.get();
- }
+ delegate = circle_layer_delegate_.get();
break;
case HORIZONTAL_RECT:
case VERTICAL_RECT:
- if (is_background) {
- delegate = bg_rect_layer_delegate_.get();
- } else {
- delegate = rect_layer_delegate_.get();
- }
+ delegate = rect_layer_delegate_.get();
break;
case PAINTED_SHAPE_COUNT:
NOTREACHED() << "PAINTED_SHAPE_COUNT is not an actual shape type.";
@@ -364,27 +346,17 @@
layer->SetMasksToBounds(false);
layer->set_name("PAINTED_SHAPE_COUNT:" + ToLayerName(painted_shape));
- if (is_background) {
- bg_painted_layers_[static_cast<int>(painted_shape)].reset(layer);
- } else {
- painted_layers_[static_cast<int>(painted_shape)].reset(layer);
- }
+ painted_layers_[static_cast<int>(painted_shape)].reset(layer);
}
void SetTransforms(const PaintedShapeTransforms transforms) {
- for (int i = 0; i < PAINTED_SHAPE_COUNT; ++i) {
+ for (int i = 0; i < PAINTED_SHAPE_COUNT; ++i)
painted_layers_[i]->SetTransform(transforms[i]);
- bg_painted_layers_[i]->SetTransform(transforms[i]);
- }
}
void SetPaintedLayersVisible(bool visible) {
- for (int i = 0; i < PAINTED_SHAPE_COUNT; ++i) {
+ for (int i = 0; i < PAINTED_SHAPE_COUNT; ++i)
painted_layers_[i]->SetVisible(visible);
- painted_layers_[i]->SetOpacity(1);
- bg_painted_layers_[i]->SetVisible(visible);
- bg_painted_layers_[i]->SetOpacity(1);
- }
}
void CalculateCircleTransforms(const gfx::Size& size,
@@ -487,25 +459,6 @@
ui::ScopedLayerAnimationSettings animation(animator);
animation.SetPreemptionStrategy(preemption_strategy);
animation.SetTweenType(tween);
- animation.SetTransitionDuration(duration);
- painted_layers_[i]->SetOpacity(0);
- std::unique_ptr<ui::LayerAnimationElement> element =
- ui::LayerAnimationElement::CreateTransformElement(transforms[i],
- duration);
- ui::LayerAnimationSequence* sequence =
- new ui::LayerAnimationSequence(std::move(element));
-
- if (animation_observer)
- sequence->AddObserver(animation_observer);
-
- animator->StartAnimation(sequence);
- }
-
- for (int i = 0; i < PAINTED_SHAPE_COUNT; ++i) {
- ui::LayerAnimator* animator = bg_painted_layers_[i]->GetAnimator();
- ui::ScopedLayerAnimationSettings animation(animator);
- animation.SetPreemptionStrategy(preemption_strategy);
- animation.SetTweenType(tween);
std::unique_ptr<ui::LayerAnimationElement> element =
ui::LayerAnimationElement::CreateTransformElement(transforms[i],
duration);
@@ -549,7 +502,7 @@
gfx::Canvas* canvas = recorder.canvas();
cc::PaintFlags flags;
- flags.setColor(kBackgroundColor);
+ flags.setColor(SK_ColorWHITE);
flags.setAntiAlias(true);
flags.setStyle(cc::PaintFlags::kFill_Style);
flags.setLooper(gfx::CreateShadowDrawLooper(shadow_values_));
@@ -564,11 +517,8 @@
void OnDeviceScaleFactorChanged(float device_scale_factor) override {}
// ui::Layers for all of the painted shape layers that compose the morphing
- // shape. We have two sets, one is rendered in the foreground, the other set
- // behind. We use them to create an animated transition between two colors by
- // fading out one set during transformation.
+ // shape.
std::unique_ptr<ui::Layer> painted_layers_[PAINTED_SHAPE_COUNT];
- std::unique_ptr<ui::Layer> bg_painted_layers_[PAINTED_SHAPE_COUNT];
const gfx::Size large_size_;
@@ -579,11 +529,9 @@
// ui::LayerDelegate to paint circles for all the circle layers.
std::unique_ptr<views::CircleLayerDelegate> circle_layer_delegate_;
- std::unique_ptr<views::CircleLayerDelegate> bg_circle_layer_delegate_;
// ui::LayerDelegate to paint rectangles for all the rectangle layers.
std::unique_ptr<views::RectangleLayerDelegate> rect_layer_delegate_;
- std::unique_ptr<views::RectangleLayerDelegate> bg_rect_layer_delegate_;
gfx::ShadowValues shadow_values_;