mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibGfx+LibWebView+UI: Store Gfx::Bitmap in RefPtr to const
This commit is contained in:
parent
be2dd91289
commit
91b549f797
Notes:
github-actions[bot]
2025-04-16 16:44:09 +00:00
Author: https://github.com/ADKaster
Commit: 91b549f797
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4362
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/Hendiadyoin1
8 changed files with 15 additions and 15 deletions
|
@ -328,7 +328,7 @@ static void run_ref_test(HeadlessWebView& view, Test& test, URL::URL const& url,
|
|||
if (Application::the().dump_failed_ref_tests) {
|
||||
warnln("\033[33;1mRef test {} failed; dumping screenshots\033[0m", test.relative_path);
|
||||
|
||||
auto dump_screenshot = [&](Gfx::Bitmap& bitmap, StringView path) -> ErrorOr<void> {
|
||||
auto dump_screenshot = [&](Gfx::Bitmap const& bitmap, StringView path) -> ErrorOr<void> {
|
||||
auto screenshot_file = TRY(Core::File::open(path, Core::File::OpenMode::Write));
|
||||
auto encoded_data = TRY(Gfx::PNGWriter::encode(bitmap));
|
||||
TRY(screenshot_file->write_until_depleted(encoded_data));
|
||||
|
@ -375,13 +375,13 @@ static void run_ref_test(HeadlessWebView& view, Test& test, URL::URL const& url,
|
|||
} else {
|
||||
test.ref_test_expectation_type = RefTestExpectationType::Match;
|
||||
}
|
||||
view.take_screenshot()->when_resolved([&view, &test, on_test_complete = move(on_test_complete)](RefPtr<Gfx::Bitmap> screenshot) {
|
||||
view.take_screenshot()->when_resolved([&view, &test, on_test_complete = move(on_test_complete)](RefPtr<Gfx::Bitmap const> screenshot) {
|
||||
test.expectation_screenshot = move(screenshot);
|
||||
view.reset_zoom();
|
||||
on_test_complete();
|
||||
});
|
||||
} else {
|
||||
view.take_screenshot()->when_resolved([&view, &test](RefPtr<Gfx::Bitmap> screenshot) {
|
||||
view.take_screenshot()->when_resolved([&view, &test](RefPtr<Gfx::Bitmap const> screenshot) {
|
||||
test.actual_screenshot = move(screenshot);
|
||||
view.reset_zoom();
|
||||
view.debug_request("load-reference-page");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue