Skip to content

Commit

Permalink
Release v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sammycage committed Sep 2, 2020
1 parent d688ea4 commit fa5384f
Show file tree
Hide file tree
Showing 85 changed files with 788 additions and 1,044 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.3)

project(lunasvg VERSION 1.0.1 LANGUAGES CXX)
project(lunasvg VERSION 1.1.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 11)

Expand Down
13 changes: 1 addition & 12 deletions include/svgelement.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,7 @@ class Bitmap
std::uint32_t stride() const;

private:
struct Impl
{
Impl(std::uint8_t* data, std::uint32_t width, std::uint32_t height, std::uint32_t stride);
Impl(std::uint32_t width, std::uint32_t height);

std::unique_ptr<std::uint8_t[]> ownData;
std::uint8_t* data;
std::uint32_t width;
std::uint32_t height;
std::uint32_t stride;
};

struct Impl;
std::shared_ptr<Impl> m_impl;
};

Expand Down
18 changes: 10 additions & 8 deletions source/backends/cairo/canvasimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ CanvasImpl::~CanvasImpl()
cairo_surface_destroy(m_surface);
}

CanvasImpl::CanvasImpl(unsigned char* data, unsigned int width, unsigned int height, unsigned int stride) :
m_surface(cairo_image_surface_create_for_data(data, CAIRO_FORMAT_ARGB32, int(width), int(height), int(stride))),
m_cr(cairo_create(m_surface))
CanvasImpl::CanvasImpl(unsigned char* data, unsigned int width, unsigned int height, unsigned int stride)
: m_surface(cairo_image_surface_create_for_data(data, CAIRO_FORMAT_ARGB32, int(width), int(height), int(stride))),
m_cr(cairo_create(m_surface))
{
}

CanvasImpl::CanvasImpl(unsigned int width, unsigned int height) :
m_surface(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, int(width), int(height))),
m_cr(cairo_create(m_surface))
CanvasImpl::CanvasImpl(unsigned int width, unsigned int height)
: m_surface(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, int(width), int(height))),
m_cr(cairo_create(m_surface))
{
}

Expand Down Expand Up @@ -221,7 +221,8 @@ cairo_pattern_t* to_cairo_pattern(const Paint& paint)
const Rgb* c = paint.color();
return cairo_pattern_create_rgba(c->r/255.0, c->g/255.0, c->b/255.0, (c->a/255.0)*paint.opacity());
}
else if(paint.type() == PaintTypeGradient)

if(paint.type() == PaintTypeGradient)
{
const Gradient* gradient = paint.gradient();
cairo_pattern_t* pattern;
Expand Down Expand Up @@ -266,7 +267,8 @@ cairo_pattern_t* to_cairo_pattern(const Paint& paint)
cairo_pattern_set_matrix(pattern, &matrix);
return pattern;
}
else if(paint.type() == PaintTypePattern)

if(paint.type() == PaintTypePattern)
{
const Pattern* p = paint.pattern();
cairo_pattern_t* pattern = cairo_pattern_create_for_surface(p->tile().impl()->surface());
Expand Down
18 changes: 9 additions & 9 deletions source/cssproperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ CSSPropertyBase::~CSSPropertyBase()
{
}

CSSPropertyBase::CSSPropertyBase(CSSPropertyID propertyId, PropertyType propertyType) :
m_propertyId(propertyId),
m_propertyType(propertyType)
CSSPropertyBase::CSSPropertyBase(CSSPropertyID propertyId, PropertyType propertyType)
: m_propertyId(propertyId),
m_propertyType(propertyType)
{
}

Expand Down Expand Up @@ -73,8 +73,8 @@ CSSPropertyList::~CSSPropertyList()
delete m_values[i];
}

CSSPropertyList::CSSPropertyList() :
SVGProperty(PropertyTypeCSSPropertyList)
CSSPropertyList::CSSPropertyList()
: SVGProperty(PropertyTypeCSSPropertyList)
{
m_values.fill(nullptr);
}
Expand Down Expand Up @@ -124,7 +124,7 @@ void CSSPropertyList::setValueAsString(const std::string& value)
++ptr;
std::string name(start, ptr);
Utils::skipWs(ptr);
if(!*ptr || *ptr!=':')
if(*ptr!=':')
return;
++ptr;
Utils::skipWs(ptr);
Expand Down Expand Up @@ -160,7 +160,7 @@ std::string CSSPropertyList::valueAsString() const

SVGProperty* CSSPropertyList::clone() const
{
CSSPropertyList* property = new CSSPropertyList;
CSSPropertyList* property = new CSSPropertyList;
for(unsigned int i = 0;i < MAX_STYLE;i++)
{
if(m_values[i])
Expand All @@ -170,8 +170,8 @@ SVGProperty* CSSPropertyList::clone() const
return property;
}

DOMSVGStyle::DOMSVGStyle(DOMPropertyID propertyId) :
DOMSVGProperty<CSSPropertyList>(propertyId)
DOMSVGStyle::DOMSVGStyle(DOMPropertyID propertyId)
: DOMSVGProperty<CSSPropertyList>(propertyId)
{
}

Expand Down
6 changes: 3 additions & 3 deletions source/cssproperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ template<typename T>
class CSSProperty : public CSSPropertyBase
{
public:
CSSProperty(CSSPropertyID propertyId) :
CSSPropertyBase(propertyId, T::classType()),
m_property(nullptr)
CSSProperty(CSSPropertyID propertyId)
: CSSPropertyBase(propertyId, T::classType()),
m_property(nullptr)
{}

SVGProperty* ensureProperty();
Expand Down
2 changes: 0 additions & 2 deletions source/geometry/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
target_sources(lunasvg
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/affinetransform.cpp"
"${CMAKE_CURRENT_LIST_DIR}/flatteningpathiterator.cpp"
"${CMAKE_CURRENT_LIST_DIR}/path.cpp"
"${CMAKE_CURRENT_LIST_DIR}/pathutils.cpp"
"${CMAKE_CURRENT_LIST_DIR}/pathiterator.cpp"
)

Expand Down
183 changes: 0 additions & 183 deletions source/geometry/flatteningpathiterator.cpp

This file was deleted.

32 changes: 0 additions & 32 deletions source/geometry/flatteningpathiterator.h

This file was deleted.

Loading

0 comments on commit fa5384f

Please sign in to comment.