dymokomi/luce-browser-engine
Source of release 0.6.0
0.6.0 / src / web / painting / svg_clip_paintable.lucb
#==============================================================================================
#
# svg_clip_paintable - Painting::SVGClipPaintable: the paintable of a <clipPath>
#
# DESCRIPTION:
# Port of LibWeb/Painting/SVGClipPaintable.cpp (lines 1-23) and SVGClipPaintable.h:
# creation; a clip path's subtree is painted only for the elements that reference it.
#
# Copyright (c) 2024, MacDue <macdue@dueutil.tech>
# SPDX-License-Identifier: BSD-2-Clause
#
#==============================================================================================
## Ported from Libraries/LibWeb/Painting/SVGClipPaintable.cpp:13 Web::Painting::SVGClipPaintable::create.
pub func paint_svg_clip_paintable_create(layout_box: LayoutSvgClipBox*) -> PaintSvgClipPaintable*:
let heap = gc.cell_heap(layout_box.cell())
let this = (PaintSvgClipPaintable*)web_heap_allocate_cell(heap, &paint_svg_clip_paintable_class)
gc.heap_defer_gc(heap)
paint_svg_clip_paintable_construct(this, layout_box)
gc.heap_undefer_gc(heap)
return this
## Ported from Libraries/LibWeb/Painting/SVGClipPaintable.h:21 Web::Painting::SVGClipPaintable::forms_unconnected_subtree (override).
pub func paint_svg_clip_paintable_forms_unconnected_subtree_impl(base: PaintPaintable*) -> bool:
_ = base
return true
## Ported from Libraries/LibWeb/Painting/SVGClipPaintable.cpp:18 Web::Painting::SVGClipPaintable::SVGClipPaintable.
pub func paint_svg_clip_paintable_construct(this: PaintSvgClipPaintable*, layout_box: LayoutSvgClipBox*):
paint_svg_paintable_construct(this.paint_svg_paintable(), layout_box.layout_svg_box())