Re: [geometry] Replace isIdentity()?

On Sat, Jun 7, 2014 at 8:33 AM, Dirk Schulze <dschulze@adobe.com> wrote:
> Other people and engineers like me believe that this is too restrictive. In favor for isIdentity(), even with the concerns in the introduction:
>
> 1) isIdentity() as currently specified must be implemented so that it can guarantee all of the above scenarios that maybeHasTransform() can guarantee as well.
> 2) isIdentity() is nearly exclusively used to skip complex and costy computational operations entirely that would not cause any visual difference for identity. The worst case: the matrix is close to identity but not exactly identity and the application needs to do all these operations. While it can optimize other times. It could never optimize for maybeHasTransform().
> 3) All browser implementations, graphic libraries, game engines use or provide isIdentity(). In none of the instances the mentioned problems caused problems beside the one describe in 2).
> 5) Authors create DOMMatrix to transform it. In this case maybeHasTransform() is useless because it will then always return ’not identity'.
> 6) For isIdentity(), the author can do transform operations and check at any time for identity.
> 7) maybeHasTransform() can only be useful if a system API returns a DOMMatrix object. (There is none today but will be in the future.)
> 8) isIdentity() can be implemented with the help of SSE and similar functionalities so that it is not significant more complex or decreases performance.

Agree with this completely. Please keep isIdentity() as currently
written in the spec.  The downside that some code might
seemingly-randomly take the quick or slow path depending on precise
operations seems better than the downside of maybeHasTransform(),
which'll just make it always take the slow path.

Plus, authors can write an isNearlyIdentity() method for themselves if
they find they need it.  (We shouldn't provide this ourselves, as it's
a footgun in most cases, and the required threshold varies by use-case
and should be determined by experimentation.)

~TJ

Received on Saturday, 7 June 2014 19:19:27 UTC