Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-browser-engine

Source of release 0.6.0

0.6.0 / src / web / painting / svg_pattern_paintable.lucb

#==============================================================================================
#
#   svg_pattern_paintable - Painting::SVGPatternPaintable: the paintable of a <pattern>
#
#   DESCRIPTION:
#       Port of LibWeb/Painting/SVGPatternPaintable.cpp (lines 1-23) and SVGPatternPaintable.h:
#       creation; a pattern's tile is painted only as the paint server of the elements that
#       reference it.
#
#       Copyright (c) 2026, Tim Ledbetter <tim.ledbetter@ladybird.org>
#       SPDX-License-Identifier: BSD-2-Clause
#
#==============================================================================================

## Ported from Libraries/LibWeb/Painting/SVGPatternPaintable.cpp:13 Web::Painting::SVGPatternPaintable::create.
pub func paint_svg_pattern_paintable_create(layout_box: LayoutSvgPatternBox*) -> PaintSvgPatternPaintable*:
    let heap = gc.cell_heap(layout_box.cell())
    let this = (PaintSvgPatternPaintable*)web_heap_allocate_cell(heap, &paint_svg_pattern_paintable_class)
    gc.heap_defer_gc(heap)
    paint_svg_pattern_paintable_construct(this, layout_box)
    gc.heap_undefer_gc(heap)
    return this

## Ported from Libraries/LibWeb/Painting/SVGPatternPaintable.h:21 Web::Painting::SVGPatternPaintable::forms_unconnected_subtree (override).
pub func paint_svg_pattern_paintable_forms_unconnected_subtree_impl(base: PaintPaintable*) -> bool:
    _ = base
    return true

## Ported from Libraries/LibWeb/Painting/SVGPatternPaintable.cpp:18 Web::Painting::SVGPatternPaintable::SVGPatternPaintable.
pub func paint_svg_pattern_paintable_construct(this: PaintSvgPatternPaintable*, layout_box: LayoutSvgPatternBox*):
    paint_svg_paintable_construct(this.paint_svg_paintable(), layout_box.layout_svg_box())