From e4f1917249bfa36a41435778b7b74fd1a05c967c Mon Sep 17 00:00:00 2001 From: sammycage Date: Fri, 14 Aug 2020 14:53:41 +0100 Subject: [PATCH] Release v1.0.0 --- 3rdparty/agg/CMakeLists.txt | 15 +++ .../agg/include/agg_alpha_mask_u8.h | 0 .../agg/include/agg_arc.h | 0 .../agg/include/agg_array.h | 0 .../agg/include/agg_arrowhead.h | 0 .../agg/include/agg_basics.h | 0 .../agg/include/agg_bezier_arc.h | 0 .../agg/include/agg_bitset_iterator.h | 0 .../agg/include/agg_blur.h | 0 .../agg/include/agg_bounding_rect.h | 0 .../agg/include/agg_bspline.h | 0 .../agg/include/agg_clip_liang_barsky.h | 0 .../agg/include/agg_color_gray.h | 0 .../agg/include/agg_color_rgba.h | 0 .../agg/include/agg_config.h | 0 .../agg/include/agg_conv_adaptor_vcgen.h | 0 .../agg/include/agg_conv_adaptor_vpgen.h | 0 .../agg/include/agg_conv_bspline.h | 0 .../agg/include/agg_conv_clip_polygon.h | 0 .../agg/include/agg_conv_clip_polyline.h | 0 .../agg/include/agg_conv_close_polygon.h | 0 .../agg/include/agg_conv_concat.h | 0 .../agg/include/agg_conv_contour.h | 0 .../agg/include/agg_conv_curve.h | 0 .../agg/include/agg_conv_dash.h | 0 .../agg/include/agg_conv_gpc.h | 0 .../agg/include/agg_conv_marker.h | 0 .../agg/include/agg_conv_marker_adaptor.h | 0 .../agg/include/agg_conv_segmentator.h | 0 .../agg/include/agg_conv_shorten_path.h | 0 .../agg/include/agg_conv_smooth_poly1.h | 0 .../agg/include/agg_conv_stroke.h | 0 .../agg/include/agg_conv_transform.h | 0 .../agg/include/agg_conv_unclose_polygon.h | 0 .../agg/include/agg_curves.h | 0 .../agg/include/agg_dda_line.h | 0 .../agg/include/agg_ellipse.h | 0 .../agg/include/agg_ellipse_bresenham.h | 0 .../agg/include/agg_embedded_raster_fonts.h | 0 .../agg/include/agg_font_cache_manager.h | 0 .../agg/include/agg_font_cache_manager2.h | 0 .../agg/include/agg_gamma_functions.h | 0 .../agg/include/agg_gamma_lut.h | 0 .../agg/include/agg_glyph_raster_bin.h | 0 .../agg/include/agg_gradient_lut.h | 0 .../agg/include/agg_gsv_text.h | 0 .../agg/include/agg_image_accessors.h | 0 .../agg/include/agg_image_filters.h | 0 .../agg/include/agg_line_aa_basics.h | 0 .../agg/include/agg_math.h | 0 .../agg/include/agg_math_stroke.h | 0 .../agg/include/agg_path_length.h | 0 .../agg/include/agg_path_storage.h | 0 .../agg/include/agg_path_storage_integer.h | 0 .../agg/include/agg_pattern_filters_rgba.h | 0 .../agg/include/agg_pixfmt_amask_adaptor.h | 0 .../agg/include/agg_pixfmt_base.h | 0 .../agg/include/agg_pixfmt_gray.h | 0 .../agg/include/agg_pixfmt_rgb.h | 0 .../agg/include/agg_pixfmt_rgb_packed.h | 0 .../agg/include/agg_pixfmt_rgba.h | 0 .../agg/include/agg_pixfmt_transposer.h | 0 .../agg/include/agg_rasterizer_cells_aa.h | 0 .../agg/include/agg_rasterizer_compound_aa.h | 0 .../agg/include/agg_rasterizer_outline.h | 0 .../agg/include/agg_rasterizer_outline_aa.h | 0 .../agg/include/agg_rasterizer_scanline_aa.h | 0 .../agg_rasterizer_scanline_aa_nogamma.h | 0 .../agg/include/agg_rasterizer_sl_clip.h | 0 .../agg/include/agg_renderer_base.h | 0 .../agg/include/agg_renderer_markers.h | 0 .../agg/include/agg_renderer_mclip.h | 0 .../agg/include/agg_renderer_outline_aa.h | 0 .../agg/include/agg_renderer_outline_image.h | 0 .../agg/include/agg_renderer_primitives.h | 0 .../agg/include/agg_renderer_raster_text.h | 0 .../agg/include/agg_renderer_scanline.h | 0 .../agg/include/agg_rendering_buffer.h | 0 .../include/agg_rendering_buffer_dynarow.h | 0 .../agg/include/agg_rounded_rect.h | 0 .../agg/include/agg_scanline_bin.h | 0 .../include/agg_scanline_boolean_algebra.h | 0 .../agg/include/agg_scanline_p.h | 0 .../agg/include/agg_scanline_storage_aa.h | 0 .../agg/include/agg_scanline_storage_bin.h | 0 .../agg/include/agg_scanline_u.h | 0 .../agg/include/agg_shorten_path.h | 0 .../agg/include/agg_simul_eq.h | 0 .../agg/include/agg_span_allocator.h | 0 .../agg/include/agg_span_converter.h | 0 .../agg/include/agg_span_gouraud.h | 0 .../agg/include/agg_span_gouraud_gray.h | 0 .../agg/include/agg_span_gouraud_rgba.h | 0 .../agg/include/agg_span_gradient.h | 0 .../agg/include/agg_span_gradient_alpha.h | 0 .../agg/include/agg_span_gradient_contour.h | 0 .../agg/include/agg_span_gradient_image.h | 0 .../agg/include/agg_span_image_filter.h | 0 .../agg/include/agg_span_image_filter_gray.h | 0 .../agg/include/agg_span_image_filter_rgb.h | 0 .../agg/include/agg_span_image_filter_rgba.h | 0 .../include/agg_span_interpolator_adaptor.h | 0 .../include/agg_span_interpolator_linear.h | 0 .../agg/include/agg_span_interpolator_persp.h | 0 .../agg/include/agg_span_interpolator_trans.h | 0 .../agg/include/agg_span_pattern_gray.h | 0 .../agg/include/agg_span_pattern_rgb.h | 0 .../agg/include/agg_span_pattern_rgba.h | 0 .../agg/include/agg_span_solid.h | 0 .../agg/include/agg_span_subdiv_adaptor.h | 0 .../agg/include/agg_trans_affine.h | 0 .../agg/include/agg_trans_bilinear.h | 0 .../agg/include/agg_trans_double_path.h | 0 .../agg/include/agg_trans_perspective.h | 0 .../agg/include/agg_trans_single_path.h | 0 .../agg/include/agg_trans_viewport.h | 0 .../agg/include/agg_trans_warp_magnifier.h | 0 .../agg/include/agg_vcgen_bspline.h | 0 .../agg/include/agg_vcgen_contour.h | 0 .../agg/include/agg_vcgen_dash.h | 0 .../agg/include/agg_vcgen_markers_term.h | 0 .../agg/include/agg_vcgen_smooth_poly1.h | 0 .../agg/include/agg_vcgen_stroke.h | 0 .../agg/include/agg_vcgen_vertex_sequence.h | 0 .../agg/include/agg_vertex_sequence.h | 0 .../agg/include/agg_vpgen_clip_polygon.h | 0 .../agg/include/agg_vpgen_clip_polyline.h | 0 .../agg/include/agg_vpgen_segmentator.h | 0 .../agg/include/util/agg_color_conv.h | 0 .../agg/include/util/agg_color_conv_rgb16.h | 0 .../agg/include/util/agg_color_conv_rgb8.h | 0 .../graphics => 3rdparty}/agg/src/agg_arc.cpp | 0 .../agg/src/agg_arrowhead.cpp | 0 .../agg/src/agg_bezier_arc.cpp | 0 .../agg/src/agg_bspline.cpp | 0 .../agg/src/agg_color_rgba.cpp | 0 .../agg/src/agg_curves.cpp | 0 .../agg/src/agg_embedded_raster_fonts.cpp | 0 .../agg/src/agg_gsv_text.cpp | 0 .../agg/src/agg_image_filters.cpp | 0 .../agg/src/agg_line_aa_basics.cpp | 0 .../agg/src/agg_line_profile_aa.cpp | 0 .../agg/src/agg_rounded_rect.cpp | 0 .../agg/src/agg_sqrt_tables.cpp | 0 .../agg/src/agg_trans_affine.cpp | 0 .../agg/src/agg_trans_double_path.cpp | 0 .../agg/src/agg_trans_single_path.cpp | 0 .../agg/src/agg_trans_warp_magnifier.cpp | 0 .../agg/src/agg_vcgen_bspline.cpp | 0 .../agg/src/agg_vcgen_contour.cpp | 0 .../agg/src/agg_vcgen_dash.cpp | 0 .../agg/src/agg_vcgen_markers_term.cpp | 0 .../agg/src/agg_vcgen_smooth_poly1.cpp | 0 .../agg/src/agg_vcgen_stroke.cpp | 0 .../agg/src/agg_vpgen_clip_polygon.cpp | 0 .../agg/src/agg_vpgen_clip_polyline.cpp | 0 .../agg/src/agg_vpgen_segmentator.cpp | 0 CMakeLists.txt | 12 +- README.md | 2 +- source/CMakeLists.txt | 18 ++- .../cairo => backends/agg}/CMakeLists.txt | 0 .../{graphics => backends}/agg/canvasimpl.cpp | 4 +- .../{graphics => backends}/agg/canvasimpl.h | 0 .../agg => backends/cairo}/CMakeLists.txt | 3 - .../cairo/canvasimpl.cpp | 0 .../{graphics => backends}/cairo/canvasimpl.h | 0 source/{properties => }/cssproperty.cpp | 0 source/{properties => }/cssproperty.h | 6 +- source/geometry/affinetransform.cpp | 119 +++++++++--------- source/geometry/affinetransform.h | 36 +++--- source/geometry/path.cpp | 106 +++++++--------- source/geometry/path.h | 12 +- source/geometry/pathiterator.cpp | 75 ++++++----- source/geometry/pathiterator.h | 10 +- source/geometry/pathutils.h | 6 +- source/graphics/CMakeLists.txt | 6 - source/graphics/agg/include/CMakeLists.txt | 6 - .../graphics/agg/include/util/CMakeLists.txt | 4 - source/graphics/agg/src/CMakeLists.txt | 9 -- source/graphics/rgb.cpp | 3 +- source/graphics/rgb.h | 3 +- source/properties/CMakeLists.txt | 25 ---- source/rendercontext.h | 2 +- source/svgcircleelement.cpp | 2 +- source/svgclippathelement.cpp | 2 - source/{properties => }/svgcolor.cpp | 14 +-- source/{properties => }/svgcolor.h | 0 source/svgdefselement.cpp | 2 +- source/svgdocumentimpl.cpp | 23 ++-- source/svgdocumentimpl.h | 10 +- source/svgelementhead.cpp | 9 -- source/svgelementhead.h | 1 - source/svgellipseelement.cpp | 2 +- source/{properties => }/svgenumeration.cpp | 0 source/{properties => }/svgenumeration.h | 0 source/svggradientelement.cpp | 2 +- source/{properties => }/svglength.cpp | 2 +- source/{properties => }/svglength.h | 0 source/{properties => }/svglengthlist.cpp | 0 source/{properties => }/svglengthlist.h | 0 source/svglineargradientelement.cpp | 2 +- source/{properties => }/svglistproperty.h | 0 source/{properties => }/svgnumber.cpp | 0 source/{properties => }/svgnumber.h | 0 source/{properties => }/svgnumberlist.cpp | 0 source/{properties => }/svgnumberlist.h | 0 source/svgparserutils.h | 12 +- source/{properties => }/svgpath.cpp | 2 +- source/{properties => }/svgpath.h | 0 source/svgpathelement.cpp | 2 +- source/svgpatternelement.cpp | 2 +- source/{properties => }/svgpoint.cpp | 0 source/{properties => }/svgpoint.h | 0 source/{properties => }/svgpointlist.cpp | 0 source/{properties => }/svgpointlist.h | 0 source/svgpolygonelement.cpp | 2 +- source/svgpolylineelement.cpp | 2 +- .../svgpreserveaspectratio.cpp | 0 .../{properties => }/svgpreserveaspectratio.h | 0 source/{properties => }/svgproperty.cpp | 0 source/{properties => }/svgproperty.h | 0 source/{properties => }/svgpropertyutils.cpp | 0 source/{properties => }/svgpropertyutils.h | 0 source/svgradialgradientelement.cpp | 2 +- source/{properties => }/svgrect.cpp | 0 source/{properties => }/svgrect.h | 0 source/svgrectelement.cpp | 2 +- source/svgsolidcolorelement.cpp | 2 +- source/svgstopelement.cpp | 2 +- source/{properties => }/svgstring.cpp | 0 source/{properties => }/svgstring.h | 0 source/{properties => }/svgstringlist.cpp | 0 source/{properties => }/svgstringlist.h | 0 source/svgstyledelement.cpp | 3 +- source/svgsvgelement.cpp | 2 +- source/svgsymbolelement.cpp | 2 +- source/{properties => }/svgtransform.cpp | 2 +- source/{properties => }/svgtransform.h | 0 source/svguseelement.cpp | 2 +- 239 files changed, 273 insertions(+), 321 deletions(-) create mode 100755 3rdparty/agg/CMakeLists.txt rename {source/graphics => 3rdparty}/agg/include/agg_alpha_mask_u8.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_arc.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_array.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_arrowhead.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_basics.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_bezier_arc.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_bitset_iterator.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_blur.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_bounding_rect.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_bspline.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_clip_liang_barsky.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_color_gray.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_color_rgba.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_config.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_conv_adaptor_vcgen.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_conv_adaptor_vpgen.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_conv_bspline.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_conv_clip_polygon.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_conv_clip_polyline.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_conv_close_polygon.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_conv_concat.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_conv_contour.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_conv_curve.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_conv_dash.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_conv_gpc.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_conv_marker.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_conv_marker_adaptor.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_conv_segmentator.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_conv_shorten_path.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_conv_smooth_poly1.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_conv_stroke.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_conv_transform.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_conv_unclose_polygon.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_curves.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_dda_line.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_ellipse.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_ellipse_bresenham.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_embedded_raster_fonts.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_font_cache_manager.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_font_cache_manager2.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_gamma_functions.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_gamma_lut.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_glyph_raster_bin.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_gradient_lut.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_gsv_text.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_image_accessors.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_image_filters.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_line_aa_basics.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_math.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_math_stroke.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_path_length.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_path_storage.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_path_storage_integer.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_pattern_filters_rgba.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_pixfmt_amask_adaptor.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_pixfmt_base.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_pixfmt_gray.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_pixfmt_rgb.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_pixfmt_rgb_packed.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_pixfmt_rgba.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_pixfmt_transposer.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_rasterizer_cells_aa.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_rasterizer_compound_aa.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_rasterizer_outline.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_rasterizer_outline_aa.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_rasterizer_scanline_aa.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_rasterizer_scanline_aa_nogamma.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_rasterizer_sl_clip.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_renderer_base.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_renderer_markers.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_renderer_mclip.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_renderer_outline_aa.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_renderer_outline_image.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_renderer_primitives.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_renderer_raster_text.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_renderer_scanline.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_rendering_buffer.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_rendering_buffer_dynarow.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_rounded_rect.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_scanline_bin.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_scanline_boolean_algebra.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_scanline_p.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_scanline_storage_aa.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_scanline_storage_bin.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_scanline_u.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_shorten_path.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_simul_eq.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_allocator.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_converter.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_gouraud.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_gouraud_gray.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_gouraud_rgba.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_gradient.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_gradient_alpha.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_gradient_contour.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_gradient_image.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_image_filter.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_image_filter_gray.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_image_filter_rgb.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_image_filter_rgba.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_interpolator_adaptor.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_interpolator_linear.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_interpolator_persp.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_interpolator_trans.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_pattern_gray.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_pattern_rgb.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_pattern_rgba.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_solid.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_span_subdiv_adaptor.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_trans_affine.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_trans_bilinear.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_trans_double_path.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_trans_perspective.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_trans_single_path.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_trans_viewport.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_trans_warp_magnifier.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_vcgen_bspline.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_vcgen_contour.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_vcgen_dash.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_vcgen_markers_term.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_vcgen_smooth_poly1.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_vcgen_stroke.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_vcgen_vertex_sequence.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_vertex_sequence.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_vpgen_clip_polygon.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_vpgen_clip_polyline.h (100%) rename {source/graphics => 3rdparty}/agg/include/agg_vpgen_segmentator.h (100%) rename {source/graphics => 3rdparty}/agg/include/util/agg_color_conv.h (100%) rename {source/graphics => 3rdparty}/agg/include/util/agg_color_conv_rgb16.h (100%) rename {source/graphics => 3rdparty}/agg/include/util/agg_color_conv_rgb8.h (100%) rename {source/graphics => 3rdparty}/agg/src/agg_arc.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_arrowhead.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_bezier_arc.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_bspline.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_color_rgba.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_curves.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_embedded_raster_fonts.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_gsv_text.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_image_filters.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_line_aa_basics.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_line_profile_aa.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_rounded_rect.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_sqrt_tables.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_trans_affine.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_trans_double_path.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_trans_single_path.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_trans_warp_magnifier.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_vcgen_bspline.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_vcgen_contour.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_vcgen_dash.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_vcgen_markers_term.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_vcgen_smooth_poly1.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_vcgen_stroke.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_vpgen_clip_polygon.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_vpgen_clip_polyline.cpp (100%) rename {source/graphics => 3rdparty}/agg/src/agg_vpgen_segmentator.cpp (100%) rename source/{graphics/cairo => backends/agg}/CMakeLists.txt (100%) rename source/{graphics => backends}/agg/canvasimpl.cpp (96%) rename source/{graphics => backends}/agg/canvasimpl.h (100%) rename source/{graphics/agg => backends/cairo}/CMakeLists.txt (72%) rename source/{graphics => backends}/cairo/canvasimpl.cpp (100%) rename source/{graphics => backends}/cairo/canvasimpl.h (100%) rename source/{properties => }/cssproperty.cpp (100%) rename source/{properties => }/cssproperty.h (94%) delete mode 100755 source/graphics/agg/include/CMakeLists.txt delete mode 100755 source/graphics/agg/include/util/CMakeLists.txt delete mode 100755 source/graphics/agg/src/CMakeLists.txt delete mode 100755 source/properties/CMakeLists.txt rename source/{properties => }/svgcolor.cpp (96%) rename source/{properties => }/svgcolor.h (100%) rename source/{properties => }/svgenumeration.cpp (100%) rename source/{properties => }/svgenumeration.h (100%) rename source/{properties => }/svglength.cpp (95%) rename source/{properties => }/svglength.h (100%) rename source/{properties => }/svglengthlist.cpp (100%) rename source/{properties => }/svglengthlist.h (100%) rename source/{properties => }/svglistproperty.h (100%) rename source/{properties => }/svgnumber.cpp (100%) rename source/{properties => }/svgnumber.h (100%) rename source/{properties => }/svgnumberlist.cpp (100%) rename source/{properties => }/svgnumberlist.h (100%) rename source/{properties => }/svgpath.cpp (96%) rename source/{properties => }/svgpath.h (100%) rename source/{properties => }/svgpoint.cpp (100%) rename source/{properties => }/svgpoint.h (100%) rename source/{properties => }/svgpointlist.cpp (100%) rename source/{properties => }/svgpointlist.h (100%) rename source/{properties => }/svgpreserveaspectratio.cpp (100%) rename source/{properties => }/svgpreserveaspectratio.h (100%) rename source/{properties => }/svgproperty.cpp (100%) rename source/{properties => }/svgproperty.h (100%) rename source/{properties => }/svgpropertyutils.cpp (100%) rename source/{properties => }/svgpropertyutils.h (100%) rename source/{properties => }/svgrect.cpp (100%) rename source/{properties => }/svgrect.h (100%) rename source/{properties => }/svgstring.cpp (100%) rename source/{properties => }/svgstring.h (100%) rename source/{properties => }/svgstringlist.cpp (100%) rename source/{properties => }/svgstringlist.h (100%) rename source/{properties => }/svgtransform.cpp (95%) rename source/{properties => }/svgtransform.h (100%) diff --git a/3rdparty/agg/CMakeLists.txt b/3rdparty/agg/CMakeLists.txt new file mode 100755 index 0000000..0f7fa07 --- /dev/null +++ b/3rdparty/agg/CMakeLists.txt @@ -0,0 +1,15 @@ +target_sources(lunasvg +PRIVATE + "${CMAKE_CURRENT_LIST_DIR}/src/agg_vcgen_stroke.cpp" + "${CMAKE_CURRENT_LIST_DIR}/src/agg_vcgen_dash.cpp" + "${CMAKE_CURRENT_LIST_DIR}/src/agg_vcgen_contour.cpp" + "${CMAKE_CURRENT_LIST_DIR}/src/agg_trans_affine.cpp" + "${CMAKE_CURRENT_LIST_DIR}/src/agg_curves.cpp" + "${CMAKE_CURRENT_LIST_DIR}/src/agg_sqrt_tables.cpp" +) + +target_include_directories(lunasvg +PRIVATE + "${CMAKE_CURRENT_LIST_DIR}/include" +) + diff --git a/source/graphics/agg/include/agg_alpha_mask_u8.h b/3rdparty/agg/include/agg_alpha_mask_u8.h similarity index 100% rename from source/graphics/agg/include/agg_alpha_mask_u8.h rename to 3rdparty/agg/include/agg_alpha_mask_u8.h diff --git a/source/graphics/agg/include/agg_arc.h b/3rdparty/agg/include/agg_arc.h similarity index 100% rename from source/graphics/agg/include/agg_arc.h rename to 3rdparty/agg/include/agg_arc.h diff --git a/source/graphics/agg/include/agg_array.h b/3rdparty/agg/include/agg_array.h similarity index 100% rename from source/graphics/agg/include/agg_array.h rename to 3rdparty/agg/include/agg_array.h diff --git a/source/graphics/agg/include/agg_arrowhead.h b/3rdparty/agg/include/agg_arrowhead.h similarity index 100% rename from source/graphics/agg/include/agg_arrowhead.h rename to 3rdparty/agg/include/agg_arrowhead.h diff --git a/source/graphics/agg/include/agg_basics.h b/3rdparty/agg/include/agg_basics.h similarity index 100% rename from source/graphics/agg/include/agg_basics.h rename to 3rdparty/agg/include/agg_basics.h diff --git a/source/graphics/agg/include/agg_bezier_arc.h b/3rdparty/agg/include/agg_bezier_arc.h similarity index 100% rename from source/graphics/agg/include/agg_bezier_arc.h rename to 3rdparty/agg/include/agg_bezier_arc.h diff --git a/source/graphics/agg/include/agg_bitset_iterator.h b/3rdparty/agg/include/agg_bitset_iterator.h similarity index 100% rename from source/graphics/agg/include/agg_bitset_iterator.h rename to 3rdparty/agg/include/agg_bitset_iterator.h diff --git a/source/graphics/agg/include/agg_blur.h b/3rdparty/agg/include/agg_blur.h similarity index 100% rename from source/graphics/agg/include/agg_blur.h rename to 3rdparty/agg/include/agg_blur.h diff --git a/source/graphics/agg/include/agg_bounding_rect.h b/3rdparty/agg/include/agg_bounding_rect.h similarity index 100% rename from source/graphics/agg/include/agg_bounding_rect.h rename to 3rdparty/agg/include/agg_bounding_rect.h diff --git a/source/graphics/agg/include/agg_bspline.h b/3rdparty/agg/include/agg_bspline.h similarity index 100% rename from source/graphics/agg/include/agg_bspline.h rename to 3rdparty/agg/include/agg_bspline.h diff --git a/source/graphics/agg/include/agg_clip_liang_barsky.h b/3rdparty/agg/include/agg_clip_liang_barsky.h similarity index 100% rename from source/graphics/agg/include/agg_clip_liang_barsky.h rename to 3rdparty/agg/include/agg_clip_liang_barsky.h diff --git a/source/graphics/agg/include/agg_color_gray.h b/3rdparty/agg/include/agg_color_gray.h similarity index 100% rename from source/graphics/agg/include/agg_color_gray.h rename to 3rdparty/agg/include/agg_color_gray.h diff --git a/source/graphics/agg/include/agg_color_rgba.h b/3rdparty/agg/include/agg_color_rgba.h similarity index 100% rename from source/graphics/agg/include/agg_color_rgba.h rename to 3rdparty/agg/include/agg_color_rgba.h diff --git a/source/graphics/agg/include/agg_config.h b/3rdparty/agg/include/agg_config.h similarity index 100% rename from source/graphics/agg/include/agg_config.h rename to 3rdparty/agg/include/agg_config.h diff --git a/source/graphics/agg/include/agg_conv_adaptor_vcgen.h b/3rdparty/agg/include/agg_conv_adaptor_vcgen.h similarity index 100% rename from source/graphics/agg/include/agg_conv_adaptor_vcgen.h rename to 3rdparty/agg/include/agg_conv_adaptor_vcgen.h diff --git a/source/graphics/agg/include/agg_conv_adaptor_vpgen.h b/3rdparty/agg/include/agg_conv_adaptor_vpgen.h similarity index 100% rename from source/graphics/agg/include/agg_conv_adaptor_vpgen.h rename to 3rdparty/agg/include/agg_conv_adaptor_vpgen.h diff --git a/source/graphics/agg/include/agg_conv_bspline.h b/3rdparty/agg/include/agg_conv_bspline.h similarity index 100% rename from source/graphics/agg/include/agg_conv_bspline.h rename to 3rdparty/agg/include/agg_conv_bspline.h diff --git a/source/graphics/agg/include/agg_conv_clip_polygon.h b/3rdparty/agg/include/agg_conv_clip_polygon.h similarity index 100% rename from source/graphics/agg/include/agg_conv_clip_polygon.h rename to 3rdparty/agg/include/agg_conv_clip_polygon.h diff --git a/source/graphics/agg/include/agg_conv_clip_polyline.h b/3rdparty/agg/include/agg_conv_clip_polyline.h similarity index 100% rename from source/graphics/agg/include/agg_conv_clip_polyline.h rename to 3rdparty/agg/include/agg_conv_clip_polyline.h diff --git a/source/graphics/agg/include/agg_conv_close_polygon.h b/3rdparty/agg/include/agg_conv_close_polygon.h similarity index 100% rename from source/graphics/agg/include/agg_conv_close_polygon.h rename to 3rdparty/agg/include/agg_conv_close_polygon.h diff --git a/source/graphics/agg/include/agg_conv_concat.h b/3rdparty/agg/include/agg_conv_concat.h similarity index 100% rename from source/graphics/agg/include/agg_conv_concat.h rename to 3rdparty/agg/include/agg_conv_concat.h diff --git a/source/graphics/agg/include/agg_conv_contour.h b/3rdparty/agg/include/agg_conv_contour.h similarity index 100% rename from source/graphics/agg/include/agg_conv_contour.h rename to 3rdparty/agg/include/agg_conv_contour.h diff --git a/source/graphics/agg/include/agg_conv_curve.h b/3rdparty/agg/include/agg_conv_curve.h similarity index 100% rename from source/graphics/agg/include/agg_conv_curve.h rename to 3rdparty/agg/include/agg_conv_curve.h diff --git a/source/graphics/agg/include/agg_conv_dash.h b/3rdparty/agg/include/agg_conv_dash.h similarity index 100% rename from source/graphics/agg/include/agg_conv_dash.h rename to 3rdparty/agg/include/agg_conv_dash.h diff --git a/source/graphics/agg/include/agg_conv_gpc.h b/3rdparty/agg/include/agg_conv_gpc.h similarity index 100% rename from source/graphics/agg/include/agg_conv_gpc.h rename to 3rdparty/agg/include/agg_conv_gpc.h diff --git a/source/graphics/agg/include/agg_conv_marker.h b/3rdparty/agg/include/agg_conv_marker.h similarity index 100% rename from source/graphics/agg/include/agg_conv_marker.h rename to 3rdparty/agg/include/agg_conv_marker.h diff --git a/source/graphics/agg/include/agg_conv_marker_adaptor.h b/3rdparty/agg/include/agg_conv_marker_adaptor.h similarity index 100% rename from source/graphics/agg/include/agg_conv_marker_adaptor.h rename to 3rdparty/agg/include/agg_conv_marker_adaptor.h diff --git a/source/graphics/agg/include/agg_conv_segmentator.h b/3rdparty/agg/include/agg_conv_segmentator.h similarity index 100% rename from source/graphics/agg/include/agg_conv_segmentator.h rename to 3rdparty/agg/include/agg_conv_segmentator.h diff --git a/source/graphics/agg/include/agg_conv_shorten_path.h b/3rdparty/agg/include/agg_conv_shorten_path.h similarity index 100% rename from source/graphics/agg/include/agg_conv_shorten_path.h rename to 3rdparty/agg/include/agg_conv_shorten_path.h diff --git a/source/graphics/agg/include/agg_conv_smooth_poly1.h b/3rdparty/agg/include/agg_conv_smooth_poly1.h similarity index 100% rename from source/graphics/agg/include/agg_conv_smooth_poly1.h rename to 3rdparty/agg/include/agg_conv_smooth_poly1.h diff --git a/source/graphics/agg/include/agg_conv_stroke.h b/3rdparty/agg/include/agg_conv_stroke.h similarity index 100% rename from source/graphics/agg/include/agg_conv_stroke.h rename to 3rdparty/agg/include/agg_conv_stroke.h diff --git a/source/graphics/agg/include/agg_conv_transform.h b/3rdparty/agg/include/agg_conv_transform.h similarity index 100% rename from source/graphics/agg/include/agg_conv_transform.h rename to 3rdparty/agg/include/agg_conv_transform.h diff --git a/source/graphics/agg/include/agg_conv_unclose_polygon.h b/3rdparty/agg/include/agg_conv_unclose_polygon.h similarity index 100% rename from source/graphics/agg/include/agg_conv_unclose_polygon.h rename to 3rdparty/agg/include/agg_conv_unclose_polygon.h diff --git a/source/graphics/agg/include/agg_curves.h b/3rdparty/agg/include/agg_curves.h similarity index 100% rename from source/graphics/agg/include/agg_curves.h rename to 3rdparty/agg/include/agg_curves.h diff --git a/source/graphics/agg/include/agg_dda_line.h b/3rdparty/agg/include/agg_dda_line.h similarity index 100% rename from source/graphics/agg/include/agg_dda_line.h rename to 3rdparty/agg/include/agg_dda_line.h diff --git a/source/graphics/agg/include/agg_ellipse.h b/3rdparty/agg/include/agg_ellipse.h similarity index 100% rename from source/graphics/agg/include/agg_ellipse.h rename to 3rdparty/agg/include/agg_ellipse.h diff --git a/source/graphics/agg/include/agg_ellipse_bresenham.h b/3rdparty/agg/include/agg_ellipse_bresenham.h similarity index 100% rename from source/graphics/agg/include/agg_ellipse_bresenham.h rename to 3rdparty/agg/include/agg_ellipse_bresenham.h diff --git a/source/graphics/agg/include/agg_embedded_raster_fonts.h b/3rdparty/agg/include/agg_embedded_raster_fonts.h similarity index 100% rename from source/graphics/agg/include/agg_embedded_raster_fonts.h rename to 3rdparty/agg/include/agg_embedded_raster_fonts.h diff --git a/source/graphics/agg/include/agg_font_cache_manager.h b/3rdparty/agg/include/agg_font_cache_manager.h similarity index 100% rename from source/graphics/agg/include/agg_font_cache_manager.h rename to 3rdparty/agg/include/agg_font_cache_manager.h diff --git a/source/graphics/agg/include/agg_font_cache_manager2.h b/3rdparty/agg/include/agg_font_cache_manager2.h similarity index 100% rename from source/graphics/agg/include/agg_font_cache_manager2.h rename to 3rdparty/agg/include/agg_font_cache_manager2.h diff --git a/source/graphics/agg/include/agg_gamma_functions.h b/3rdparty/agg/include/agg_gamma_functions.h similarity index 100% rename from source/graphics/agg/include/agg_gamma_functions.h rename to 3rdparty/agg/include/agg_gamma_functions.h diff --git a/source/graphics/agg/include/agg_gamma_lut.h b/3rdparty/agg/include/agg_gamma_lut.h similarity index 100% rename from source/graphics/agg/include/agg_gamma_lut.h rename to 3rdparty/agg/include/agg_gamma_lut.h diff --git a/source/graphics/agg/include/agg_glyph_raster_bin.h b/3rdparty/agg/include/agg_glyph_raster_bin.h similarity index 100% rename from source/graphics/agg/include/agg_glyph_raster_bin.h rename to 3rdparty/agg/include/agg_glyph_raster_bin.h diff --git a/source/graphics/agg/include/agg_gradient_lut.h b/3rdparty/agg/include/agg_gradient_lut.h similarity index 100% rename from source/graphics/agg/include/agg_gradient_lut.h rename to 3rdparty/agg/include/agg_gradient_lut.h diff --git a/source/graphics/agg/include/agg_gsv_text.h b/3rdparty/agg/include/agg_gsv_text.h similarity index 100% rename from source/graphics/agg/include/agg_gsv_text.h rename to 3rdparty/agg/include/agg_gsv_text.h diff --git a/source/graphics/agg/include/agg_image_accessors.h b/3rdparty/agg/include/agg_image_accessors.h similarity index 100% rename from source/graphics/agg/include/agg_image_accessors.h rename to 3rdparty/agg/include/agg_image_accessors.h diff --git a/source/graphics/agg/include/agg_image_filters.h b/3rdparty/agg/include/agg_image_filters.h similarity index 100% rename from source/graphics/agg/include/agg_image_filters.h rename to 3rdparty/agg/include/agg_image_filters.h diff --git a/source/graphics/agg/include/agg_line_aa_basics.h b/3rdparty/agg/include/agg_line_aa_basics.h similarity index 100% rename from source/graphics/agg/include/agg_line_aa_basics.h rename to 3rdparty/agg/include/agg_line_aa_basics.h diff --git a/source/graphics/agg/include/agg_math.h b/3rdparty/agg/include/agg_math.h similarity index 100% rename from source/graphics/agg/include/agg_math.h rename to 3rdparty/agg/include/agg_math.h diff --git a/source/graphics/agg/include/agg_math_stroke.h b/3rdparty/agg/include/agg_math_stroke.h similarity index 100% rename from source/graphics/agg/include/agg_math_stroke.h rename to 3rdparty/agg/include/agg_math_stroke.h diff --git a/source/graphics/agg/include/agg_path_length.h b/3rdparty/agg/include/agg_path_length.h similarity index 100% rename from source/graphics/agg/include/agg_path_length.h rename to 3rdparty/agg/include/agg_path_length.h diff --git a/source/graphics/agg/include/agg_path_storage.h b/3rdparty/agg/include/agg_path_storage.h similarity index 100% rename from source/graphics/agg/include/agg_path_storage.h rename to 3rdparty/agg/include/agg_path_storage.h diff --git a/source/graphics/agg/include/agg_path_storage_integer.h b/3rdparty/agg/include/agg_path_storage_integer.h similarity index 100% rename from source/graphics/agg/include/agg_path_storage_integer.h rename to 3rdparty/agg/include/agg_path_storage_integer.h diff --git a/source/graphics/agg/include/agg_pattern_filters_rgba.h b/3rdparty/agg/include/agg_pattern_filters_rgba.h similarity index 100% rename from source/graphics/agg/include/agg_pattern_filters_rgba.h rename to 3rdparty/agg/include/agg_pattern_filters_rgba.h diff --git a/source/graphics/agg/include/agg_pixfmt_amask_adaptor.h b/3rdparty/agg/include/agg_pixfmt_amask_adaptor.h similarity index 100% rename from source/graphics/agg/include/agg_pixfmt_amask_adaptor.h rename to 3rdparty/agg/include/agg_pixfmt_amask_adaptor.h diff --git a/source/graphics/agg/include/agg_pixfmt_base.h b/3rdparty/agg/include/agg_pixfmt_base.h similarity index 100% rename from source/graphics/agg/include/agg_pixfmt_base.h rename to 3rdparty/agg/include/agg_pixfmt_base.h diff --git a/source/graphics/agg/include/agg_pixfmt_gray.h b/3rdparty/agg/include/agg_pixfmt_gray.h similarity index 100% rename from source/graphics/agg/include/agg_pixfmt_gray.h rename to 3rdparty/agg/include/agg_pixfmt_gray.h diff --git a/source/graphics/agg/include/agg_pixfmt_rgb.h b/3rdparty/agg/include/agg_pixfmt_rgb.h similarity index 100% rename from source/graphics/agg/include/agg_pixfmt_rgb.h rename to 3rdparty/agg/include/agg_pixfmt_rgb.h diff --git a/source/graphics/agg/include/agg_pixfmt_rgb_packed.h b/3rdparty/agg/include/agg_pixfmt_rgb_packed.h similarity index 100% rename from source/graphics/agg/include/agg_pixfmt_rgb_packed.h rename to 3rdparty/agg/include/agg_pixfmt_rgb_packed.h diff --git a/source/graphics/agg/include/agg_pixfmt_rgba.h b/3rdparty/agg/include/agg_pixfmt_rgba.h similarity index 100% rename from source/graphics/agg/include/agg_pixfmt_rgba.h rename to 3rdparty/agg/include/agg_pixfmt_rgba.h diff --git a/source/graphics/agg/include/agg_pixfmt_transposer.h b/3rdparty/agg/include/agg_pixfmt_transposer.h similarity index 100% rename from source/graphics/agg/include/agg_pixfmt_transposer.h rename to 3rdparty/agg/include/agg_pixfmt_transposer.h diff --git a/source/graphics/agg/include/agg_rasterizer_cells_aa.h b/3rdparty/agg/include/agg_rasterizer_cells_aa.h similarity index 100% rename from source/graphics/agg/include/agg_rasterizer_cells_aa.h rename to 3rdparty/agg/include/agg_rasterizer_cells_aa.h diff --git a/source/graphics/agg/include/agg_rasterizer_compound_aa.h b/3rdparty/agg/include/agg_rasterizer_compound_aa.h similarity index 100% rename from source/graphics/agg/include/agg_rasterizer_compound_aa.h rename to 3rdparty/agg/include/agg_rasterizer_compound_aa.h diff --git a/source/graphics/agg/include/agg_rasterizer_outline.h b/3rdparty/agg/include/agg_rasterizer_outline.h similarity index 100% rename from source/graphics/agg/include/agg_rasterizer_outline.h rename to 3rdparty/agg/include/agg_rasterizer_outline.h diff --git a/source/graphics/agg/include/agg_rasterizer_outline_aa.h b/3rdparty/agg/include/agg_rasterizer_outline_aa.h similarity index 100% rename from source/graphics/agg/include/agg_rasterizer_outline_aa.h rename to 3rdparty/agg/include/agg_rasterizer_outline_aa.h diff --git a/source/graphics/agg/include/agg_rasterizer_scanline_aa.h b/3rdparty/agg/include/agg_rasterizer_scanline_aa.h similarity index 100% rename from source/graphics/agg/include/agg_rasterizer_scanline_aa.h rename to 3rdparty/agg/include/agg_rasterizer_scanline_aa.h diff --git a/source/graphics/agg/include/agg_rasterizer_scanline_aa_nogamma.h b/3rdparty/agg/include/agg_rasterizer_scanline_aa_nogamma.h similarity index 100% rename from source/graphics/agg/include/agg_rasterizer_scanline_aa_nogamma.h rename to 3rdparty/agg/include/agg_rasterizer_scanline_aa_nogamma.h diff --git a/source/graphics/agg/include/agg_rasterizer_sl_clip.h b/3rdparty/agg/include/agg_rasterizer_sl_clip.h similarity index 100% rename from source/graphics/agg/include/agg_rasterizer_sl_clip.h rename to 3rdparty/agg/include/agg_rasterizer_sl_clip.h diff --git a/source/graphics/agg/include/agg_renderer_base.h b/3rdparty/agg/include/agg_renderer_base.h similarity index 100% rename from source/graphics/agg/include/agg_renderer_base.h rename to 3rdparty/agg/include/agg_renderer_base.h diff --git a/source/graphics/agg/include/agg_renderer_markers.h b/3rdparty/agg/include/agg_renderer_markers.h similarity index 100% rename from source/graphics/agg/include/agg_renderer_markers.h rename to 3rdparty/agg/include/agg_renderer_markers.h diff --git a/source/graphics/agg/include/agg_renderer_mclip.h b/3rdparty/agg/include/agg_renderer_mclip.h similarity index 100% rename from source/graphics/agg/include/agg_renderer_mclip.h rename to 3rdparty/agg/include/agg_renderer_mclip.h diff --git a/source/graphics/agg/include/agg_renderer_outline_aa.h b/3rdparty/agg/include/agg_renderer_outline_aa.h similarity index 100% rename from source/graphics/agg/include/agg_renderer_outline_aa.h rename to 3rdparty/agg/include/agg_renderer_outline_aa.h diff --git a/source/graphics/agg/include/agg_renderer_outline_image.h b/3rdparty/agg/include/agg_renderer_outline_image.h similarity index 100% rename from source/graphics/agg/include/agg_renderer_outline_image.h rename to 3rdparty/agg/include/agg_renderer_outline_image.h diff --git a/source/graphics/agg/include/agg_renderer_primitives.h b/3rdparty/agg/include/agg_renderer_primitives.h similarity index 100% rename from source/graphics/agg/include/agg_renderer_primitives.h rename to 3rdparty/agg/include/agg_renderer_primitives.h diff --git a/source/graphics/agg/include/agg_renderer_raster_text.h b/3rdparty/agg/include/agg_renderer_raster_text.h similarity index 100% rename from source/graphics/agg/include/agg_renderer_raster_text.h rename to 3rdparty/agg/include/agg_renderer_raster_text.h diff --git a/source/graphics/agg/include/agg_renderer_scanline.h b/3rdparty/agg/include/agg_renderer_scanline.h similarity index 100% rename from source/graphics/agg/include/agg_renderer_scanline.h rename to 3rdparty/agg/include/agg_renderer_scanline.h diff --git a/source/graphics/agg/include/agg_rendering_buffer.h b/3rdparty/agg/include/agg_rendering_buffer.h similarity index 100% rename from source/graphics/agg/include/agg_rendering_buffer.h rename to 3rdparty/agg/include/agg_rendering_buffer.h diff --git a/source/graphics/agg/include/agg_rendering_buffer_dynarow.h b/3rdparty/agg/include/agg_rendering_buffer_dynarow.h similarity index 100% rename from source/graphics/agg/include/agg_rendering_buffer_dynarow.h rename to 3rdparty/agg/include/agg_rendering_buffer_dynarow.h diff --git a/source/graphics/agg/include/agg_rounded_rect.h b/3rdparty/agg/include/agg_rounded_rect.h similarity index 100% rename from source/graphics/agg/include/agg_rounded_rect.h rename to 3rdparty/agg/include/agg_rounded_rect.h diff --git a/source/graphics/agg/include/agg_scanline_bin.h b/3rdparty/agg/include/agg_scanline_bin.h similarity index 100% rename from source/graphics/agg/include/agg_scanline_bin.h rename to 3rdparty/agg/include/agg_scanline_bin.h diff --git a/source/graphics/agg/include/agg_scanline_boolean_algebra.h b/3rdparty/agg/include/agg_scanline_boolean_algebra.h similarity index 100% rename from source/graphics/agg/include/agg_scanline_boolean_algebra.h rename to 3rdparty/agg/include/agg_scanline_boolean_algebra.h diff --git a/source/graphics/agg/include/agg_scanline_p.h b/3rdparty/agg/include/agg_scanline_p.h similarity index 100% rename from source/graphics/agg/include/agg_scanline_p.h rename to 3rdparty/agg/include/agg_scanline_p.h diff --git a/source/graphics/agg/include/agg_scanline_storage_aa.h b/3rdparty/agg/include/agg_scanline_storage_aa.h similarity index 100% rename from source/graphics/agg/include/agg_scanline_storage_aa.h rename to 3rdparty/agg/include/agg_scanline_storage_aa.h diff --git a/source/graphics/agg/include/agg_scanline_storage_bin.h b/3rdparty/agg/include/agg_scanline_storage_bin.h similarity index 100% rename from source/graphics/agg/include/agg_scanline_storage_bin.h rename to 3rdparty/agg/include/agg_scanline_storage_bin.h diff --git a/source/graphics/agg/include/agg_scanline_u.h b/3rdparty/agg/include/agg_scanline_u.h similarity index 100% rename from source/graphics/agg/include/agg_scanline_u.h rename to 3rdparty/agg/include/agg_scanline_u.h diff --git a/source/graphics/agg/include/agg_shorten_path.h b/3rdparty/agg/include/agg_shorten_path.h similarity index 100% rename from source/graphics/agg/include/agg_shorten_path.h rename to 3rdparty/agg/include/agg_shorten_path.h diff --git a/source/graphics/agg/include/agg_simul_eq.h b/3rdparty/agg/include/agg_simul_eq.h similarity index 100% rename from source/graphics/agg/include/agg_simul_eq.h rename to 3rdparty/agg/include/agg_simul_eq.h diff --git a/source/graphics/agg/include/agg_span_allocator.h b/3rdparty/agg/include/agg_span_allocator.h similarity index 100% rename from source/graphics/agg/include/agg_span_allocator.h rename to 3rdparty/agg/include/agg_span_allocator.h diff --git a/source/graphics/agg/include/agg_span_converter.h b/3rdparty/agg/include/agg_span_converter.h similarity index 100% rename from source/graphics/agg/include/agg_span_converter.h rename to 3rdparty/agg/include/agg_span_converter.h diff --git a/source/graphics/agg/include/agg_span_gouraud.h b/3rdparty/agg/include/agg_span_gouraud.h similarity index 100% rename from source/graphics/agg/include/agg_span_gouraud.h rename to 3rdparty/agg/include/agg_span_gouraud.h diff --git a/source/graphics/agg/include/agg_span_gouraud_gray.h b/3rdparty/agg/include/agg_span_gouraud_gray.h similarity index 100% rename from source/graphics/agg/include/agg_span_gouraud_gray.h rename to 3rdparty/agg/include/agg_span_gouraud_gray.h diff --git a/source/graphics/agg/include/agg_span_gouraud_rgba.h b/3rdparty/agg/include/agg_span_gouraud_rgba.h similarity index 100% rename from source/graphics/agg/include/agg_span_gouraud_rgba.h rename to 3rdparty/agg/include/agg_span_gouraud_rgba.h diff --git a/source/graphics/agg/include/agg_span_gradient.h b/3rdparty/agg/include/agg_span_gradient.h similarity index 100% rename from source/graphics/agg/include/agg_span_gradient.h rename to 3rdparty/agg/include/agg_span_gradient.h diff --git a/source/graphics/agg/include/agg_span_gradient_alpha.h b/3rdparty/agg/include/agg_span_gradient_alpha.h similarity index 100% rename from source/graphics/agg/include/agg_span_gradient_alpha.h rename to 3rdparty/agg/include/agg_span_gradient_alpha.h diff --git a/source/graphics/agg/include/agg_span_gradient_contour.h b/3rdparty/agg/include/agg_span_gradient_contour.h similarity index 100% rename from source/graphics/agg/include/agg_span_gradient_contour.h rename to 3rdparty/agg/include/agg_span_gradient_contour.h diff --git a/source/graphics/agg/include/agg_span_gradient_image.h b/3rdparty/agg/include/agg_span_gradient_image.h similarity index 100% rename from source/graphics/agg/include/agg_span_gradient_image.h rename to 3rdparty/agg/include/agg_span_gradient_image.h diff --git a/source/graphics/agg/include/agg_span_image_filter.h b/3rdparty/agg/include/agg_span_image_filter.h similarity index 100% rename from source/graphics/agg/include/agg_span_image_filter.h rename to 3rdparty/agg/include/agg_span_image_filter.h diff --git a/source/graphics/agg/include/agg_span_image_filter_gray.h b/3rdparty/agg/include/agg_span_image_filter_gray.h similarity index 100% rename from source/graphics/agg/include/agg_span_image_filter_gray.h rename to 3rdparty/agg/include/agg_span_image_filter_gray.h diff --git a/source/graphics/agg/include/agg_span_image_filter_rgb.h b/3rdparty/agg/include/agg_span_image_filter_rgb.h similarity index 100% rename from source/graphics/agg/include/agg_span_image_filter_rgb.h rename to 3rdparty/agg/include/agg_span_image_filter_rgb.h diff --git a/source/graphics/agg/include/agg_span_image_filter_rgba.h b/3rdparty/agg/include/agg_span_image_filter_rgba.h similarity index 100% rename from source/graphics/agg/include/agg_span_image_filter_rgba.h rename to 3rdparty/agg/include/agg_span_image_filter_rgba.h diff --git a/source/graphics/agg/include/agg_span_interpolator_adaptor.h b/3rdparty/agg/include/agg_span_interpolator_adaptor.h similarity index 100% rename from source/graphics/agg/include/agg_span_interpolator_adaptor.h rename to 3rdparty/agg/include/agg_span_interpolator_adaptor.h diff --git a/source/graphics/agg/include/agg_span_interpolator_linear.h b/3rdparty/agg/include/agg_span_interpolator_linear.h similarity index 100% rename from source/graphics/agg/include/agg_span_interpolator_linear.h rename to 3rdparty/agg/include/agg_span_interpolator_linear.h diff --git a/source/graphics/agg/include/agg_span_interpolator_persp.h b/3rdparty/agg/include/agg_span_interpolator_persp.h similarity index 100% rename from source/graphics/agg/include/agg_span_interpolator_persp.h rename to 3rdparty/agg/include/agg_span_interpolator_persp.h diff --git a/source/graphics/agg/include/agg_span_interpolator_trans.h b/3rdparty/agg/include/agg_span_interpolator_trans.h similarity index 100% rename from source/graphics/agg/include/agg_span_interpolator_trans.h rename to 3rdparty/agg/include/agg_span_interpolator_trans.h diff --git a/source/graphics/agg/include/agg_span_pattern_gray.h b/3rdparty/agg/include/agg_span_pattern_gray.h similarity index 100% rename from source/graphics/agg/include/agg_span_pattern_gray.h rename to 3rdparty/agg/include/agg_span_pattern_gray.h diff --git a/source/graphics/agg/include/agg_span_pattern_rgb.h b/3rdparty/agg/include/agg_span_pattern_rgb.h similarity index 100% rename from source/graphics/agg/include/agg_span_pattern_rgb.h rename to 3rdparty/agg/include/agg_span_pattern_rgb.h diff --git a/source/graphics/agg/include/agg_span_pattern_rgba.h b/3rdparty/agg/include/agg_span_pattern_rgba.h similarity index 100% rename from source/graphics/agg/include/agg_span_pattern_rgba.h rename to 3rdparty/agg/include/agg_span_pattern_rgba.h diff --git a/source/graphics/agg/include/agg_span_solid.h b/3rdparty/agg/include/agg_span_solid.h similarity index 100% rename from source/graphics/agg/include/agg_span_solid.h rename to 3rdparty/agg/include/agg_span_solid.h diff --git a/source/graphics/agg/include/agg_span_subdiv_adaptor.h b/3rdparty/agg/include/agg_span_subdiv_adaptor.h similarity index 100% rename from source/graphics/agg/include/agg_span_subdiv_adaptor.h rename to 3rdparty/agg/include/agg_span_subdiv_adaptor.h diff --git a/source/graphics/agg/include/agg_trans_affine.h b/3rdparty/agg/include/agg_trans_affine.h similarity index 100% rename from source/graphics/agg/include/agg_trans_affine.h rename to 3rdparty/agg/include/agg_trans_affine.h diff --git a/source/graphics/agg/include/agg_trans_bilinear.h b/3rdparty/agg/include/agg_trans_bilinear.h similarity index 100% rename from source/graphics/agg/include/agg_trans_bilinear.h rename to 3rdparty/agg/include/agg_trans_bilinear.h diff --git a/source/graphics/agg/include/agg_trans_double_path.h b/3rdparty/agg/include/agg_trans_double_path.h similarity index 100% rename from source/graphics/agg/include/agg_trans_double_path.h rename to 3rdparty/agg/include/agg_trans_double_path.h diff --git a/source/graphics/agg/include/agg_trans_perspective.h b/3rdparty/agg/include/agg_trans_perspective.h similarity index 100% rename from source/graphics/agg/include/agg_trans_perspective.h rename to 3rdparty/agg/include/agg_trans_perspective.h diff --git a/source/graphics/agg/include/agg_trans_single_path.h b/3rdparty/agg/include/agg_trans_single_path.h similarity index 100% rename from source/graphics/agg/include/agg_trans_single_path.h rename to 3rdparty/agg/include/agg_trans_single_path.h diff --git a/source/graphics/agg/include/agg_trans_viewport.h b/3rdparty/agg/include/agg_trans_viewport.h similarity index 100% rename from source/graphics/agg/include/agg_trans_viewport.h rename to 3rdparty/agg/include/agg_trans_viewport.h diff --git a/source/graphics/agg/include/agg_trans_warp_magnifier.h b/3rdparty/agg/include/agg_trans_warp_magnifier.h similarity index 100% rename from source/graphics/agg/include/agg_trans_warp_magnifier.h rename to 3rdparty/agg/include/agg_trans_warp_magnifier.h diff --git a/source/graphics/agg/include/agg_vcgen_bspline.h b/3rdparty/agg/include/agg_vcgen_bspline.h similarity index 100% rename from source/graphics/agg/include/agg_vcgen_bspline.h rename to 3rdparty/agg/include/agg_vcgen_bspline.h diff --git a/source/graphics/agg/include/agg_vcgen_contour.h b/3rdparty/agg/include/agg_vcgen_contour.h similarity index 100% rename from source/graphics/agg/include/agg_vcgen_contour.h rename to 3rdparty/agg/include/agg_vcgen_contour.h diff --git a/source/graphics/agg/include/agg_vcgen_dash.h b/3rdparty/agg/include/agg_vcgen_dash.h similarity index 100% rename from source/graphics/agg/include/agg_vcgen_dash.h rename to 3rdparty/agg/include/agg_vcgen_dash.h diff --git a/source/graphics/agg/include/agg_vcgen_markers_term.h b/3rdparty/agg/include/agg_vcgen_markers_term.h similarity index 100% rename from source/graphics/agg/include/agg_vcgen_markers_term.h rename to 3rdparty/agg/include/agg_vcgen_markers_term.h diff --git a/source/graphics/agg/include/agg_vcgen_smooth_poly1.h b/3rdparty/agg/include/agg_vcgen_smooth_poly1.h similarity index 100% rename from source/graphics/agg/include/agg_vcgen_smooth_poly1.h rename to 3rdparty/agg/include/agg_vcgen_smooth_poly1.h diff --git a/source/graphics/agg/include/agg_vcgen_stroke.h b/3rdparty/agg/include/agg_vcgen_stroke.h similarity index 100% rename from source/graphics/agg/include/agg_vcgen_stroke.h rename to 3rdparty/agg/include/agg_vcgen_stroke.h diff --git a/source/graphics/agg/include/agg_vcgen_vertex_sequence.h b/3rdparty/agg/include/agg_vcgen_vertex_sequence.h similarity index 100% rename from source/graphics/agg/include/agg_vcgen_vertex_sequence.h rename to 3rdparty/agg/include/agg_vcgen_vertex_sequence.h diff --git a/source/graphics/agg/include/agg_vertex_sequence.h b/3rdparty/agg/include/agg_vertex_sequence.h similarity index 100% rename from source/graphics/agg/include/agg_vertex_sequence.h rename to 3rdparty/agg/include/agg_vertex_sequence.h diff --git a/source/graphics/agg/include/agg_vpgen_clip_polygon.h b/3rdparty/agg/include/agg_vpgen_clip_polygon.h similarity index 100% rename from source/graphics/agg/include/agg_vpgen_clip_polygon.h rename to 3rdparty/agg/include/agg_vpgen_clip_polygon.h diff --git a/source/graphics/agg/include/agg_vpgen_clip_polyline.h b/3rdparty/agg/include/agg_vpgen_clip_polyline.h similarity index 100% rename from source/graphics/agg/include/agg_vpgen_clip_polyline.h rename to 3rdparty/agg/include/agg_vpgen_clip_polyline.h diff --git a/source/graphics/agg/include/agg_vpgen_segmentator.h b/3rdparty/agg/include/agg_vpgen_segmentator.h similarity index 100% rename from source/graphics/agg/include/agg_vpgen_segmentator.h rename to 3rdparty/agg/include/agg_vpgen_segmentator.h diff --git a/source/graphics/agg/include/util/agg_color_conv.h b/3rdparty/agg/include/util/agg_color_conv.h similarity index 100% rename from source/graphics/agg/include/util/agg_color_conv.h rename to 3rdparty/agg/include/util/agg_color_conv.h diff --git a/source/graphics/agg/include/util/agg_color_conv_rgb16.h b/3rdparty/agg/include/util/agg_color_conv_rgb16.h similarity index 100% rename from source/graphics/agg/include/util/agg_color_conv_rgb16.h rename to 3rdparty/agg/include/util/agg_color_conv_rgb16.h diff --git a/source/graphics/agg/include/util/agg_color_conv_rgb8.h b/3rdparty/agg/include/util/agg_color_conv_rgb8.h similarity index 100% rename from source/graphics/agg/include/util/agg_color_conv_rgb8.h rename to 3rdparty/agg/include/util/agg_color_conv_rgb8.h diff --git a/source/graphics/agg/src/agg_arc.cpp b/3rdparty/agg/src/agg_arc.cpp similarity index 100% rename from source/graphics/agg/src/agg_arc.cpp rename to 3rdparty/agg/src/agg_arc.cpp diff --git a/source/graphics/agg/src/agg_arrowhead.cpp b/3rdparty/agg/src/agg_arrowhead.cpp similarity index 100% rename from source/graphics/agg/src/agg_arrowhead.cpp rename to 3rdparty/agg/src/agg_arrowhead.cpp diff --git a/source/graphics/agg/src/agg_bezier_arc.cpp b/3rdparty/agg/src/agg_bezier_arc.cpp similarity index 100% rename from source/graphics/agg/src/agg_bezier_arc.cpp rename to 3rdparty/agg/src/agg_bezier_arc.cpp diff --git a/source/graphics/agg/src/agg_bspline.cpp b/3rdparty/agg/src/agg_bspline.cpp similarity index 100% rename from source/graphics/agg/src/agg_bspline.cpp rename to 3rdparty/agg/src/agg_bspline.cpp diff --git a/source/graphics/agg/src/agg_color_rgba.cpp b/3rdparty/agg/src/agg_color_rgba.cpp similarity index 100% rename from source/graphics/agg/src/agg_color_rgba.cpp rename to 3rdparty/agg/src/agg_color_rgba.cpp diff --git a/source/graphics/agg/src/agg_curves.cpp b/3rdparty/agg/src/agg_curves.cpp similarity index 100% rename from source/graphics/agg/src/agg_curves.cpp rename to 3rdparty/agg/src/agg_curves.cpp diff --git a/source/graphics/agg/src/agg_embedded_raster_fonts.cpp b/3rdparty/agg/src/agg_embedded_raster_fonts.cpp similarity index 100% rename from source/graphics/agg/src/agg_embedded_raster_fonts.cpp rename to 3rdparty/agg/src/agg_embedded_raster_fonts.cpp diff --git a/source/graphics/agg/src/agg_gsv_text.cpp b/3rdparty/agg/src/agg_gsv_text.cpp similarity index 100% rename from source/graphics/agg/src/agg_gsv_text.cpp rename to 3rdparty/agg/src/agg_gsv_text.cpp diff --git a/source/graphics/agg/src/agg_image_filters.cpp b/3rdparty/agg/src/agg_image_filters.cpp similarity index 100% rename from source/graphics/agg/src/agg_image_filters.cpp rename to 3rdparty/agg/src/agg_image_filters.cpp diff --git a/source/graphics/agg/src/agg_line_aa_basics.cpp b/3rdparty/agg/src/agg_line_aa_basics.cpp similarity index 100% rename from source/graphics/agg/src/agg_line_aa_basics.cpp rename to 3rdparty/agg/src/agg_line_aa_basics.cpp diff --git a/source/graphics/agg/src/agg_line_profile_aa.cpp b/3rdparty/agg/src/agg_line_profile_aa.cpp similarity index 100% rename from source/graphics/agg/src/agg_line_profile_aa.cpp rename to 3rdparty/agg/src/agg_line_profile_aa.cpp diff --git a/source/graphics/agg/src/agg_rounded_rect.cpp b/3rdparty/agg/src/agg_rounded_rect.cpp similarity index 100% rename from source/graphics/agg/src/agg_rounded_rect.cpp rename to 3rdparty/agg/src/agg_rounded_rect.cpp diff --git a/source/graphics/agg/src/agg_sqrt_tables.cpp b/3rdparty/agg/src/agg_sqrt_tables.cpp similarity index 100% rename from source/graphics/agg/src/agg_sqrt_tables.cpp rename to 3rdparty/agg/src/agg_sqrt_tables.cpp diff --git a/source/graphics/agg/src/agg_trans_affine.cpp b/3rdparty/agg/src/agg_trans_affine.cpp similarity index 100% rename from source/graphics/agg/src/agg_trans_affine.cpp rename to 3rdparty/agg/src/agg_trans_affine.cpp diff --git a/source/graphics/agg/src/agg_trans_double_path.cpp b/3rdparty/agg/src/agg_trans_double_path.cpp similarity index 100% rename from source/graphics/agg/src/agg_trans_double_path.cpp rename to 3rdparty/agg/src/agg_trans_double_path.cpp diff --git a/source/graphics/agg/src/agg_trans_single_path.cpp b/3rdparty/agg/src/agg_trans_single_path.cpp similarity index 100% rename from source/graphics/agg/src/agg_trans_single_path.cpp rename to 3rdparty/agg/src/agg_trans_single_path.cpp diff --git a/source/graphics/agg/src/agg_trans_warp_magnifier.cpp b/3rdparty/agg/src/agg_trans_warp_magnifier.cpp similarity index 100% rename from source/graphics/agg/src/agg_trans_warp_magnifier.cpp rename to 3rdparty/agg/src/agg_trans_warp_magnifier.cpp diff --git a/source/graphics/agg/src/agg_vcgen_bspline.cpp b/3rdparty/agg/src/agg_vcgen_bspline.cpp similarity index 100% rename from source/graphics/agg/src/agg_vcgen_bspline.cpp rename to 3rdparty/agg/src/agg_vcgen_bspline.cpp diff --git a/source/graphics/agg/src/agg_vcgen_contour.cpp b/3rdparty/agg/src/agg_vcgen_contour.cpp similarity index 100% rename from source/graphics/agg/src/agg_vcgen_contour.cpp rename to 3rdparty/agg/src/agg_vcgen_contour.cpp diff --git a/source/graphics/agg/src/agg_vcgen_dash.cpp b/3rdparty/agg/src/agg_vcgen_dash.cpp similarity index 100% rename from source/graphics/agg/src/agg_vcgen_dash.cpp rename to 3rdparty/agg/src/agg_vcgen_dash.cpp diff --git a/source/graphics/agg/src/agg_vcgen_markers_term.cpp b/3rdparty/agg/src/agg_vcgen_markers_term.cpp similarity index 100% rename from source/graphics/agg/src/agg_vcgen_markers_term.cpp rename to 3rdparty/agg/src/agg_vcgen_markers_term.cpp diff --git a/source/graphics/agg/src/agg_vcgen_smooth_poly1.cpp b/3rdparty/agg/src/agg_vcgen_smooth_poly1.cpp similarity index 100% rename from source/graphics/agg/src/agg_vcgen_smooth_poly1.cpp rename to 3rdparty/agg/src/agg_vcgen_smooth_poly1.cpp diff --git a/source/graphics/agg/src/agg_vcgen_stroke.cpp b/3rdparty/agg/src/agg_vcgen_stroke.cpp similarity index 100% rename from source/graphics/agg/src/agg_vcgen_stroke.cpp rename to 3rdparty/agg/src/agg_vcgen_stroke.cpp diff --git a/source/graphics/agg/src/agg_vpgen_clip_polygon.cpp b/3rdparty/agg/src/agg_vpgen_clip_polygon.cpp similarity index 100% rename from source/graphics/agg/src/agg_vpgen_clip_polygon.cpp rename to 3rdparty/agg/src/agg_vpgen_clip_polygon.cpp diff --git a/source/graphics/agg/src/agg_vpgen_clip_polyline.cpp b/3rdparty/agg/src/agg_vpgen_clip_polyline.cpp similarity index 100% rename from source/graphics/agg/src/agg_vpgen_clip_polyline.cpp rename to 3rdparty/agg/src/agg_vpgen_clip_polyline.cpp diff --git a/source/graphics/agg/src/agg_vpgen_segmentator.cpp b/3rdparty/agg/src/agg_vpgen_segmentator.cpp similarity index 100% rename from source/graphics/agg/src/agg_vpgen_segmentator.cpp rename to 3rdparty/agg/src/agg_vpgen_segmentator.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index e5d186d..a7044de 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,6 @@ cmake_minimum_required(VERSION 3.3) -set(LUNASVG_MAJOR_VERSION 0) -set(LUNASVG_MINOR_VERSION 1) -set(LUNASVG_PATCH_VERSION 0) -set(LUNASVG_VERSION ${LUNASVG_MAJOR_VERSION}.${LUNASVG_MINOR_VERSION}.${LUNASVG_PATCH_VERSION}) - -project(lunasvg VERSION ${LUNASVG_VERSION} LANGUAGES CXX) +project(lunasvg VERSION 1.0.0 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 11) @@ -27,6 +22,10 @@ if(LUNASVG_ENABLE_CAIRO) pkg_check_modules(CAIRO REQUIRED cairo) target_include_directories(lunasvg PRIVATE ${CAIRO_INCLUDE_DIRS}) target_link_libraries(lunasvg ${CAIRO_LIBRARIES}) + add_subdirectory(source/backends/cairo) +else() + add_subdirectory(3rdparty/agg) + add_subdirectory(source/backends/agg) endif() set(LUNASVG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib) @@ -44,4 +43,3 @@ install(TARGETS lunasvg ARCHIVE DESTINATION ${LUNASVG_LIBDIR} INCLUDES DESTINATION ${LUNASVG_INCDIR} ) - diff --git a/README.md b/README.md index 8dab11b..739de4b 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ int main() - Basic Shapes : rect, circle, ellipse, line, polyline, polygon, path. - Paint Servers : solidColor, linearGradient, radialGradient, pattern. - Clipping, Masking and Compositing : clipPath, mask, group opacity. -- Document Structure: defs, svg, g, use, symbol. +- Document Structures: defs, svg, g, use, symbol. - Coordinate Systems, Transformations and Units. - Texts (TODO) : text, tspan, tref, textPath. - Animations (TODO) : animate, animateColor, animateMotion, animateTransform diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 26ff014..0c189e9 100755 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -1,9 +1,25 @@ add_subdirectory(geometry) add_subdirectory(graphics) -add_subdirectory(properties) target_sources(lunasvg PRIVATE + "${CMAKE_CURRENT_LIST_DIR}/cssproperty.cpp" + "${CMAKE_CURRENT_LIST_DIR}/svgcolor.cpp" + "${CMAKE_CURRENT_LIST_DIR}/svgenumeration.cpp" + "${CMAKE_CURRENT_LIST_DIR}/svglength.cpp" + "${CMAKE_CURRENT_LIST_DIR}/svglengthlist.cpp" + "${CMAKE_CURRENT_LIST_DIR}/svgnumber.cpp" + "${CMAKE_CURRENT_LIST_DIR}/svgnumberlist.cpp" + "${CMAKE_CURRENT_LIST_DIR}/svgpath.cpp" + "${CMAKE_CURRENT_LIST_DIR}/svgpoint.cpp" + "${CMAKE_CURRENT_LIST_DIR}/svgpointlist.cpp" + "${CMAKE_CURRENT_LIST_DIR}/svgpreserveaspectratio.cpp" + "${CMAKE_CURRENT_LIST_DIR}/svgproperty.cpp" + "${CMAKE_CURRENT_LIST_DIR}/svgpropertyutils.cpp" + "${CMAKE_CURRENT_LIST_DIR}/svgrect.cpp" + "${CMAKE_CURRENT_LIST_DIR}/svgstring.cpp" + "${CMAKE_CURRENT_LIST_DIR}/svgstringlist.cpp" + "${CMAKE_CURRENT_LIST_DIR}/svgtransform.cpp" "${CMAKE_CURRENT_LIST_DIR}/rendercontext.cpp" "${CMAKE_CURRENT_LIST_DIR}/svgdefselement.cpp" "${CMAKE_CURRENT_LIST_DIR}/svgdocument.cpp" diff --git a/source/graphics/cairo/CMakeLists.txt b/source/backends/agg/CMakeLists.txt similarity index 100% rename from source/graphics/cairo/CMakeLists.txt rename to source/backends/agg/CMakeLists.txt diff --git a/source/graphics/agg/canvasimpl.cpp b/source/backends/agg/canvasimpl.cpp similarity index 96% rename from source/graphics/agg/canvasimpl.cpp rename to source/backends/agg/canvasimpl.cpp index 8710383..7db8c32 100755 --- a/source/graphics/agg/canvasimpl.cpp +++ b/source/backends/agg/canvasimpl.cpp @@ -313,7 +313,7 @@ template void CanvasImpl::render_pattern(const Pattern* pattern, const agg::trans_affine& matrix) { typedef agg::span_interpolator_linear<> span_interpolator_t; - typedef agg::span_allocator span_allocator_t; + typedef agg::span_allocator span_allocator_t; typedef agg::renderer_scanline_aa pattern_renderer_t; agg::trans_affine transform(to_agg_transform(pattern->matrix())); @@ -353,7 +353,7 @@ void CanvasImpl::render_scanlines(const Paint& paint, const agg::trans_affine& m { const RadialGradient* radial = static_cast(g); agg::gradient_radial_focus gradient_function(KGradientScale, KGradientScale*(radial->fx() - radial->cx())/ radial->r(), KGradientScale*(radial->fy() - radial->cy())/ radial->r()); - render_gradient(gradient_function, radial, paint.opacity(), matrix); + render_gradient(gradient_function, g, paint.opacity(), matrix); } } else if(paint.type() == PaintTypePattern) diff --git a/source/graphics/agg/canvasimpl.h b/source/backends/agg/canvasimpl.h similarity index 100% rename from source/graphics/agg/canvasimpl.h rename to source/backends/agg/canvasimpl.h diff --git a/source/graphics/agg/CMakeLists.txt b/source/backends/cairo/CMakeLists.txt similarity index 72% rename from source/graphics/agg/CMakeLists.txt rename to source/backends/cairo/CMakeLists.txt index 0a8a62a..1593221 100755 --- a/source/graphics/agg/CMakeLists.txt +++ b/source/backends/cairo/CMakeLists.txt @@ -1,6 +1,3 @@ -add_subdirectory(include) -add_subdirectory(src) - target_sources(lunasvg PRIVATE "${CMAKE_CURRENT_LIST_DIR}/canvasimpl.cpp" diff --git a/source/graphics/cairo/canvasimpl.cpp b/source/backends/cairo/canvasimpl.cpp similarity index 100% rename from source/graphics/cairo/canvasimpl.cpp rename to source/backends/cairo/canvasimpl.cpp diff --git a/source/graphics/cairo/canvasimpl.h b/source/backends/cairo/canvasimpl.h similarity index 100% rename from source/graphics/cairo/canvasimpl.h rename to source/backends/cairo/canvasimpl.h diff --git a/source/properties/cssproperty.cpp b/source/cssproperty.cpp similarity index 100% rename from source/properties/cssproperty.cpp rename to source/cssproperty.cpp diff --git a/source/properties/cssproperty.h b/source/cssproperty.h similarity index 94% rename from source/properties/cssproperty.h rename to source/cssproperty.h index c5d7a90..f068114 100755 --- a/source/properties/cssproperty.h +++ b/source/cssproperty.h @@ -1,5 +1,5 @@ -#ifndef DOMSVGSTYLE_H -#define DOMSVGSTYLE_H +#ifndef CSSPROPERTY_H +#define CSSPROPERTY_H #include "svgproperty.h" @@ -138,4 +138,4 @@ class DOMSVGStyle : public DOMSVGProperty } // namespace lunasvg -#endif // DOMSVGSTYLE_H +#endif // CSSPROPERTY_H diff --git a/source/geometry/affinetransform.cpp b/source/geometry/affinetransform.cpp index d1092d1..193728b 100755 --- a/source/geometry/affinetransform.cpp +++ b/source/geometry/affinetransform.cpp @@ -42,36 +42,11 @@ void AffineTransform::setMatrix(double m00, double m10, double m01, double m11, m_matrix[4] = m02; m_matrix[5] = m12; } -void AffineTransform::multiply(const double* a, const double* b) +void AffineTransform::makeIdentity() { - double m00 = a[0] * b[0] + a[1] * b[2]; - double m10 = a[0] * b[1] + a[1] * b[3]; - double m01 = a[2] * b[0] + a[3] * b[2]; - double m11 = a[2] * b[1] + a[3] * b[3]; - double m02 = a[4] * b[0] + a[5] * b[2] + b[4]; - double m12 = a[4] * b[1] + a[5] * b[3] + b[5]; - - m_matrix[0] = m00; m_matrix[1] = m10; - m_matrix[2] = m01; m_matrix[3] = m11; - m_matrix[4] = m02; m_matrix[5] = m12; -} - -AffineTransform& AffineTransform::multiply(const AffineTransform& transform) -{ - const double* a = m_matrix; - const double* b = transform.m_matrix; - multiply(b, a); - - return *this; -} - -AffineTransform& AffineTransform::postmultiply(const AffineTransform& transform) -{ - const double* a = m_matrix; - const double* b = transform.m_matrix; - multiply(a, b); - - return *this; + m_matrix[0] = 1.0; m_matrix[1] = 0.0; + m_matrix[2] = 0.0; m_matrix[3] = 1.0; + m_matrix[4] = 0.0; m_matrix[5] = 0.0; } AffineTransform AffineTransform::inverted() const @@ -94,21 +69,42 @@ AffineTransform AffineTransform::inverted() const m02, m12); } -void AffineTransform::reset() +AffineTransform AffineTransform::operator*(const AffineTransform& transform) const { - m_matrix[0] = 1.0; m_matrix[1] = 0.0; - m_matrix[2] = 0.0; m_matrix[3] = 1.0; - m_matrix[4] = 0.0; m_matrix[5] = 0.0; + const double* a = m_matrix; + const double* b = transform.m_matrix; + + double m00 = a[0] * b[0] + a[1] * b[2]; + double m10 = a[0] * b[1] + a[1] * b[3]; + double m01 = a[2] * b[0] + a[3] * b[2]; + double m11 = a[2] * b[1] + a[3] * b[3]; + double m02 = a[4] * b[0] + a[5] * b[2] + b[4]; + double m12 = a[4] * b[1] + a[5] * b[3] + b[5]; + + return AffineTransform(m00, m10, + m01, m11, + m02, m12); } -AffineTransform AffineTransform::makeIdentity() +AffineTransform& AffineTransform::operator*=(const AffineTransform& transform) { - return AffineTransform(1, 0, - 0, 1, - 0, 0); + *this = *this * transform; + return *this; } -AffineTransform AffineTransform::makeRotate(double radians) +AffineTransform& AffineTransform::multiply(const AffineTransform& transform) +{ + *this = transform * *this; + return *this; +} + +AffineTransform& AffineTransform::postmultiply(const AffineTransform& transform) +{ + *this = *this * transform; + return *this; +} + +AffineTransform AffineTransform::fromRotate(double radians) { double c = std::cos(radians); double s = std::sin(radians); @@ -118,7 +114,7 @@ AffineTransform AffineTransform::makeRotate(double radians) 0, 0); } -AffineTransform AffineTransform::makeRotate(double radians, double cx, double cy) +AffineTransform AffineTransform::fromRotate(double radians, double cx, double cy) { double c = std::cos(radians); double s = std::sin(radians); @@ -131,14 +127,14 @@ AffineTransform AffineTransform::makeRotate(double radians, double cx, double cy x, y); } -AffineTransform AffineTransform::makeScale(double sx, double sy) +AffineTransform AffineTransform::fromScale(double sx, double sy) { return AffineTransform(sx, 0, 0, sy, 0, 0); } -AffineTransform AffineTransform::makeShear(double shx, double shy) +AffineTransform AffineTransform::fromShear(double shx, double shy) { double x = std::tan(shx); double y = std::tan(shy); @@ -148,36 +144,36 @@ AffineTransform AffineTransform::makeShear(double shx, double shy) 0, 0); } -AffineTransform AffineTransform::makeTranslate(double tx, double ty) +AffineTransform AffineTransform::fromTranslate(double tx, double ty) { return AffineTransform(1, 0, 0, 1, tx, ty); } -void AffineTransform::rotate(double radians) +AffineTransform& AffineTransform::rotate(double radians) { - multiply(makeRotate(radians)); + return multiply(fromRotate(radians)); } -void AffineTransform::rotate(double radians, double cx, double cy) +AffineTransform& AffineTransform::rotate(double radians, double cx, double cy) { - multiply(makeRotate(radians, cx, cy)); + return multiply(fromRotate(radians, cx, cy)); } -void AffineTransform::scale(double sx, double sy) +AffineTransform& AffineTransform::scale(double sx, double sy) { - multiply(makeScale(sx, sy)); + return multiply(fromScale(sx, sy)); } -void AffineTransform::shear(double shx, double shy) +AffineTransform& AffineTransform::shear(double shx, double shy) { - multiply(makeShear(shx, shy)); + return multiply(fromShear(shx, shy)); } -void AffineTransform::translate(double cx, double cy) +AffineTransform& AffineTransform::translate(double cx, double cy) { - multiply(makeTranslate(cx, cy)); + return multiply(fromTranslate(cx, cy)); } void AffineTransform::map(double x, double y, double& _x, double& _y) const @@ -186,10 +182,22 @@ void AffineTransform::map(double x, double y, double& _x, double& _y) const _y = x * m_matrix[1] + y * m_matrix[3] + m_matrix[5]; } +void AffineTransform::map(const double* src, double* dst, int size) const +{ + for(int i = 0;i < size;i+=2) + map(src[i], src[i+1], dst[i], dst[i+1]); +} + +void AffineTransform::map(const Point* src, Point* dst, int size) const +{ + for(int i = 0;i < size;i++) + map(src[i].x, src[i].y, dst[i].x, dst[i].y); +} + Point AffineTransform::mapPoint(const Point& point) const { Point p; - map(point.x, point.y, p.x, p.y); + map(&point, &p, 1); return p; } @@ -205,10 +213,7 @@ Rect AffineTransform::mapRect(const Rect& rect) const p[3].x = rect.x; p[3].y = rect.y + rect.height; - map(p[0].x, p[0].y, p[0].x, p[0].y); - map(p[1].x, p[1].y, p[1].x, p[1].y); - map(p[2].x, p[2].y, p[2].x, p[2].y); - map(p[3].x, p[3].y, p[3].x, p[3].y); + map(p, p, 4); double l = p[0].x; double t = p[0].y; diff --git a/source/geometry/affinetransform.h b/source/geometry/affinetransform.h index d10b931..63cf6bb 100755 --- a/source/geometry/affinetransform.h +++ b/source/geometry/affinetransform.h @@ -14,27 +14,31 @@ class AffineTransform AffineTransform(double m00, double m10, double m01, double m11, double m02, double m12); void setMatrix(double m00, double m10, double m01, double m11, double m02, double m12); - void multiply(const double* a, const double* b); + void makeIdentity(); + AffineTransform inverted() const; + + AffineTransform operator*(const AffineTransform& transform) const; + AffineTransform& operator*=(const AffineTransform& transform); + AffineTransform& multiply(const AffineTransform& transform); AffineTransform& postmultiply(const AffineTransform& transform); - void reset(); + AffineTransform& rotate(double radians); + AffineTransform& rotate(double radians, double cx, double cy); + AffineTransform& scale(double sx, double sy); + AffineTransform& shear(double shx, double shy); + AffineTransform& translate(double cx, double cy); + + static AffineTransform fromRotate(double radians); + static AffineTransform fromRotate(double radians, double cx, double cy); + static AffineTransform fromScale(double sx, double sy); + static AffineTransform fromShear(double shx, double shy); + static AffineTransform fromTranslate(double tx, double ty); + void map(double x, double y, double& _x, double& _y) const; + void map(const double* src, double* dst, int size) const; + void map(const Point* src, Point* dst, int size) const; Point mapPoint(const Point& point) const; Rect mapRect(const Rect& rect) const; - AffineTransform inverted() const; - - void rotate(double radians); - void rotate(double radians, double cx, double cy); - void scale(double sx, double sy); - void shear(double angleX, double angleY); - void translate(double cx, double cy); - - static AffineTransform makeIdentity(); - static AffineTransform makeRotate(double radians); - static AffineTransform makeRotate(double radians, double cx, double cy); - static AffineTransform makeScale(double sx, double sy); - static AffineTransform makeShear(double shx, double shy); - static AffineTransform makeTranslate(double tx, double ty); bool isIdentity() const; double determinant() const; diff --git a/source/geometry/path.cpp b/source/geometry/path.cpp index b1dd220..4fd2efe 100755 --- a/source/geometry/path.cpp +++ b/source/geometry/path.cpp @@ -22,9 +22,8 @@ void Path::moveTo(double x, double y, bool rel) y += p.y; } - m_pointSegs.push_back(SegTypeMoveTo); - m_pointCoords.push_back(x); - m_pointCoords.push_back(y); + m_segments.push_back(SegTypeMoveTo); + m_coordinates.emplace_back(x, y); m_startPoint = Point(x, y); } @@ -38,9 +37,8 @@ void Path::lineTo(double x, double y, bool rel) y += p.y; } - m_pointSegs.push_back(SegTypeLineTo); - m_pointCoords.push_back(x); - m_pointCoords.push_back(y); + m_segments.push_back(SegTypeLineTo); + m_coordinates.emplace_back(x, y); } void Path::quadTo(double x1, double y1, double x2, double y2, bool rel) @@ -54,11 +52,9 @@ void Path::quadTo(double x1, double y1, double x2, double y2, bool rel) y2 += p.y; } - m_pointSegs.push_back(SegTypeQuadTo); - m_pointCoords.push_back(x1); - m_pointCoords.push_back(y1); - m_pointCoords.push_back(x2); - m_pointCoords.push_back(y2); + m_segments.push_back(SegTypeQuadTo); + m_coordinates.emplace_back(x1, y1); + m_coordinates.emplace_back(x2, y2); } void Path::cubicTo(double x1, double y1, double x2, double y2, double x3, double y3, bool rel) @@ -74,13 +70,10 @@ void Path::cubicTo(double x1, double y1, double x2, double y2, double x3, double y3 += p.y; } - m_pointSegs.push_back(SegTypeCubicTo); - m_pointCoords.push_back(x1); - m_pointCoords.push_back(y1); - m_pointCoords.push_back(x2); - m_pointCoords.push_back(y2); - m_pointCoords.push_back(x3); - m_pointCoords.push_back(y3); + m_segments.push_back(SegTypeCubicTo); + m_coordinates.emplace_back(x1, y1); + m_coordinates.emplace_back(x2, y2); + m_coordinates.emplace_back(x3, y3); } void Path::smoothQuadTo(double x2, double y2, bool rel) @@ -93,8 +86,8 @@ void Path::smoothQuadTo(double x2, double y2, bool rel) } Point p1; - std::size_t count = m_pointSegs.size(); - if(count > 0 && m_pointSegs[count - 1] == SegTypeQuadTo) + std::size_t count = m_segments.size(); + if(count > 0 && m_segments[count - 1] == SegTypeQuadTo) p1 = controlPoint(); else p1 = currentPoint(); @@ -114,8 +107,8 @@ void Path::smoothCubicTo(double x2, double y2, double x3, double y3, bool rel) } Point p1; - std::size_t count = m_pointSegs.size(); - if(count > 0 && m_pointSegs[count - 1] == SegTypeCubicTo) + std::size_t count = m_segments.size(); + if(count > 0 && m_segments[count - 1] == SegTypeCubicTo) p1 = controlPoint(); else p1 = currentPoint(); @@ -130,9 +123,8 @@ void Path::horizontalTo(double x, bool rel) if(rel) x += p.x; - m_pointSegs.push_back(SegTypeLineTo); - m_pointCoords.push_back(x); - m_pointCoords.push_back(p.y); + m_segments.push_back(SegTypeLineTo); + m_coordinates.emplace_back(x, p.y); } void Path::verticalTo(double y, bool rel) @@ -142,48 +134,40 @@ void Path::verticalTo(double y, bool rel) if(rel) y += p.y; - m_pointSegs.push_back(SegTypeLineTo); - m_pointCoords.push_back(p.x); - m_pointCoords.push_back(y); + m_segments.push_back(SegTypeLineTo); + m_coordinates.emplace_back(p.x, y); } void Path::closePath() { - std::size_t count = m_pointSegs.size(); - if(count > 0 && m_pointSegs[count - 1] != SegTypeClose) - m_pointSegs.push_back(SegTypeClose); + std::size_t count = m_segments.size(); + if(count > 0 && m_segments[count - 1] != SegTypeClose) + m_segments.push_back(SegTypeClose); } Point Path::currentPoint() const { - if(m_pointCoords.size() < 2) + if(m_coordinates.empty()) return Point(); - if(m_pointSegs[m_pointSegs.size() - 1] == SegTypeClose) + if(m_segments[m_segments.size() - 1] == SegTypeClose) return m_startPoint; - std::size_t count = m_pointCoords.size(); - double x = m_pointCoords[count - 2]; - double y = m_pointCoords[count - 1]; - - return Point(x, y); + return m_coordinates[m_coordinates.size() - 1]; } Point Path::controlPoint() const { - if(m_pointCoords.size() < 4) + if(m_coordinates.size() < 2) return Point(); - std::size_t count = m_pointCoords.size(); - double x0 = m_pointCoords[count - 4]; - double y0 = m_pointCoords[count - 3]; - double x1 = m_pointCoords[count - 2]; - double y1 = m_pointCoords[count - 1]; - - return Point(x1 + x1 - x0, y1 + y1 - y0); + std::size_t count = m_coordinates.size(); + const Point& p1 = m_coordinates[count - 2]; + const Point& p2 = m_coordinates[count - 1]; + return Point(p2.x + p2.x - p1.x, p2.y + p2.y - p1.y); } -void Path::addPath(const Path& path) +void Path::addPath(const Path& path, const AffineTransform& matrix) { PathIterator it(path); double c[6]; @@ -192,15 +176,19 @@ void Path::addPath(const Path& path) switch(it.currentSegment(c)) { case SegTypeMoveTo: + matrix.map(c, c, 2); moveTo(c[0], c[1]); break; case SegTypeLineTo: + matrix.map(c, c, 2); lineTo(c[0], c[1]); break; case SegTypeQuadTo: + matrix.map(c, c, 4); quadTo(c[0], c[1], c[2], c[3]); break; case SegTypeCubicTo: + matrix.map(c, c, 6); cubicTo(c[0], c[1], c[2], c[3], c[4], c[5]); break; case SegTypeClose: @@ -280,14 +268,13 @@ Rect Path::boundingBox() const double xMax = std::numeric_limits::min(); double yMax = std::numeric_limits::min(); - for(std::size_t i = 0;i < m_pointCoords.size();i += 2) + for(std::size_t i = 0;i < m_coordinates.size();i++) { - double x = m_pointCoords[i]; - double y = m_pointCoords[i+1]; - if(x < xMin) xMin = x; - if(x > xMax) xMax = x; - if(y < yMin) yMin = y; - if(y > yMax) yMax = y; + const Point& p = m_coordinates[i]; + if(p.x < xMin) xMin = p.x; + if(p.x > xMax) xMax = p.x; + if(p.y < yMin) yMin = p.y; + if(p.y > yMax) yMax = p.y; } return Rect(xMin, yMin, xMax - xMin, yMax - yMin); @@ -295,15 +282,18 @@ Rect Path::boundingBox() const void Path::transform(const AffineTransform& matrix) { - for(std::size_t i = 0;i < m_pointCoords.size();i += 2) - matrix.map(m_pointCoords[i], m_pointCoords[i+1], m_pointCoords[i], m_pointCoords[i+1]); + for(std::size_t i = 0;i < m_coordinates.size();i++) + { + Point& p = m_coordinates[i]; + matrix.map(p.x, p.y, p.x, p.y); + } } void Path::reset() { m_startPoint = Point(); - m_pointSegs.clear(); - m_pointCoords.clear(); + m_segments.clear(); + m_coordinates.clear(); } } //namespace lunasvg diff --git a/source/geometry/path.h b/source/geometry/path.h index bb9d2fc..b4fddeb 100755 --- a/source/geometry/path.h +++ b/source/geometry/path.h @@ -42,7 +42,7 @@ class Path void smoothQuadTo(const Point& p2, bool rel = false); void smoothCubicTo(const Point& p2, const Point& p3, bool rel = false); - void addPath(const Path& path); + void addPath(const Path& path, const AffineTransform& matrix); void addPoints(const std::vector& points); void addEllipse(double cx, double cy, double rx, double ry); void addRect(double x, double y, double w, double h, double rx, double ry); @@ -56,18 +56,18 @@ class Path Point controlPoint() const; const Point& startPoint() const { return m_startPoint; } - const std::vector& getPointSegs() const { return m_pointSegs; } - const std::vector& getPointCoords() const { return m_pointCoords; } + const std::vector& segments() const { return m_segments; } + const std::vector& coordinates() const { return m_coordinates; } private: Point m_startPoint; - std::vector m_pointSegs; - std::vector m_pointCoords; + std::vector m_segments; + std::vector m_coordinates; }; inline bool Path::isEmpty() const { - return m_pointCoords.empty(); + return m_coordinates.empty(); } inline void Path::moveTo(const Point& p1, bool rel) diff --git a/source/geometry/pathiterator.cpp b/source/geometry/pathiterator.cpp index 2c1f9ff..71d73f0 100755 --- a/source/geometry/pathiterator.cpp +++ b/source/geometry/pathiterator.cpp @@ -4,41 +4,40 @@ namespace lunasvg { PathIterator::PathIterator(const Path& path) : - m_pointSegs(path.getPointSegs()), - m_pointCoords(path.getPointCoords()), - m_segIndex(0), - m_coordIndex(0) + m_segments(path.segments()), + m_coordinates(path.coordinates().data()), + m_index(0) { } SegType PathIterator::currentSegment(double* coords) const { - SegType segType = m_pointSegs[m_segIndex]; + SegType segType = m_segments[m_index]; switch(segType) { case SegTypeMoveTo: - coords[0] = m_pointCoords[m_coordIndex]; - coords[1] = m_pointCoords[m_coordIndex + 1]; + coords[0] = m_coordinates[0].x; + coords[1] = m_coordinates[0].y; m_startPoint.x = coords[0]; m_startPoint.y = coords[1]; break; case SegTypeLineTo: - coords[0] = m_pointCoords[m_coordIndex]; - coords[1] = m_pointCoords[m_coordIndex + 1]; + coords[0] = m_coordinates[0].x; + coords[1] = m_coordinates[0].y; break; case SegTypeQuadTo: - coords[0] = m_pointCoords[m_coordIndex]; - coords[1] = m_pointCoords[m_coordIndex + 1]; - coords[2] = m_pointCoords[m_coordIndex + 2]; - coords[3] = m_pointCoords[m_coordIndex + 3]; + coords[0] = m_coordinates[0].x; + coords[1] = m_coordinates[0].y; + coords[2] = m_coordinates[1].x; + coords[3] = m_coordinates[1].y; break; case SegTypeCubicTo: - coords[0] = m_pointCoords[m_coordIndex]; - coords[1] = m_pointCoords[m_coordIndex + 1]; - coords[2] = m_pointCoords[m_coordIndex + 2]; - coords[3] = m_pointCoords[m_coordIndex + 3]; - coords[4] = m_pointCoords[m_coordIndex + 4]; - coords[5] = m_pointCoords[m_coordIndex + 5]; + coords[0] = m_coordinates[0].x; + coords[1] = m_coordinates[0].y; + coords[2] = m_coordinates[1].x; + coords[3] = m_coordinates[1].y; + coords[4] = m_coordinates[2].x; + coords[5] = m_coordinates[2].y; break; case SegTypeClose: coords[0] = m_startPoint.x; @@ -51,32 +50,30 @@ SegType PathIterator::currentSegment(double* coords) const bool PathIterator::isDone() const { - return (m_segIndex >= m_pointSegs.size()); + return (m_index >= m_segments.size()); } void PathIterator::next() { - if(m_segIndex < m_pointSegs.size()) + switch(m_segments[m_index]) { - switch(m_pointSegs[m_segIndex]) - { - case SegTypeMoveTo: - m_coordIndex += 2; - break; - case SegTypeLineTo: - m_coordIndex += 2; - break; - case SegTypeQuadTo: - m_coordIndex += 4; - break; - case SegTypeCubicTo: - m_coordIndex += 6; - break; - default: - break; - } - m_segIndex += 1; + case SegTypeMoveTo: + m_coordinates += 1; + break; + case SegTypeLineTo: + m_coordinates += 1; + break; + case SegTypeQuadTo: + m_coordinates += 2; + break; + case SegTypeCubicTo: + m_coordinates += 3; + break; + default: + break; } + + m_index += 1; } } //namespace lunasvg diff --git a/source/geometry/pathiterator.h b/source/geometry/pathiterator.h index 3bb5062..64f450d 100755 --- a/source/geometry/pathiterator.h +++ b/source/geometry/pathiterator.h @@ -3,8 +3,7 @@ #include "path.h" -namespace lunasvg -{ +namespace lunasvg { class PathIterator { @@ -17,10 +16,9 @@ class PathIterator private: mutable Point m_startPoint; - const std::vector& m_pointSegs; - const std::vector& m_pointCoords; - unsigned int m_segIndex; - unsigned int m_coordIndex; + const std::vector& m_segments; + const Point* m_coordinates; + unsigned int m_index; }; } //namespace lunasvg diff --git a/source/geometry/pathutils.h b/source/geometry/pathutils.h index 6fde0ff..8459c31 100755 --- a/source/geometry/pathutils.h +++ b/source/geometry/pathutils.h @@ -1,13 +1,11 @@ #ifndef PATHUTILS_H #define PATHUTILS_H -namespace lunasvg -{ +namespace lunasvg { class Path; -namespace Utils -{ +namespace Utils { void pathArcTo(Path& path, double rx, double ry, double xAxisRotation, bool largeArcFlag, bool sweepFlag, double x, double y, bool rel); diff --git a/source/graphics/CMakeLists.txt b/source/graphics/CMakeLists.txt index 0c10938..24fa2d3 100755 --- a/source/graphics/CMakeLists.txt +++ b/source/graphics/CMakeLists.txt @@ -1,9 +1,3 @@ -if(LUNASVG_ENABLE_CAIRO) - add_subdirectory(cairo) -else() - add_subdirectory(agg) -endif() - target_sources(lunasvg PRIVATE "${CMAKE_CURRENT_LIST_DIR}/canvas.cpp" diff --git a/source/graphics/agg/include/CMakeLists.txt b/source/graphics/agg/include/CMakeLists.txt deleted file mode 100755 index 6977327..0000000 --- a/source/graphics/agg/include/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_subdirectory(util) - -target_include_directories(lunasvg -PRIVATE - "${CMAKE_CURRENT_LIST_DIR}" -) diff --git a/source/graphics/agg/include/util/CMakeLists.txt b/source/graphics/agg/include/util/CMakeLists.txt deleted file mode 100755 index e1c8969..0000000 --- a/source/graphics/agg/include/util/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -target_include_directories(lunasvg -PRIVATE - "${CMAKE_CURRENT_LIST_DIR}" -) diff --git a/source/graphics/agg/src/CMakeLists.txt b/source/graphics/agg/src/CMakeLists.txt deleted file mode 100755 index c721de9..0000000 --- a/source/graphics/agg/src/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -target_sources(lunasvg -PRIVATE - "${CMAKE_CURRENT_LIST_DIR}/agg_vcgen_stroke.cpp" - "${CMAKE_CURRENT_LIST_DIR}/agg_vcgen_dash.cpp" - "${CMAKE_CURRENT_LIST_DIR}/agg_vcgen_contour.cpp" - "${CMAKE_CURRENT_LIST_DIR}/agg_trans_affine.cpp" - "${CMAKE_CURRENT_LIST_DIR}/agg_curves.cpp" - "${CMAKE_CURRENT_LIST_DIR}/agg_sqrt_tables.cpp" -) diff --git a/source/graphics/rgb.cpp b/source/graphics/rgb.cpp index 8834441..af7afc2 100755 --- a/source/graphics/rgb.cpp +++ b/source/graphics/rgb.cpp @@ -1,7 +1,6 @@ #include "rgb.h" -namespace lunasvg -{ +namespace lunasvg { Rgb::Rgb() : r(0), diff --git a/source/graphics/rgb.h b/source/graphics/rgb.h index a445700..1c9a16d 100755 --- a/source/graphics/rgb.h +++ b/source/graphics/rgb.h @@ -1,8 +1,7 @@ #ifndef RGB_H #define RGB_H -namespace lunasvg -{ +namespace lunasvg { class Rgb { diff --git a/source/properties/CMakeLists.txt b/source/properties/CMakeLists.txt deleted file mode 100755 index 55356c1..0000000 --- a/source/properties/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -target_sources(lunasvg -PRIVATE - "${CMAKE_CURRENT_LIST_DIR}/cssproperty.cpp" - "${CMAKE_CURRENT_LIST_DIR}/svgcolor.cpp" - "${CMAKE_CURRENT_LIST_DIR}/svgenumeration.cpp" - "${CMAKE_CURRENT_LIST_DIR}/svglength.cpp" - "${CMAKE_CURRENT_LIST_DIR}/svglengthlist.cpp" - "${CMAKE_CURRENT_LIST_DIR}/svgnumber.cpp" - "${CMAKE_CURRENT_LIST_DIR}/svgnumberlist.cpp" - "${CMAKE_CURRENT_LIST_DIR}/svgpath.cpp" - "${CMAKE_CURRENT_LIST_DIR}/svgpoint.cpp" - "${CMAKE_CURRENT_LIST_DIR}/svgpointlist.cpp" - "${CMAKE_CURRENT_LIST_DIR}/svgpreserveaspectratio.cpp" - "${CMAKE_CURRENT_LIST_DIR}/svgproperty.cpp" - "${CMAKE_CURRENT_LIST_DIR}/svgpropertyutils.cpp" - "${CMAKE_CURRENT_LIST_DIR}/svgrect.cpp" - "${CMAKE_CURRENT_LIST_DIR}/svgstring.cpp" - "${CMAKE_CURRENT_LIST_DIR}/svgstringlist.cpp" - "${CMAKE_CURRENT_LIST_DIR}/svgtransform.cpp" -) - -target_include_directories(lunasvg -PRIVATE - "${CMAKE_CURRENT_LIST_DIR}" -) diff --git a/source/rendercontext.h b/source/rendercontext.h index 36db219..33a1f66 100755 --- a/source/rendercontext.h +++ b/source/rendercontext.h @@ -42,7 +42,7 @@ class RenderStyle StrokeData strokeData(const RenderState& state) const; Paint fillPaint(const RenderState& state) const; Paint strokePaint(const RenderState& state) const; - double strokeWidth(const RenderState &state) const; + double strokeWidth(const RenderState& state) const; double fillOpacity() const; double strokeOpacity() const; double opacity() const; diff --git a/source/svgcircleelement.cpp b/source/svgcircleelement.cpp index 45667de..3af5040 100755 --- a/source/svgcircleelement.cpp +++ b/source/svgcircleelement.cpp @@ -47,7 +47,7 @@ SVGElementImpl* SVGCircleElement::clone(SVGDocument* document) const { SVGCircleElement* e = new SVGCircleElement(document); baseClone(*e); - return e; + return e; } } // namespace lunasvg diff --git a/source/svgclippathelement.cpp b/source/svgclippathelement.cpp index fb1ca61..8f31b2b 100644 --- a/source/svgclippathelement.cpp +++ b/source/svgclippathelement.cpp @@ -4,8 +4,6 @@ #include "svgdocumentimpl.h" #include "svguseelement.h" -#include "paint.h" - namespace lunasvg { SVGClipPathElement::SVGClipPathElement(SVGDocument* document) : diff --git a/source/properties/svgcolor.cpp b/source/svgcolor.cpp similarity index 96% rename from source/properties/svgcolor.cpp rename to source/svgcolor.cpp index 6b013b7..61d3fd3 100755 --- a/source/properties/svgcolor.cpp +++ b/source/svgcolor.cpp @@ -198,9 +198,10 @@ void SVGColor::setValueAsString(const std::string& value) if(value.empty()) return; - if(value[0] == '#') + const char* ptr = value.c_str(); + Utils::skipWs(ptr); + if(Utils::skipDesc(ptr, "#", 1)) { - const char* ptr = value.c_str() + 1; const char* start = ptr; while(*ptr && Utils::isIntegralDigit(*ptr, 16)) ++ptr; @@ -231,7 +232,7 @@ void SVGColor::setValueAsString(const std::string& value) m_value.b = (hex&0x0000ff)>>0; m_value.a = 255; } - else if(value.compare("none") == 0) + else if(Utils::skipDesc(ptr, "none", 4)) { m_colorType = ColorTypeNone; m_value.r = 0; @@ -239,7 +240,7 @@ void SVGColor::setValueAsString(const std::string& value) m_value.b = 0; m_value.a = 0; } - else if(value.compare("currentColor") == 0) + else if(Utils::skipDesc(ptr, "currentColor", 12)) { m_colorType = ColorTypeCurrentColor; m_value.r = 0; @@ -247,9 +248,8 @@ void SVGColor::setValueAsString(const std::string& value) m_value.b = 0; m_value.a = 255; } - else if(value.substr(0, 4).compare("rgb(") == 0) + else if(Utils::skipDesc(ptr, "rgb(", 4)) { - const char* ptr = value.c_str() + 4; double r, g, b; if(!Utils::skipWs(ptr) || !parseColorComponent(ptr, r) @@ -334,7 +334,7 @@ void SVGPaint::setValueAsString(const std::string& value) return; } - SVGColor::setValueAsString(ptr); + SVGColor::setValueAsString(value); } std::string SVGPaint::valueAsString() const diff --git a/source/properties/svgcolor.h b/source/svgcolor.h similarity index 100% rename from source/properties/svgcolor.h rename to source/svgcolor.h diff --git a/source/svgdefselement.cpp b/source/svgdefselement.cpp index 3cd80a0..0844306 100755 --- a/source/svgdefselement.cpp +++ b/source/svgdefselement.cpp @@ -16,7 +16,7 @@ SVGElementImpl* SVGDefsElement::clone(SVGDocument* document) const { SVGDefsElement* e = new SVGDefsElement(document); baseClone(*e); - return e; + return e; } } // namespace lunasvg diff --git a/source/svgdocumentimpl.cpp b/source/svgdocumentimpl.cpp index 875e894..aeebe08 100755 --- a/source/svgdocumentimpl.cpp +++ b/source/svgdocumentimpl.cpp @@ -171,12 +171,12 @@ SVGElementImpl* SVGDocumentImpl::copyElement(const SVGElementImpl* element, SVGE if(element->isSVGElementHead() && !Utils::isElementPermitted(parent->elementId(), element->elementId())) return nullptr; - SVGElementImpl* head = const_cast(element); - SVGElementImpl* tail; + const SVGElementImpl* head = element; + const SVGElementImpl* tail; if(element->isSVGElementHead()) tail = to(element)->tail; else - tail = const_cast(element); + tail = element; std::stack blocks; SVGElementImpl* start = head->clone(parent->document()); @@ -229,7 +229,7 @@ SVGElementImpl* SVGDocumentImpl::moveElement(SVGElementImpl* element, SVGElement if(element->isSVGElementHead()) tail = to(element)->tail; else - tail = const_cast(element); + tail = element; dispatchElementRemoveEvent(head, tail); @@ -368,16 +368,15 @@ void SVGDocumentImpl::freeElement(SVGElementImpl* head, SVGElementImpl* tail) std::string SVGDocumentImpl::toString(const SVGElementImpl* element) const { - std::string out; - std::uint32_t indent = 0; - - SVGElementImpl* head = const_cast(element); - SVGElementImpl* tail; + const SVGElementImpl* head = element; + const SVGElementImpl* tail; if(element->isSVGElementHead()) tail = to(element)->tail; else - tail = const_cast(element); + tail = element; + std::string out; + std::uint32_t indent = 0; head->externalise(out, indent); while(head != tail) { @@ -408,11 +407,11 @@ double SVGDocumentImpl::currentTime() const return 0.0; } -void SVGDocumentImpl::dispatchElementRemoveEvent(SVGElementImpl*, SVGElementImpl*) +void SVGDocumentImpl::dispatchElementRemoveEvent(const SVGElementImpl*, const SVGElementImpl*) { } -void SVGDocumentImpl::dispatchElementInsertEvent(SVGElementImpl*, SVGElementImpl*) +void SVGDocumentImpl::dispatchElementInsertEvent(const SVGElementImpl*, const SVGElementImpl*) { } diff --git a/source/svgdocumentimpl.h b/source/svgdocumentimpl.h index 3e86c02..5b1d5f0 100755 --- a/source/svgdocumentimpl.h +++ b/source/svgdocumentimpl.h @@ -26,13 +26,13 @@ class SVGDocumentImpl void updateIdCache(const std::string& oldValue, const std::string& newValue, SVGElementImpl* element); SVGElementImpl* resolveIRI(const std::string& href) const; SVGElementImpl* insertContent(const std::string& content, SVGElementImpl* target, InsertPosition position); - SVGElementImpl* copyElement(const SVGElementImpl* element, SVGElementImpl* target, InsertPosition); - SVGElementImpl* moveElement(SVGElementImpl* element, SVGElementImpl* target, InsertPosition); + SVGElementImpl* copyElement(const SVGElementImpl* element, SVGElementImpl* target, InsertPosition position); + SVGElementImpl* moveElement(SVGElementImpl* element, SVGElementImpl* target, InsertPosition position); void clearContent(SVGElementImpl* element); void removeElement(SVGElementImpl* element); void insertElement(SVGElementImpl* head, SVGElementImpl* tail, SVGElementImpl* target, InsertPosition position); void freeElement(SVGElementImpl* head, SVGElementImpl* tail); - std::string toString(const SVGElementImpl*) const; + std::string toString(const SVGElementImpl* element) const; bool hasAnimation() const; double animationDuration() const; bool setCurrentTime(double, bool); @@ -40,8 +40,8 @@ class SVGDocumentImpl SVGRootElement* rootElement() const { return m_rootElement; } private: - void dispatchElementRemoveEvent(SVGElementImpl*, SVGElementImpl*); - void dispatchElementInsertEvent(SVGElementImpl*, SVGElementImpl*); + void dispatchElementRemoveEvent(const SVGElementImpl*, const SVGElementImpl*); + void dispatchElementInsertEvent(const SVGElementImpl*, const SVGElementImpl*); private: SVGRootElement* m_rootElement; diff --git a/source/svgelementhead.cpp b/source/svgelementhead.cpp index bad9c9e..fc156a2 100755 --- a/source/svgelementhead.cpp +++ b/source/svgelementhead.cpp @@ -189,15 +189,6 @@ void SVGElementHead::renderTail(RenderContext&) const { } -DOMSVGPropertyBase* SVGElementHead::findAnimatedProperty(DOMPropertyID nameId) const -{ - for(unsigned i=0;ipropertyId()) - return m_properties[i]; - - return nullptr; -} - void SVGElementHead::addToPropertyMap(DOMSVGPropertyBase& property) { m_properties.push_back(&property); diff --git a/source/svgelementhead.h b/source/svgelementhead.h index bba9d26..6dfc79a 100755 --- a/source/svgelementhead.h +++ b/source/svgelementhead.h @@ -32,7 +32,6 @@ class SVGElementHead : public SVGElementImpl SVGElementTail* tail; - DOMSVGPropertyBase* findAnimatedProperty(DOMPropertyID nameId) const; void addToPropertyMap(DOMSVGPropertyBase& property); void updateId(const std::string& newValue); diff --git a/source/svgellipseelement.cpp b/source/svgellipseelement.cpp index 7b29766..ff022c3 100755 --- a/source/svgellipseelement.cpp +++ b/source/svgellipseelement.cpp @@ -51,7 +51,7 @@ SVGElementImpl* SVGEllipseElement::clone(SVGDocument* document) const { SVGEllipseElement* e = new SVGEllipseElement(document); baseClone(*e); - return e; + return e; } } // namespace lunasvg diff --git a/source/properties/svgenumeration.cpp b/source/svgenumeration.cpp similarity index 100% rename from source/properties/svgenumeration.cpp rename to source/svgenumeration.cpp diff --git a/source/properties/svgenumeration.h b/source/svgenumeration.h similarity index 100% rename from source/properties/svgenumeration.h rename to source/svgenumeration.h diff --git a/source/svggradientelement.cpp b/source/svggradientelement.cpp index 50b9de1..e2f1ae5 100755 --- a/source/svggradientelement.cpp +++ b/source/svggradientelement.cpp @@ -26,7 +26,7 @@ void SVGGradientElement::setGradientAttributes(GradientAttributes& attributes) c attributes.gradientUnits = m_gradientUnits.property(); if(attributes.gradientStops.empty()) { - SVGElementImpl* e = next; + const SVGElementImpl* e = next; while(e != tail) { if(e->elementId()==ElementIdStop) diff --git a/source/properties/svglength.cpp b/source/svglength.cpp similarity index 95% rename from source/properties/svglength.cpp rename to source/svglength.cpp index 8d868ea..d24f3f1 100755 --- a/source/properties/svglength.cpp +++ b/source/svglength.cpp @@ -217,7 +217,7 @@ std::string SVGLength::valueAsString() const break; } - return out; + return out; } SVGProperty* SVGLength::clone() const diff --git a/source/properties/svglength.h b/source/svglength.h similarity index 100% rename from source/properties/svglength.h rename to source/svglength.h diff --git a/source/properties/svglengthlist.cpp b/source/svglengthlist.cpp similarity index 100% rename from source/properties/svglengthlist.cpp rename to source/svglengthlist.cpp diff --git a/source/properties/svglengthlist.h b/source/svglengthlist.h similarity index 100% rename from source/properties/svglengthlist.h rename to source/svglengthlist.h diff --git a/source/svglineargradientelement.cpp b/source/svglineargradientelement.cpp index 78aecda..75f2382 100755 --- a/source/svglineargradientelement.cpp +++ b/source/svglineargradientelement.cpp @@ -101,7 +101,7 @@ SVGElementImpl* SVGLinearGradientElement::clone(SVGDocument* document) const { SVGLinearGradientElement* e = new SVGLinearGradientElement(document); baseClone(*e); - return e; + return e; } } // namespace lunasvg diff --git a/source/properties/svglistproperty.h b/source/svglistproperty.h similarity index 100% rename from source/properties/svglistproperty.h rename to source/svglistproperty.h diff --git a/source/properties/svgnumber.cpp b/source/svgnumber.cpp similarity index 100% rename from source/properties/svgnumber.cpp rename to source/svgnumber.cpp diff --git a/source/properties/svgnumber.h b/source/svgnumber.h similarity index 100% rename from source/properties/svgnumber.h rename to source/svgnumber.h diff --git a/source/properties/svgnumberlist.cpp b/source/svgnumberlist.cpp similarity index 100% rename from source/properties/svgnumberlist.cpp rename to source/svgnumberlist.cpp diff --git a/source/properties/svgnumberlist.h b/source/svgnumberlist.h similarity index 100% rename from source/properties/svgnumberlist.h rename to source/svgnumberlist.h diff --git a/source/svgparserutils.h b/source/svgparserutils.h index e1fc7e0..e041aa7 100755 --- a/source/svgparserutils.h +++ b/source/svgparserutils.h @@ -19,18 +19,15 @@ namespace Utils { inline const char* rtrim(const char* start, const char* end) { - if(start != end) - { - while((end-1)!=start && IS_WS(*(end-1))) - --end; - } + while(end > start && IS_WS(end[-1])) + --end; return end; } inline const char* ltrim(const char* start, const char* end) { - while(start!=end && IS_WS(*start)) + while(start < end && IS_WS(*start)) ++start; return start; @@ -118,6 +115,7 @@ inline bool parseInteger(const char*& ptr, T& integer, int base = 10) static const T intMax = std::numeric_limits::max(); static const bool isSigned = std::numeric_limits::is_signed; + using signed_t = typename std::make_signed::type; const T maxMultiplier = intMax / static_cast(base); if(*ptr && isSigned && *ptr == '-') @@ -148,7 +146,7 @@ inline bool parseInteger(const char*& ptr, T& integer, int base = 10) } if(isNegative) - integer = -static_cast::type>(value); + integer = -static_cast(value); else integer = value; diff --git a/source/properties/svgpath.cpp b/source/svgpath.cpp similarity index 96% rename from source/properties/svgpath.cpp rename to source/svgpath.cpp index 4f80740..9cf533c 100755 --- a/source/properties/svgpath.cpp +++ b/source/svgpath.cpp @@ -198,7 +198,7 @@ std::string SVGPath::valueAsString() const it.next(); } - return out; + return out; } SVGProperty* SVGPath::clone() const diff --git a/source/properties/svgpath.h b/source/svgpath.h similarity index 100% rename from source/properties/svgpath.h rename to source/svgpath.h diff --git a/source/svgpathelement.cpp b/source/svgpathelement.cpp index 56152a3..cedb11a 100755 --- a/source/svgpathelement.cpp +++ b/source/svgpathelement.cpp @@ -2,7 +2,7 @@ namespace lunasvg { -SVGPathElement::SVGPathElement(SVGDocument *document) : +SVGPathElement::SVGPathElement(SVGDocument* document) : SVGGeometryElement(ElementIdPath, document), m_d(DOMPropertyIdD) { diff --git a/source/svgpatternelement.cpp b/source/svgpatternelement.cpp index 739b7fb..9defde1 100644 --- a/source/svgpatternelement.cpp +++ b/source/svgpatternelement.cpp @@ -5,7 +5,7 @@ namespace lunasvg { -SVGPatternElement::SVGPatternElement(SVGDocument *document) : +SVGPatternElement::SVGPatternElement(SVGDocument* document) : SVGPaintElement(ElementIdPattern, document), SVGURIReference(this), SVGFitToViewBox(this), diff --git a/source/properties/svgpoint.cpp b/source/svgpoint.cpp similarity index 100% rename from source/properties/svgpoint.cpp rename to source/svgpoint.cpp diff --git a/source/properties/svgpoint.h b/source/svgpoint.h similarity index 100% rename from source/properties/svgpoint.h rename to source/svgpoint.h diff --git a/source/properties/svgpointlist.cpp b/source/svgpointlist.cpp similarity index 100% rename from source/properties/svgpointlist.cpp rename to source/svgpointlist.cpp diff --git a/source/properties/svgpointlist.h b/source/svgpointlist.h similarity index 100% rename from source/properties/svgpointlist.h rename to source/svgpointlist.h diff --git a/source/svgpolygonelement.cpp b/source/svgpolygonelement.cpp index 4a9f178..11d4fee 100755 --- a/source/svgpolygonelement.cpp +++ b/source/svgpolygonelement.cpp @@ -19,7 +19,7 @@ SVGElementImpl* SVGPolygonElement::clone(SVGDocument* document) const { SVGPolygonElement* e = new SVGPolygonElement(document); baseClone(*e); - return e; + return e; } } // namespace lunasvg diff --git a/source/svgpolylineelement.cpp b/source/svgpolylineelement.cpp index 62382e6..186cbba 100755 --- a/source/svgpolylineelement.cpp +++ b/source/svgpolylineelement.cpp @@ -18,7 +18,7 @@ SVGElementImpl* SVGPolylineElement::clone(SVGDocument* document) const { SVGPolylineElement* e = new SVGPolylineElement(document); baseClone(*e); - return e; + return e; } } // namespace lunasvg diff --git a/source/properties/svgpreserveaspectratio.cpp b/source/svgpreserveaspectratio.cpp similarity index 100% rename from source/properties/svgpreserveaspectratio.cpp rename to source/svgpreserveaspectratio.cpp diff --git a/source/properties/svgpreserveaspectratio.h b/source/svgpreserveaspectratio.h similarity index 100% rename from source/properties/svgpreserveaspectratio.h rename to source/svgpreserveaspectratio.h diff --git a/source/properties/svgproperty.cpp b/source/svgproperty.cpp similarity index 100% rename from source/properties/svgproperty.cpp rename to source/svgproperty.cpp diff --git a/source/properties/svgproperty.h b/source/svgproperty.h similarity index 100% rename from source/properties/svgproperty.h rename to source/svgproperty.h diff --git a/source/properties/svgpropertyutils.cpp b/source/svgpropertyutils.cpp similarity index 100% rename from source/properties/svgpropertyutils.cpp rename to source/svgpropertyutils.cpp diff --git a/source/properties/svgpropertyutils.h b/source/svgpropertyutils.h similarity index 100% rename from source/properties/svgpropertyutils.h rename to source/svgpropertyutils.h diff --git a/source/svgradialgradientelement.cpp b/source/svgradialgradientelement.cpp index 37bcbfb..3b68d78 100755 --- a/source/svgradialgradientelement.cpp +++ b/source/svgradialgradientelement.cpp @@ -109,7 +109,7 @@ SVGElementImpl* SVGRadialGradientElement::clone(SVGDocument* document) const { SVGRadialGradientElement* e = new SVGRadialGradientElement(document); baseClone(*e); - return e; + return e; } } // namespace lunasvg diff --git a/source/properties/svgrect.cpp b/source/svgrect.cpp similarity index 100% rename from source/properties/svgrect.cpp rename to source/svgrect.cpp diff --git a/source/properties/svgrect.h b/source/svgrect.h similarity index 100% rename from source/properties/svgrect.h rename to source/svgrect.h diff --git a/source/svgrectelement.cpp b/source/svgrectelement.cpp index 91e2410..8a54631 100755 --- a/source/svgrectelement.cpp +++ b/source/svgrectelement.cpp @@ -74,7 +74,7 @@ SVGElementImpl* SVGRectElement::clone(SVGDocument* document) const { SVGRectElement* e = new SVGRectElement(document); baseClone(*e); - return e; + return e; } } // namespace lunasvg diff --git a/source/svgsolidcolorelement.cpp b/source/svgsolidcolorelement.cpp index 7dcae7d..b154e6a 100644 --- a/source/svgsolidcolorelement.cpp +++ b/source/svgsolidcolorelement.cpp @@ -42,7 +42,7 @@ SVGElementImpl* SVGSolidColorElement::clone(SVGDocument* document) const { SVGSolidColorElement* e = new SVGSolidColorElement(document); baseClone(*e); - return e; + return e; } } // namespace lunasvg diff --git a/source/svgstopelement.cpp b/source/svgstopelement.cpp index 4b9f984..8247ede 100755 --- a/source/svgstopelement.cpp +++ b/source/svgstopelement.cpp @@ -54,7 +54,7 @@ SVGElementImpl* SVGStopElement::clone(SVGDocument* document) const { SVGStopElement* e = new SVGStopElement(document); baseClone(*e); - return e; + return e; } } // namespace lunasvg diff --git a/source/properties/svgstring.cpp b/source/svgstring.cpp similarity index 100% rename from source/properties/svgstring.cpp rename to source/svgstring.cpp diff --git a/source/properties/svgstring.h b/source/svgstring.h similarity index 100% rename from source/properties/svgstring.h rename to source/svgstring.h diff --git a/source/properties/svgstringlist.cpp b/source/svgstringlist.cpp similarity index 100% rename from source/properties/svgstringlist.cpp rename to source/svgstringlist.cpp diff --git a/source/properties/svgstringlist.h b/source/svgstringlist.h similarity index 100% rename from source/properties/svgstringlist.h rename to source/svgstringlist.h diff --git a/source/svgstyledelement.cpp b/source/svgstyledelement.cpp index f44290e..94a5776 100755 --- a/source/svgstyledelement.cpp +++ b/source/svgstyledelement.cpp @@ -75,7 +75,8 @@ void SVGStyledElement::render(RenderContext& context) const state.style.clear(CSSPropertyIdMask); } - if((!isSVGGeometryElement() && state.style.opacity() != 1.0) || state.style.mask() != KEmptyString || state.style.clipPath() != KEmptyString) + bool compositing = !isSVGGeometryElement() && state.style.opacity() != 1.0; + if(compositing || state.style.mask() != KEmptyString || state.style.clipPath() != KEmptyString) state.canvas.reset(state.canvas.width(), state.canvas.height()); if(const SVGProperty* property = state.style.get(CSSPropertyIdColor)) diff --git a/source/svgsvgelement.cpp b/source/svgsvgelement.cpp index 7be12b5..8ba7078 100755 --- a/source/svgsvgelement.cpp +++ b/source/svgsvgelement.cpp @@ -58,7 +58,7 @@ SVGElementImpl* SVGSVGElement::clone(SVGDocument* document) const { SVGSVGElement* e = new SVGSVGElement(document); baseClone(*e); - return e; + return e; } } // namespace lunasvg diff --git a/source/svgsymbolelement.cpp b/source/svgsymbolelement.cpp index 4138ffc..366fd7d 100755 --- a/source/svgsymbolelement.cpp +++ b/source/svgsymbolelement.cpp @@ -37,7 +37,7 @@ SVGElementImpl* SVGSymbolElement::clone(SVGDocument* document) const { SVGSymbolElement* e = new SVGSymbolElement(document); baseClone(*e); - return e; + return e; } } // namespace lunasvg diff --git a/source/properties/svgtransform.cpp b/source/svgtransform.cpp similarity index 95% rename from source/properties/svgtransform.cpp rename to source/svgtransform.cpp index a381c58..1782d11 100755 --- a/source/properties/svgtransform.cpp +++ b/source/svgtransform.cpp @@ -78,7 +78,7 @@ bool SVGTransform::parseTransform(const char*& ptr, TransformType& type, double* void SVGTransform::setValueAsString(const std::string& value) { - m_value.reset(); + m_value.makeIdentity(); if(value.empty()) return; diff --git a/source/properties/svgtransform.h b/source/svgtransform.h similarity index 100% rename from source/properties/svgtransform.h rename to source/svgtransform.h diff --git a/source/svguseelement.cpp b/source/svguseelement.cpp index 4c8987d..767aec5 100755 --- a/source/svguseelement.cpp +++ b/source/svguseelement.cpp @@ -72,7 +72,7 @@ SVGElementImpl* SVGUseElement::clone(SVGDocument* document) const { SVGUseElement* e = new SVGUseElement(document); baseClone(*e); - return e; + return e; } } // namespace lunasvg