mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-10 19:46:03 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
40
Libraries/LibGfx/Font/FontData.cpp
Normal file
40
Libraries/LibGfx/Font/FontData.cpp
Normal 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))
|
||||
{
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue