#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "ui/gfx/geometry/transform_operation.h"
#include <algorithm>
#include <limits>
#include <numbers>
#include <utility>
#include "base/check_op.h"
#include "base/notreached.h"
#include "base/numerics/angle_conversions.h"
#include "base/numerics/ranges.h"
#include "ui/gfx/geometry/box_f.h"
#include "ui/gfx/geometry/transform_operations.h"
#include "ui/gfx/geometry/transform_util.h"
#include "ui/gfx/geometry/vector3d_f.h"
namespace {
const SkScalar kAngleEpsilon = …;
}
namespace gfx {
bool TransformOperation::IsIdentity() const { … }
static bool IsOperationIdentity(const TransformOperation* operation) { … }
static bool ShareSameAxis(const TransformOperation* from,
bool is_identity_from,
const TransformOperation* to,
bool is_identity_to,
SkScalar* axis_x,
SkScalar* axis_y,
SkScalar* axis_z,
SkScalar* angle_from) { … }
static SkScalar BlendSkScalars(SkScalar from, SkScalar to, SkScalar progress) { … }
void TransformOperation::Bake() { … }
bool TransformOperation::ApproximatelyEqual(const TransformOperation& other,
SkScalar tolerance) const { … }
bool TransformOperation::BlendTransformOperations(
const TransformOperation* from,
const TransformOperation* to,
SkScalar progress,
TransformOperation* result) { … }
static void FindCandidatesInPlane(float px,
float py,
float nz,
double* candidates,
int* num_candidates) { … }
static void BoundingBoxForArc(const gfx::Point3F& point,
const TransformOperation* from,
const TransformOperation* to,
SkScalar min_progress,
SkScalar max_progress,
gfx::BoxF* box) { … }
bool TransformOperation::BlendedBoundsForBox(const gfx::BoxF& box,
const TransformOperation* from,
const TransformOperation* to,
SkScalar min_progress,
SkScalar max_progress,
gfx::BoxF* bounds) { … }
}