mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibPDF: Add debug settings for clipping paths and images
This commit is contained in:
parent
2d8a22f4b4
commit
1845a406ea
Notes:
sideshowbarker
2024-07-17 05:09:48 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/1845a406ea Pull-request: https://github.com/SerenityOS/serenity/pull/22820
2 changed files with 10 additions and 3 deletions
|
@ -312,13 +312,15 @@ void Renderer::deactivate_clip()
|
|||
|
||||
void Renderer::begin_path_paint()
|
||||
{
|
||||
activate_clip();
|
||||
if (m_rendering_preferences.clip_paths)
|
||||
activate_clip();
|
||||
}
|
||||
|
||||
void Renderer::end_path_paint()
|
||||
{
|
||||
m_current_path.clear();
|
||||
deactivate_clip();
|
||||
if (m_rendering_preferences.clip_paths)
|
||||
deactivate_clip();
|
||||
}
|
||||
|
||||
RENDERER_HANDLER(path_stroke)
|
||||
|
@ -1238,7 +1240,9 @@ PDFErrorOr<void> Renderer::show_image(NonnullRefPtr<StreamObject> image)
|
|||
Renderer& m_renderer;
|
||||
};
|
||||
|
||||
ClipRAII clip_raii(*this);
|
||||
OwnPtr<ClipRAII> clip_raii;
|
||||
if (m_rendering_preferences.clip_images)
|
||||
clip_raii = make<ClipRAII>(*this);
|
||||
|
||||
if (!m_rendering_preferences.show_images) {
|
||||
show_empty_image(width, height);
|
||||
|
|
|
@ -90,6 +90,9 @@ struct RenderingPreferences {
|
|||
bool show_clipping_paths { false };
|
||||
bool show_images { true };
|
||||
|
||||
bool clip_paths { true };
|
||||
bool clip_images { true };
|
||||
|
||||
unsigned hash() const
|
||||
{
|
||||
return static_cast<unsigned>(show_clipping_paths) | static_cast<unsigned>(show_images) << 1;
|
||||
|
|
Loading…
Add table
Reference in a new issue