Everywhere: Hoist the Libraries folder to the top-level

This commit is contained in:
Timothy Flynn 2024-11-09 12:25:08 -05:00 committed by Andreas Kling
commit 93712b24bf
Notes: github-actions[bot] 2024-11-10 11:51:52 +00:00
4547 changed files with 104 additions and 113 deletions

View file

@ -0,0 +1,40 @@
/*
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibGfx/Font/FontData.h>
namespace Gfx {
NonnullOwnPtr<FontData> FontData::create_from_byte_buffer(ByteBuffer&& byte_buffer)
{
return adopt_own(*new FontData(move(byte_buffer)));
}
NonnullOwnPtr<FontData> FontData::create_from_resource(Core::Resource const& resource)
{
return adopt_own(*new FontData(resource));
}
ReadonlyBytes FontData::bytes() const
{
return m_data.visit(
[&](ByteBuffer const& byte_buffer) { return byte_buffer.bytes(); },
[&](Core::Resource const& resource) {
return resource.data();
});
}
FontData::FontData(ByteBuffer&& byte_buffer)
: m_data(move(byte_buffer))
{
}
FontData::FontData(NonnullRefPtr<Core::Resource> resource)
: m_data(move(resource))
{
}
}