mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-11-03 14:50:59 +00:00
This is a preparation for upcoming changes where ImmutableBitmap will own SkImage allowing Skia to cache GPU textures across repaints.
24 lines
519 B
C++
24 lines
519 B
C++
/*
|
|
* Copyright (c) 2023-2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibGfx/ImmutableBitmap.h>
|
|
|
|
namespace Gfx {
|
|
|
|
static size_t s_next_immutable_bitmap_id = 0;
|
|
|
|
NonnullRefPtr<ImmutableBitmap> ImmutableBitmap::create(NonnullRefPtr<Bitmap> bitmap)
|
|
{
|
|
return adopt_ref(*new ImmutableBitmap(move(bitmap)));
|
|
}
|
|
|
|
ImmutableBitmap::ImmutableBitmap(NonnullRefPtr<Bitmap> bitmap)
|
|
: m_bitmap(move(bitmap))
|
|
, m_id(s_next_immutable_bitmap_id++)
|
|
{
|
|
}
|
|
|
|
}
|