mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Misc. cleanup of code
Some things I came across while working on a bugfix. No functional changes.
This commit is contained in:
parent
e4de6c0d05
commit
6f50c35d68
Notes:
github-actions[bot]
2025-10-27 23:43:37 +00:00
Author: https://github.com/gmta
Commit: 6f50c35d68
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6592
4 changed files with 2 additions and 6 deletions
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AK/NonnullOwnPtr.h>
|
|
||||||
#include <LibWeb/Painting/ScrollFrame.h>
|
#include <LibWeb/Painting/ScrollFrame.h>
|
||||||
|
|
||||||
namespace Web::Painting {
|
namespace Web::Painting {
|
||||||
|
|
|
||||||
|
|
@ -105,8 +105,7 @@ RefPtr<Gfx::Bitmap> SVGDecodedImageData::render(Gfx::IntSize size) const
|
||||||
if (!display_list)
|
if (!display_list)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
auto painting_command_executor_type = m_page_client->display_list_player_type();
|
switch (m_page_client->display_list_player_type()) {
|
||||||
switch (painting_command_executor_type) {
|
|
||||||
case DisplayListPlayerType::SkiaGPUIfAvailable:
|
case DisplayListPlayerType::SkiaGPUIfAvailable:
|
||||||
case DisplayListPlayerType::SkiaCPU: {
|
case DisplayListPlayerType::SkiaCPU: {
|
||||||
auto painting_surface = Gfx::PaintingSurface::wrap_bitmap(*bitmap);
|
auto painting_surface = Gfx::PaintingSurface::wrap_bitmap(*bitmap);
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AK/IterationDecision.h>
|
#include <AK/IterationDecision.h>
|
||||||
#include <LibGfx/PaintStyle.h>
|
|
||||||
#include <LibWeb/Painting/PaintStyle.h>
|
#include <LibWeb/Painting/PaintStyle.h>
|
||||||
#include <LibWeb/SVG/AttributeParser.h>
|
#include <LibWeb/SVG/AttributeParser.h>
|
||||||
#include <LibWeb/SVG/SVGElement.h>
|
#include <LibWeb/SVG/SVGElement.h>
|
||||||
|
|
|
||||||
|
|
@ -114,13 +114,12 @@ NumberPercentage SVGLinearGradientElement::end_y_impl(HashTable<SVGGradientEleme
|
||||||
|
|
||||||
Optional<Painting::PaintStyle> SVGLinearGradientElement::to_gfx_paint_style(SVGPaintContext const& paint_context) const
|
Optional<Painting::PaintStyle> SVGLinearGradientElement::to_gfx_paint_style(SVGPaintContext const& paint_context) const
|
||||||
{
|
{
|
||||||
auto units = gradient_units();
|
|
||||||
// FIXME: Resolve percentages properly
|
// FIXME: Resolve percentages properly
|
||||||
Gfx::FloatPoint start_point {};
|
Gfx::FloatPoint start_point {};
|
||||||
Gfx::FloatPoint end_point {};
|
Gfx::FloatPoint end_point {};
|
||||||
|
|
||||||
// https://svgwg.org/svg2-draft/pservers.html#LinearGradientElementGradientUnitsAttribute
|
// https://svgwg.org/svg2-draft/pservers.html#LinearGradientElementGradientUnitsAttribute
|
||||||
if (units == GradientUnits::ObjectBoundingBox) {
|
if (gradient_units() == GradientUnits::ObjectBoundingBox) {
|
||||||
// If gradientUnits="objectBoundingBox", the user coordinate system for attributes ‘x1’, ‘y1’, ‘x2’ and ‘y2’
|
// If gradientUnits="objectBoundingBox", the user coordinate system for attributes ‘x1’, ‘y1’, ‘x2’ and ‘y2’
|
||||||
// is established using the bounding box of the element to which the gradient is applied (see Object bounding
|
// is established using the bounding box of the element to which the gradient is applied (see Object bounding
|
||||||
// box units) and then applying the transform specified by attribute ‘gradientTransform’. Percentages represent
|
// box units) and then applying the transform specified by attribute ‘gradientTransform’. Percentages represent
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue