[Webkit-unassigned] [Bug 93523] Why doesn't RotateTransformOperation::blend() check for |this| being axis-aligned too?

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 14 07:29:25 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=93523





--- Comment #2 from vollick at chromium.org  2012-08-14 07:29:54 PST ---
Could we do something like this?

// Optimize for single axis rotation
if (!fromOp || hasSameAxis(*fromOp)) {
    double fromAngle = fromOp ? fromOp->m_angle : 0;
    return RotateTransformOperation::create(m_x, m_y, m_z,
        WebCore::blend(fromAngle, m_angle, progress), m_type);
}

where,

bool RotateTransformOperation::hasSameAxis(const RotateTransformOperation& other)
{
    double length = sqrt(m_x * m_x + m_y * m_y + m_z * m_z);
    double otherLength = sqrt(other.m_x * other.m_x + other.m_y * other.m_y + other.m_z * other.m_z);

    if (length <= EPSILON || otherLength <= EPSILON)
        return false;

    double dot = other.m_x * m_x + other.m_y * m_y + other.m_z * m_z;
    double error = fabs(1.0 - dot / (length * otherLength));
    return error < EPSILON;
}

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list