#include "ui/gfx/shadow_value.h"
#include <stddef.h>
#include <algorithm>
#include "base/check_op.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/stringprintf.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/vector2d_conversions.h"
namespace gfx {
namespace {
constexpr int kBlurCorrection = …;
Insets GetInsets(const ShadowValues& shadows, bool include_inner_blur) { … }
}
ShadowValue ShadowValue::Scale(float scale) const { … }
std::string ShadowValue::ToString() const { … }
Insets ShadowValue::GetMargin(const ShadowValues& shadows) { … }
Insets ShadowValue::GetBlurRegion(const ShadowValues& shadows) { … }
ShadowValues ShadowValue::MakeShadowValues(int elevation,
SkColor key_shadow_color,
SkColor ambient_shadow_color) { … }
ShadowValues ShadowValue::MakeMdShadowValues(int elevation, SkColor color) { … }
ShadowValues ShadowValue::MakeMdShadowValues(int elevation,
SkColor key_shadow_color,
SkColor ambient_shadow_color) { … }
#if BUILDFLAG(IS_CHROMEOS)
ShadowValues ShadowValue::MakeChromeOSSystemUIShadowValues(int elevation,
SkColor color) {
return MakeChromeOSSystemUIShadowValues(elevation, SkColorSetA(color, 0x3d),
SkColorSetA(color, 0x1a));
}
ShadowValues ShadowValue::MakeChromeOSSystemUIShadowValues(
int elevation,
SkColor key_shadow_color,
SkColor ambient_shadow_color) {
ShadowValues shadow_values;
shadow_values.emplace_back(Vector2d(0, elevation),
kBlurCorrection * elevation, key_shadow_color);
shadow_values.emplace_back(Vector2d(), kBlurCorrection * elevation,
ambient_shadow_color);
return shadow_values;
}
#endif
}