LibGfx: Stop storing SkYUVAPixmaps in YUVData

Storing these was pointless, since they're only used briefly to provide
the info needed to upload the buffers to the GPU.

For BT.2020 coefficients, we can just say that the bit depth is 16 bits
since we're always bit replicating to that for Skia's shaders.
This commit is contained in:
Zaggy1024
2026-04-16 21:09:12 -05:00
committed by Gregory Bertilson
parent f704294ae8
commit c47971e563
Notes: github-actions[bot] 2026-04-18 06:26:02 +00:00
4 changed files with 110 additions and 127 deletions

View File

@@ -345,7 +345,9 @@ bool ImmutableBitmap::ensure_sk_image(SkiaBackendContext& context) const
if (!gr_context)
return false; // No GPU, cannot create image from YUV data
auto const& pixmaps = m_impl->yuv_data->skia_yuva_pixmaps();
if (m_impl->yuv_data->bit_depth() > 8)
m_impl->yuv_data->expand_samples_to_full_16_bit_range();
auto pixmaps = m_impl->yuv_data->make_pixmaps();
auto color_space = color_space_from_cicp(m_impl->yuv_data->cicp());
auto sk_image = SkImages::TextureFromYUVAPixmaps(
@@ -360,6 +362,7 @@ bool ImmutableBitmap::ensure_sk_image(SkiaBackendContext& context) const
m_impl->context = context;
m_impl->sk_image = move(sk_image);
m_impl->yuv_data = nullptr;
return true;
}