[rust png] Discover frames more aggressively in `onGetFrameCount`.
Before this CL, `SkPngRustCodec::onGetFrameCount` would not skip over
frame data (i.e. over `IDAT` or `fdAT` chunks) to discover additional
frame metadta (i.e. `fcTL` chunks). This meant that even if all the
input data has been available, `onGetFrameCount` wouldn't necessarily
return the number of all frames (e.g. if initial frames haven't yet
been decoded). This had undesirable impact on Blink integration.
After this CL, `SkPngRustCodec::onGetFrameCount` would aggressively
consume the input `SkStream` to discover additional frame metadata.
Skipping over `IDAT` and `fdAT` chunks means that decoding them later
may necessitate `seek`ing earlier in the input. This seems ok
(and opportunities to improve the performance of `seek`ing are tracked
in https://crbug.com/371060427).
Bug: 356922876
Change-Id: I6c5cc686faf9c0766b75e8786e94b9155aeaa362
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/911038
Commit-Queue: Ćukasz Anforowicz <lukasza@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
Reviewed-by: Daniel Dilan <danieldilan@google.com>
6 files changed