skia2/modules
Florin Malita b24f3b150c [skottie] Refactor keyframe encoding
For each Lottie keyframe, we currently store interpolation
*segments*:

 {
   t0, v0
   t1, v1
   cubic_mapper
 }

This is quite redundant:

 - kf(n).t1 == kf(n+1).t0 for all keyframes
 - kf(n).v1 == kf(n+1).v0 for all non-constant keyframes

Refactor to store single keyframe records:

  {
    t, v
    mapping
  }

To identify constant keyframes, since we no longer store
explicit hard stops, we now tag each record with a "mapping"
selector:

    0 -> constant keyframe
    1 -> linear keyframe
  > 1 -> cubic keyframe (adjusted cubic mapper index)


This reduces the storage size by 2/5, and yields overall cleaner
logic (as we're no longer back-filling info as we parse).

Also add a handful of unit tests to lock down limit semantics
(keyframe segments are left-inclusive/right-exclusive).

Change-Id: I3ab0e5568b83ab8536a7d326dbc07c4c455e978d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270450
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2020-02-13 18:54:32 +00:00
..
canvaskit Change SkSL main() from (float x, float y) to (float2 p) 2020-02-07 20:19:13 +00:00
particles Fix crash when editing particle scripts 2020-02-10 15:08:00 +00:00
pathkit Fix wasm builds 2020-01-28 19:03:49 +00:00
skottie [skottie] Refactor keyframe encoding 2020-02-13 18:54:32 +00:00
skparagraph Apply fake bold and italic settings to the SkFont if the typeface needs them 2020-02-12 22:17:26 +00:00
skplaintexteditor Remove SkTMin and SkTMax 2020-02-07 18:40:09 +00:00
skresources use std::make_unique 2019-12-12 22:32:45 +00:00
sksg [sksg] Improved layer elision heuristic 2020-02-07 23:20:34 +00:00
skshaper Remove SkTMin and SkTMax 2020-02-07 18:40:09 +00:00