1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

LibPDF: Add basic tiled, coloured pattern rendering

This commit is contained in:
Kyle Pereira 2023-12-07 13:07:56 +00:00 committed by Andreas Kling
parent 8191f2b47a
commit 8ff87911a3
5 changed files with 129 additions and 20 deletions

View file

@ -616,14 +616,8 @@ RENDERER_HANDLER(set_stroking_color)
RENDERER_HANDLER(set_stroking_color_extended)
{
// FIXME: Handle Pattern color spaces
auto last_arg = args.last();
if (last_arg.has<NonnullRefPtr<Object>>() && last_arg.get<NonnullRefPtr<Object>>()->is<NameObject>()) {
dbgln("pattern space {}", last_arg.get<NonnullRefPtr<Object>>()->cast<NameObject>()->name());
return Error::rendering_unsupported_error("Pattern color spaces not yet implemented");
}
state().stroke_style = TRY(state().stroke_color_space->style(args));
// FIXME: Pattern color spaces might need extra resources
state().paint_style = TRY(state().paint_color_space->style(args));
return {};
}
@ -635,13 +629,7 @@ RENDERER_HANDLER(set_painting_color)
RENDERER_HANDLER(set_painting_color_extended)
{
// FIXME: Handle Pattern color spaces
auto last_arg = args.last();
if (last_arg.has<NonnullRefPtr<Object>>() && last_arg.get<NonnullRefPtr<Object>>()->is<NameObject>()) {
dbgln("pattern space {}", last_arg.get<NonnullRefPtr<Object>>()->cast<NameObject>()->name());
return Error::rendering_unsupported_error("Pattern color spaces not yet implemented");
}
// FIXME: Pattern color spaces might need extra resources
state().paint_style = TRY(state().paint_color_space->style(args));
return {};
}