skia/skia/47870d57277087777b9de9735a1a894e4e6ea2ec [rust bmp] Reduce fixed overhead for small decodes
This change adds a small memory-backed input path for Rusty BMP. When
the `SkStream` already exposes memory and the encoded BMP is small
(<=4KB), the codec passes the bytes directly to Rust/image-rs
`BmpDecoder` instead of wrapping the stream in `SkStreamAdapter` +
`BufReader`. Larger or incremental streams continue to use the existing
streaming path.
Local Chromium decoder-boundary benchmarks show this reduces small-image
Rust overhead while preserving larger-image wins. For example, with the
Chromium-side memory-backed stream prep:
- 24bit_1x1.bmp: Rust improves from ~6.2 us to ~4.3 us
- pal4_1x1.bmp: Rust improves from ~7.4 us to ~5.3 us
- bmp-size-32x32-8bpp.bmp remains ~73% faster than legacy C++
- large 32bpp-topdown-320x240.bmp remains ~77% faster than legacy C++
Bug: 452666425
Change-Id: I1d8975f31b7a66b158e8402341399a47dbfe26f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1283656
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Ćukasz Anforowicz <lukasza@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
4 files changed