#include "ui/views/animation/square_ink_drop_ripple.h"
#include <algorithm>
#include <utility>
#include "base/functional/bind.h"
#include "base/logging.h"
#include "ui/compositor/compositor.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animation_sequence.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/gfx/animation/animation.h"
#include "ui/gfx/geometry/point3_f.h"
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/gfx/geometry/transform_util.h"
#include "ui/gfx/geometry/vector3d_f.h"
#include "ui/views/animation/animation_builder.h"
#include "ui/views/animation/animation_sequence_block.h"
#include "ui/views/animation/ink_drop_host.h"
#include "ui/views/animation/ink_drop_painted_layer_delegates.h"
#include "ui/views/style/platform_style.h"
#include "ui/views/view.h"
namespace views {
namespace {
constexpr float kMinimumRectScale = …;
constexpr float kMinimumCircleScale = …;
enum InkDropSubAnimations { … };
constexpr float kQuickActionBurstScale = …;
base::TimeDelta GetAnimationDuration(InkDropHost* ink_drop_host,
InkDropSubAnimations state) { … }
}
SquareInkDropRipple::SquareInkDropRipple(InkDropHost* ink_drop_host,
const gfx::Size& large_size,
int large_corner_radius,
const gfx::Size& small_size,
int small_corner_radius,
const gfx::Point& center_point,
SkColor color,
float visible_opacity)
: … { … }
SquareInkDropRipple::~SquareInkDropRipple() { … }
ui::Layer* SquareInkDropRipple::GetRootLayer() { … }
float SquareInkDropRipple::GetCurrentOpacity() const { … }
std::string SquareInkDropRipple::ToLayerName(PaintedShape painted_shape) { … }
void SquareInkDropRipple::AnimateStateChange(InkDropState old_ink_drop_state,
InkDropState new_ink_drop_state) { … }
void SquareInkDropRipple::SetStateToActivated() { … }
void SquareInkDropRipple::SetStateToHidden() { … }
void SquareInkDropRipple::AbortAllAnimations() { … }
void SquareInkDropRipple::SetTransforms(const InkDropTransforms transforms) { … }
void SquareInkDropRipple::SetOpacity(float opacity) { … }
void SquareInkDropRipple::CalculateCircleTransforms(
const gfx::Size& size,
InkDropTransforms* transforms_out) const { … }
void SquareInkDropRipple::CalculateRectTransforms(
const gfx::Size& desired_size,
float corner_radius,
InkDropTransforms* transforms_out) const { … }
gfx::Transform SquareInkDropRipple::CalculateCircleTransform(
float scale,
float target_center_x,
float target_center_y) const { … }
gfx::Transform SquareInkDropRipple::CalculateRectTransform(
float x_scale,
float y_scale) const { … }
void SquareInkDropRipple::GetCurrentTransforms(
InkDropTransforms* transforms_out) const { … }
void SquareInkDropRipple::GetActivatedTargetTransforms(
InkDropTransforms* transforms_out) const { … }
void SquareInkDropRipple::GetDeactivatedTargetTransforms(
InkDropTransforms* transforms_out) const { … }
void SquareInkDropRipple::AddPaintLayer(PaintedShape painted_shape) { … }
void SquareInkDropRipple::OnLayerAnimationSequenceScheduled(
ui::LayerAnimationSequence* sequence) { … }
}