mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 01:37:39 +03:00
acd5369774
Preparation work before adding support for SVGForeignObjectElement masking. Having a mixin makes possible sharing mask calculation between SVGForeignObjectElement's paintable and SVGGraphicsPaintable. Both has to support masking: - PaintableWithLines (from SVGForeignObjectElement) -> PaintableBox - SVGGraphicsPaintable -> SVGPaintable -> PaintableBox After this change it will be possible to introduce a new paintable type for foreignObject that inherits from both PaintableWithLines and SVGMaskable.
33 lines
907 B
C++
33 lines
907 B
C++
/*
|
|
* Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/Layout/ImageBox.h>
|
|
#include <LibWeb/Layout/SVGClipBox.h>
|
|
#include <LibWeb/Layout/SVGMaskBox.h>
|
|
#include <LibWeb/Painting/SVGClipPaintable.h>
|
|
#include <LibWeb/Painting/SVGGraphicsPaintable.h>
|
|
#include <LibWeb/Painting/StackingContext.h>
|
|
#include <LibWeb/SVG/SVGSVGElement.h>
|
|
|
|
namespace Web::Painting {
|
|
|
|
JS::NonnullGCPtr<SVGGraphicsPaintable> SVGGraphicsPaintable::create(Layout::SVGGraphicsBox const& layout_box)
|
|
{
|
|
return layout_box.heap().allocate_without_realm<SVGGraphicsPaintable>(layout_box);
|
|
}
|
|
|
|
SVGGraphicsPaintable::SVGGraphicsPaintable(Layout::SVGGraphicsBox const& layout_box)
|
|
: SVGPaintable(layout_box)
|
|
{
|
|
}
|
|
|
|
Layout::SVGGraphicsBox const& SVGGraphicsPaintable::layout_box() const
|
|
{
|
|
return static_cast<Layout::SVGGraphicsBox const&>(layout_node());
|
|
}
|
|
|
|
}
|