mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:37:45 +00:00
LibPDF: Extract activate_clip() / deactivate_clip() functions
No behavior change.
This commit is contained in:
parent
d55867e563
commit
5615a2691a
2 changed files with 20 additions and 7 deletions
|
@ -290,11 +290,7 @@ RENDERER_HANDLER(path_append_rect)
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
void Renderer::activate_clip()
|
||||||
// Path painting operations
|
|
||||||
///
|
|
||||||
|
|
||||||
void Renderer::begin_path_paint()
|
|
||||||
{
|
{
|
||||||
auto bounding_box = state().clipping_paths.current.bounding_box();
|
auto bounding_box = state().clipping_paths.current.bounding_box();
|
||||||
m_painter.clear_clip_rect();
|
m_painter.clear_clip_rect();
|
||||||
|
@ -304,11 +300,25 @@ void Renderer::begin_path_paint()
|
||||||
m_painter.add_clip_rect(bounding_box.to_type<int>());
|
m_painter.add_clip_rect(bounding_box.to_type<int>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Renderer::deactivate_clip()
|
||||||
|
{
|
||||||
|
m_painter.clear_clip_rect();
|
||||||
|
state().clipping_paths.current = state().clipping_paths.next;
|
||||||
|
}
|
||||||
|
|
||||||
|
///
|
||||||
|
// Path painting operations
|
||||||
|
///
|
||||||
|
|
||||||
|
void Renderer::begin_path_paint()
|
||||||
|
{
|
||||||
|
activate_clip();
|
||||||
|
}
|
||||||
|
|
||||||
void Renderer::end_path_paint()
|
void Renderer::end_path_paint()
|
||||||
{
|
{
|
||||||
m_current_path.clear();
|
m_current_path.clear();
|
||||||
m_painter.clear_clip_rect();
|
deactivate_clip();
|
||||||
state().clipping_paths.current = state().clipping_paths.next;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RENDERER_HANDLER(path_stroke)
|
RENDERER_HANDLER(path_stroke)
|
||||||
|
|
|
@ -127,6 +127,9 @@ private:
|
||||||
PDFErrorOr<void> handle_text_next_line_show_string(ReadonlySpan<Value> args, Optional<NonnullRefPtr<DictObject>> = {});
|
PDFErrorOr<void> handle_text_next_line_show_string(ReadonlySpan<Value> args, Optional<NonnullRefPtr<DictObject>> = {});
|
||||||
PDFErrorOr<void> handle_text_next_line_show_string_set_spacing(ReadonlySpan<Value> args, Optional<NonnullRefPtr<DictObject>> = {});
|
PDFErrorOr<void> handle_text_next_line_show_string_set_spacing(ReadonlySpan<Value> args, Optional<NonnullRefPtr<DictObject>> = {});
|
||||||
|
|
||||||
|
void activate_clip();
|
||||||
|
void deactivate_clip();
|
||||||
|
|
||||||
void begin_path_paint();
|
void begin_path_paint();
|
||||||
void end_path_paint();
|
void end_path_paint();
|
||||||
PDFErrorOr<void> set_graphics_state_from_dict(NonnullRefPtr<DictObject>);
|
PDFErrorOr<void> set_graphics_state_from_dict(NonnullRefPtr<DictObject>);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue