Squashed 'external/lunasvg/' changes from 0562a5dcc..585d61eef

585d61eef Fix invalid marker size #70
3881f345c Fix plutovg misaligned address
56ddf2a5a Fix plutovg pattern type

git-subtree-dir: external/lunasvg
git-subtree-split: 585d61eef24510bc0b7fe3d9e768d0675d4b5a6f
This commit is contained in:
Leon Styhre 2023-01-06 11:28:43 +01:00
parent f44be39f5e
commit 8436127894
5 changed files with 11 additions and 10 deletions

View file

@ -6,12 +6,13 @@
#include <math.h>
#include <limits.h>
#define ALIGN_SIZE(size) (((size) + 7ul) & ~7ul)
static void ft_outline_init(PVG_FT_Outline* outline, plutovg_t* pluto, int points, int contours)
{
size_t size_a = (points + contours) * sizeof(PVG_FT_Vector);
size_t size_b = (points + contours) * sizeof(char);
size_t size_c = contours * sizeof(int);
size_t size_d = contours * sizeof(char);
size_t size_a = ALIGN_SIZE((points + contours) * sizeof(PVG_FT_Vector));
size_t size_b = ALIGN_SIZE((points + contours) * sizeof(char));
size_t size_c = ALIGN_SIZE(contours * sizeof(int));
size_t size_d = ALIGN_SIZE(contours * sizeof(char));
size_t size_n = size_a + size_b + size_c + size_d;
if(size_n > pluto->outline_size) {
pluto->outline_data = realloc(pluto->outline_data, size_n);

View file

@ -223,7 +223,7 @@ plutovg_texture_t* plutovg_set_texture(plutovg_t* pluto, plutovg_surface_t* surf
{
plutovg_paint_t* paint = &pluto->state->paint;
paint->type = plutovg_paint_type_texture;
plutovg_texture_init(&paint->texture, surface, plutovg_texture_type_plain);
plutovg_texture_init(&paint->texture, surface, type);
return &paint->texture;
}

View file

@ -24,13 +24,13 @@ Length MarkerElement::refY() const
Length MarkerElement::markerWidth() const
{
auto& value = get(PropertyID::MarkerWidth);
return Parser::parseLength(value, ForbidNegativeLengths, Length::ThreePercent);
return Parser::parseLength(value, ForbidNegativeLengths, Length::Three);
}
Length MarkerElement::markerHeight() const
{
auto& value = get(PropertyID::MarkerHeight);
return Parser::parseLength(value, ForbidNegativeLengths, Length::ThreePercent);
return Parser::parseLength(value, ForbidNegativeLengths, Length::Three);
}
Angle MarkerElement::orient() const

View file

@ -1,5 +1,5 @@
#include "property.h"
#include "styledelement.h"
#include "element.h"
#include "lunasvg.h"
#include <algorithm>
@ -547,7 +547,7 @@ void PathIterator::next()
const Length Length::Unknown{0, LengthUnits::Unknown};
const Length Length::Zero{0, LengthUnits::Number};
const Length Length::One{1, LengthUnits::Number};
const Length Length::ThreePercent{3, LengthUnits::Percent};
const Length Length::Three{3, LengthUnits::Number};
const Length Length::HundredPercent{100, LengthUnits::Percent};
const Length Length::FiftyPercent{50, LengthUnits::Percent};
const Length Length::OneTwentyPercent{120, LengthUnits::Percent};

View file

@ -285,7 +285,7 @@ public:
static const Length Unknown;
static const Length Zero;
static const Length One;
static const Length ThreePercent;
static const Length Three;
static const Length HundredPercent;
static const Length FiftyPercent;
static const Length OneTwentyPercent;