summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2022-03-24 10:24:00 -0700
committerAndreas Kling <kling@serenityos.org>2022-03-31 18:10:45 +0200
commit34efc668d28213fc8e29bcc93839033623b88b7f (patch)
tree3911063aac2596f158dd3f266b21950e3cacb498
parente1115cfe4836655320765c972efc15a62ae9b1f6 (diff)
downloadserenity-34efc668d28213fc8e29bcc93839033623b88b7f.zip
LibPDF: Handle SCN and scn operators
-rw-r--r--Userland/Libraries/LibPDF/Renderer.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/Userland/Libraries/LibPDF/Renderer.cpp b/Userland/Libraries/LibPDF/Renderer.cpp
index 937048c801..01b0034636 100644
--- a/Userland/Libraries/LibPDF/Renderer.cpp
+++ b/Userland/Libraries/LibPDF/Renderer.cpp
@@ -480,7 +480,16 @@ RENDERER_HANDLER(set_stroking_color)
return {};
}
-RENDERER_TODO(set_stroking_color_extended)
+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>())
+ TODO();
+
+ state().stroke_color = state().stroke_color_space->color(args);
+ return {};
+}
RENDERER_HANDLER(set_painting_color)
{
@@ -488,7 +497,16 @@ RENDERER_HANDLER(set_painting_color)
return {};
}
-RENDERER_TODO(set_painting_color_extended)
+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>())
+ TODO();
+
+ state().paint_color = state().paint_color_space->color(args);
+ return {};
+}
RENDERER_HANDLER(set_stroking_color_and_space_to_gray)
{