mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
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:
committed by
Gregory Bertilson
parent
f704294ae8
commit
c47971e563
Notes:
github-actions[bot]
2026-04-18 06:26:02 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/c47971e5635
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user