mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
LibGfx: Ensure sk_image is available in ::export_to_byte_buffer()
When an ImmutableBitmap is constructed from video data, there's a probability that we're dealing with YUV data and we do not yet have an sk_image to work with. No regression test since we require a GPU to end up in this situation. Fixes the background scenery on https://screen.toys/roadtrip/.
This commit is contained in:
committed by
Gregory Bertilson
parent
7669854ddc
commit
b2e0a2515a
Notes:
github-actions[bot]
2026-04-15 22:09:11 +00:00
Author: https://github.com/gmta Commit: https://github.com/LadybirdBrowser/ladybird/commit/b2e0a2515a7 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8924 Reviewed-by: https://github.com/Zaggy1024
@@ -125,6 +125,9 @@ static SkColorType export_format_to_skia_color_type(ExportFormat format)
|
||||
|
||||
ErrorOr<BitmapExportResult> ImmutableBitmap::export_to_byte_buffer(ExportFormat format, int flags, Optional<int> target_width, Optional<int> target_height) const
|
||||
{
|
||||
if (SkiaBackendContext::the() && !ensure_sk_image(*SkiaBackendContext::the()))
|
||||
return Error::from_string_literal("Failed to create a Skia image for this ImmutableBitmap");
|
||||
|
||||
int width = target_width.value_or(this->width());
|
||||
int height = target_height.value_or(this->height());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user