Age | Commit message (Collapse) | Author |
|
Change-Id: I39ff6476316e15776db2dbf9e48c777b3e6201af
|
|
BUG: 226647693
Change-Id: I951f1611770db77fb3440844d7ad320f9a2461b8
|
|
Change-Id: I4fa402384d71c1dc0d9f000057c0ebec7542011b
|
|
|
|
In particular, Clamp01(Normalize(x, x, y)) should be 1 if y > x and 0 if y < x. (The real ambiguous case is where start == end == value, in which case we're still having Clamp01(Normalize(x, x, x)) be 0 arbitrarily.)
Instead, rename Normalize to Normalize01, clamp the results to the range [0, 1], and return 0 if value < start and 1 if value > end.
This allows us to pick the correct (none or all) amount of interpolation in WobbleSmoother when WobbleSmootherParams.speed_floor == WobbleSmootherParams.speed_ceiling, which is permitted.
PiperOrigin-RevId: 437017353
|
|
So far not checking more specific bounds for pressure/orientation/direction to not disturb existing uses.
PiperOrigin-RevId: 437007881
|
|
`float = float / static_cast<float>(size_t)` should be equivalent to `float = float / size_t`, implicit conversion does the same thing.
`float = float / double` is not quite equivalent to `float = float / static_cast<float>(double)`. In the former case, the first operand is converted to a double and divided before the result is converted to float.
PiperOrigin-RevId: 437007538
|
|
Just use gtest_main when not using mocking or matchers specifically.
PiperOrigin-RevId: 436805253
|
|
In particular, note that StrokeModeler doesn't do palm rejection or separate inputs into multiple simultaneous strokes.
PiperOrigin-RevId: 436788494
|
|
And add unit tests.
PiperOrigin-RevId: 436519937
|
|
Bazel accepts either, but this avoids conflicts with build/ subdirs on Mac OS. And it seems to be standard practice for other projects like Abseil.
PiperOrigin-RevId: 435095006
|
|
Also tweaks the names used in FetchContent_* for consistency.
PiperOrigin-RevId: 434836209
|
|
This requires more care in how header-only libraries are defined, since the Mac version of ar is more finicky about that.
PiperOrigin-RevId: 433229538
|
|
PiperOrigin-RevId: 433213721
|
|
PiperOrigin-RevId: 433078561
|
|
Focus on consumers using submodules + add_subdirectory, pruning logic related to local installation for now. Targets are now namespaced properly in `InkStrokeModeler::`.
Adds usage documentation for consuming the library from Bazel and CMake projects.
PiperOrigin-RevId: 433015667
|
|
|
|
|
|
PiperOrigin-RevId: 432522663
|
|
This involved fixing three types of issues:
1. warning: control reaches end of non-void function
These were instances of exhaustive switch statements with nothing following to handle invalid values. Even if your switch is exhaustive, it's possible for an enum type to have a value that's not one of the specific enum values and thus not hit any of the cases in the switch statement. If that causes execution to hit the end of a non-void function without a return statement, that's undefined behavior. See https://abseil.io/tips/147.
This was a real (though hopefully irrelevant) bug in our handling of invalid input in `StrokeModeler::Update` and the output operator for `Input::EventType`.
2. warning: comparison of integer expressions of different signedness
Comparing unsigned and signed integer types does not work as you'd expect numeric comparisons between the two numbers in question to work, since the unsigned value gets naively cast to signed. Most of the cases of the warning cropping up were due to looping from zero to the size of a container, where the container size type is unsigned. In those cases, I use the container size type I'm comparing against, replacing:
`for(int i = 0; i < container.size(); i++)`
With:
`for(decltype(container.size()) i = 0; i < container.size(); i++)`
In a few cases, we're comparing an unsigned container size type with a user-provided int, which seems like a real bug. In those cases, I changed the logic to explicitly check for negative values, replacing:
`if (x < container.size())`
With:
`if (x < 0 || (uint) x < container.size())`
3. error: converting to 'ink::stroke_model::Duration' from initializer list would use explicit constructor
(Similar for Time.)
This is showing up in GCC in cases like:
```
const KalmanPredictorParams params{
...
.prediction_interval{1}}
```
Here we have a struct being initialized with aggregate initialization using designated initializers:
https://en.cppreference.com/w/cpp/language/aggregate_initialization
"Each direct non-static data member named by the designated initializer is initialized from the corresponding brace-or-equals initializer that follows the designator. Narrowing conversions are prohibited."
So here we should be initializing from the brace initializer. This is a class type and there's no equals sign, so it's direct list initialization:
https://en.cppreference.com/w/cpp/language/list_initialization
And that should allow explicit constructors. This is a known bug in GCC:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91319
But that can be worked around by being explicit about those types in the aggregate initialization, replacing something like:
`{.time{1}}`
With something like:
`{.time{Time(1)}}`
(Sometimes changing that to the copy-list-initializer form with the equals for readability.)
PiperOrigin-RevId: 432492904
|
|
Remove running on pull_request events for existing workflow, that's redundant with running on push. (Currently it's running twice on the same code when a change is pushed and a PR created.)
Set CMAKE_CXX_STANDARD _before_ compiling Abseil. Stop setting CMAKE_CXX_COMPILER (apparently inconsistently).
PiperOrigin-RevId: 432278083
|
|
PiperOrigin-RevId: 432250242
|
|
PiperOrigin-RevId: 432241952
|
|
Runs bazel test on PR creation / merge.
PiperOrigin-RevId: 432236222
|
|
PiperOrigin-RevId: 432057901
|
|
PiperOrigin-RevId: 432012667
|
|
PiperOrigin-RevId: 432010951
|
|
PiperOrigin-RevId: 432008956
|
|
Use an alias for a dependency which uses a different target upstream
|
|
PiperOrigin-RevId: 431979296
|
|
|
|
PiperOrigin-RevId: 428055624
|
|
PiperOrigin-RevId: 428039385
|
|
I thought the GitHub site would strip these, but it escapes them instead. Will have to see if those can be added to a GitHub pages index page which includes the content of the README.md.
PiperOrigin-RevId: 427810654
|
|
The latter will only work on GitHub Pages, since the rendering on the github domain scrubs JS. Will add a link to that once it's set up.
PiperOrigin-RevId: 427742617
|
|
PiperOrigin-RevId: 427187157
|
|
|