commit | 75065f227bdd9e8dadbebee2752cc537e90919c8 | [log] [tgz] |
---|---|---|
author | Steve Golton <stevegolton@google.com> | Tue Sep 03 15:50:50 2024 +0100 |
committer | Steve Golton <stevegolton@google.com> | Tue Sep 03 15:50:50 2024 +0100 |
tree | 70bdffb56a8547c9ad14bc605adfc79820efcd47 | |
parent | c77afa76b6d498b988eb5d428d959d03bcf050ef [diff] |
ui: Clean up 2D geometry library The existing 2D geometry library consists of a set of interfaces for Vectors and Rects, and some naked functions that operate on them. This is good from a duck typing perspective, as anything that quacks like a Vector/Rect can be passed in (i.e. mouseEvent or DOMRect). However, chaining is awkward. One must do: ```ts vectorAdd(a, vectorSub(b, c)) ``` as opposed to (ideally): ```ts b.sub(c).add(a) ``` It would be nice if we could duck type wherever possible but also allow method chaining. This CL introduces a new ethos to the geometry library "accept interfaces, return objects", which gives us the best of both worlds. I've also taken the opportunity to add helpful comments, and add comprehensive unit tests. Change-Id: Ibe7a5724389cd07afec9ed2204eae9683632f5ce
Perfetto is a production-grade open-source stack for performance instrumentation and trace analysis. It offers services and libraries and for recording system-level and app-level traces, native + java heap profiling, a library for analyzing traces using SQL and a web-based UI to visualize and explore multi-GB traces.
See https://perfetto.dev/docs or the /docs/ directory for documentation.