ladybird/Libraries/LibWeb/CSS/FontLoading.h
Aliaksandr Kalenik 4cd8e84dff LibGfx+LibWeb: Keep loaded font bytes shareable
Future compositor-side rendering will need WebContent to share typefaces
with the compositor process over IPC. If a typeface already keeps its
backing bytes in anonymous shared memory, IPC encoding can clone that
buffer handle instead of allocating a new shared buffer and copying the
same font data during upload.
2026-05-19 09:20:38 +02:00

22 lines
685 B
C++

/*
* Copyright (c) 2026-present, the Ladybird developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/ByteBuffer.h>
#include <AK/ByteString.h>
#include <AK/Function.h>
#include <AK/Optional.h>
#include <LibCore/AnonymousBuffer.h>
#include <LibGfx/Font/Typeface.h>
namespace Web::CSS {
bool requires_off_thread_vector_font_preparation(ByteBuffer const&, Optional<ByteString> const& mime_type_essence = {});
ErrorOr<NonnullRefPtr<Gfx::Typeface const>> try_load_vector_font(ByteBuffer const&, Optional<ByteString> const& mime_type_essence = {});
void prepare_vector_font_data_off_thread(ByteBuffer, Function<void(ErrorOr<Core::AnonymousBuffer>)>&&);
}