LibGfx: Use NonnullRefPtr<Bitmap> for frame descriptors
Some checks are pending
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

This makes it a bit easier to reason about where bitmaps should be
available.
This commit is contained in:
Jelle Raaijmakers 2025-06-25 10:25:28 +02:00 committed by Shannon Booth
commit 2687246808
Notes: github-actions[bot] 2025-06-25 10:55:58 +00:00
12 changed files with 35 additions and 42 deletions

View file

@ -21,10 +21,10 @@ ErrorOr<NonnullRefPtr<CMYKBitmap>> CMYKBitmap::create_with_size(IntSize const& s
return adopt_ref(*new CMYKBitmap(size, move(data)));
}
ErrorOr<RefPtr<Bitmap>> CMYKBitmap::to_low_quality_rgb() const
ErrorOr<NonnullRefPtr<Bitmap>> CMYKBitmap::to_low_quality_rgb() const
{
if (!m_rgb_bitmap) {
m_rgb_bitmap = TRY(Bitmap::create(BitmapFormat::BGRx8888, { m_size.width(), m_size.height() }));
m_rgb_bitmap = TRY(Bitmap::create(BitmapFormat::BGRx8888, m_size));
for (int y = 0; y < m_size.height(); ++y) {
for (int x = 0; x < m_size.width(); ++x) {
@ -35,7 +35,7 @@ ErrorOr<RefPtr<Bitmap>> CMYKBitmap::to_low_quality_rgb() const
}
}
return m_rgb_bitmap;
return *m_rgb_bitmap;
}
}