mathematical 1.4.2 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +11 -21
- data/ext/mathematical/extconf.rb +21 -12
- data/ext/mathematical/lasem/Makefile +10 -10
- data/ext/mathematical/lasem/docs/Makefile +9 -9
- data/ext/mathematical/lasem/docs/reference/Makefile +9 -9
- data/ext/mathematical/lasem/docs/reference/lasem/Makefile +15 -9
- data/ext/mathematical/lasem/docs/reference/lasem/lasem-decl-list.txt +245 -0
- data/ext/mathematical/lasem/docs/reference/lasem/lasem-decl.txt +856 -0
- data/ext/mathematical/lasem/docs/reference/lasem/lasem-overrides.txt +0 -0
- data/ext/mathematical/lasem/itex2mml/Makefile +9 -9
- data/ext/mathematical/lasem/src/Makefile +34 -13
- data/ext/mathematical/lasem/src/lasemrender.c +13 -7
- data/ext/mathematical/lasem/src/lsmdomenumtypes.c +99 -0
- data/ext/mathematical/lasem/src/lsmdomenumtypes.h +26 -0
- data/ext/mathematical/lasem/src/lsmmathmlenums.c +24 -0
- data/ext/mathematical/lasem/src/lsmmathmlenums.h +12 -1
- data/ext/mathematical/lasem/src/lsmmathmlenumtypes.c +793 -0
- data/ext/mathematical/lasem/src/lsmmathmlenumtypes.h +96 -0
- data/ext/mathematical/lasem/src/lsmmathmlspaceelement.c +14 -0
- data/ext/mathematical/lasem/src/lsmmathmlspaceelement.h +1 -1
- data/ext/mathematical/lasem/src/lsmmathmltraits.c +24 -0
- data/ext/mathematical/lasem/src/lsmmathmltraits.h +1 -0
- data/ext/mathematical/lasem/src/lsmsvgattributes.h +50 -0
- data/ext/mathematical/lasem/src/lsmsvgdocument.c +18 -0
- data/ext/mathematical/lasem/src/lsmsvgenums.c +130 -0
- data/ext/mathematical/lasem/src/lsmsvgenums.h +59 -0
- data/ext/mathematical/lasem/src/lsmsvgenumtypes.c +1254 -0
- data/ext/mathematical/lasem/src/lsmsvgenumtypes.h +129 -0
- data/ext/mathematical/lasem/src/lsmsvgfiltercolormatrix.c +115 -0
- data/ext/mathematical/lasem/src/lsmsvgfiltercolormatrix.h +58 -0
- data/ext/mathematical/lasem/src/lsmsvgfilterconvolvematrix.c +206 -0
- data/ext/mathematical/lasem/src/lsmsvgfilterconvolvematrix.h +64 -0
- data/ext/mathematical/lasem/src/lsmsvgfilterdisplacementmap.c +124 -0
- data/ext/mathematical/lasem/src/lsmsvgfilterdisplacementmap.h +60 -0
- data/ext/mathematical/lasem/src/lsmsvgfilterimage.c +167 -0
- data/ext/mathematical/lasem/src/lsmsvgfilterimage.h +61 -0
- data/ext/mathematical/lasem/src/lsmsvgfiltermorphology.c +116 -0
- data/ext/mathematical/lasem/src/lsmsvgfiltermorphology.h +58 -0
- data/ext/mathematical/lasem/src/lsmsvgfilterspecularlighting.c +9 -2
- data/ext/mathematical/lasem/src/lsmsvgfiltersurface.c +1169 -87
- data/ext/mathematical/lasem/src/lsmsvgfiltersurface.h +28 -2
- data/ext/mathematical/lasem/src/lsmsvgfilterturbulence.c +142 -0
- data/ext/mathematical/lasem/src/lsmsvgfilterturbulence.h +61 -0
- data/ext/mathematical/lasem/src/lsmsvgtraits.c +249 -0
- data/ext/mathematical/lasem/src/lsmsvgtraits.h +18 -0
- data/ext/mathematical/lasem/src/lsmsvgtypes.h +6 -0
- data/ext/mathematical/lasem/src/lsmsvgview.c +267 -66
- data/ext/mathematical/lasem/src/lsmsvgview.h +23 -0
- data/ext/mathematical/lasem/src/lsmtraits.c +53 -1
- data/ext/mathematical/lasem/src/lsmtraits.h +2 -0
- data/ext/mathematical/lasem/tests/Makefile +26 -15
- data/ext/mathematical/lasem/tests/filter.c +152 -0
- data/ext/mathematical/lasem/tests/lsmtest.c +34 -30
- data/ext/mathematical/lasem/tests/suite.c +5 -2
- data/ext/mathematical/lib/libmtex2MML.a +0 -0
- data/ext/mathematical/mtex2MML/build/CMakeCache.txt +425 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/2.8.10.1/CMakeCCompiler.cmake +55 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/2.8.10.1/CMakeCXXCompiler.cmake +56 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/2.8.10.1/CMakeSystem.cmake +15 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/2.8.10.1/CompilerIdC/CMakeCCompilerId.c +393 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/CMakeDirectoryInformation.cmake +16 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/CMakeRuleHashes.txt +34 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/Continuous.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/Continuous.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousBuild.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousBuild.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousConfigure.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousConfigure.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousCoverage.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousCoverage.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousMemCheck.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousMemCheck.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousStart.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousStart.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousSubmit.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousSubmit.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousTest.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousTest.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousUpdate.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ContinuousUpdate.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/Experimental.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/Experimental.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalBuild.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalBuild.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalConfigure.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalConfigure.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalCoverage.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalCoverage.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalMemCheck.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalMemCheck.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalStart.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalStart.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalSubmit.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalSubmit.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalTest.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalTest.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalUpdate.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/ExperimentalUpdate.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/Makefile.cmake +95 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/Nightly.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/Nightly.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyBuild.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyBuild.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyConfigure.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyConfigure.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyCoverage.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyCoverage.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyMemCheck.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyMemCheck.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyMemoryCheck.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyMemoryCheck.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyStart.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyStart.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlySubmit.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlySubmit.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyTest.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyTest.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyUpdate.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/NightlyUpdate.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/TargetDirectories.txt +34 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/format.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/format.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/libmtex2MML.dir/DependInfo.cmake +44 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/libmtex2MML.dir/cmake_clean.cmake +19 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/libmtex2MML.dir/link.txt +1 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/libmtex2MML_static.dir/DependInfo.cmake +43 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/libmtex2MML_static.dir/cmake_clean.cmake +18 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/libmtex2MML_static.dir/cmake_clean_target.cmake +3 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/libmtex2MML_static.dir/link.txt +2 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/memcheck.dir/DependInfo.cmake +27 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/memcheck.dir/cmake_clean.cmake +8 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/mtex2MML.dir/DependInfo.cmake +44 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/mtex2MML.dir/cmake_clean.cmake +19 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/mtex2MML.dir/link.txt +1 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/mtex2MML_clar.dir/DependInfo.cmake +59 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/mtex2MML_clar.dir/cmake_clean.cmake +35 -0
- data/ext/mathematical/mtex2MML/build/CMakeFiles/mtex2MML_clar.dir/link.txt +1 -0
- data/ext/mathematical/mtex2MML/build/CTestTestfile.cmake +7 -0
- data/ext/mathematical/mtex2MML/build/Makefile +1332 -0
- data/ext/mathematical/mtex2MML/build/cmake_install.cmake +43 -0
- data/ext/mathematical/mtex2MML/build/lexer.c +8877 -0
- data/ext/mathematical/mtex2MML/build/libmtex2MML.a +0 -0
- data/ext/mathematical/mtex2MML/build/mtex2mml_export.h +35 -0
- data/ext/mathematical/mtex2MML/build/parser.c +10202 -0
- data/ext/mathematical/mtex2MML/build/parser.h +619 -0
- data/ext/mathematical/mtex2MML/src/mtex2MML.h +1 -1
- data/lib/mathematical/version.rb +1 -1
- metadata +115 -2
@@ -0,0 +1,152 @@
|
|
1
|
+
#include <glib.h>
|
2
|
+
#include <lsmsvgfiltersurface.h>
|
3
|
+
|
4
|
+
static void
|
5
|
+
surface (void)
|
6
|
+
{
|
7
|
+
LsmSvgFilterSurface *surface;
|
8
|
+
const LsmBox *subregion;
|
9
|
+
|
10
|
+
surface = lsm_svg_filter_surface_new ("test", 320, 200, NULL);
|
11
|
+
|
12
|
+
g_assert (surface != NULL);
|
13
|
+
g_assert_cmpstr (lsm_svg_filter_surface_get_name (surface), ==, "test");
|
14
|
+
|
15
|
+
subregion = lsm_svg_filter_surface_get_subregion (surface);
|
16
|
+
|
17
|
+
g_assert (subregion != NULL);
|
18
|
+
|
19
|
+
lsm_svg_filter_surface_ref (surface);
|
20
|
+
lsm_svg_filter_surface_unref (surface);
|
21
|
+
|
22
|
+
lsm_svg_filter_surface_unref (surface);
|
23
|
+
|
24
|
+
g_test_expect_message ("Lasem", G_LOG_LEVEL_CRITICAL, "*assertion*ref_count*failed");
|
25
|
+
|
26
|
+
lsm_svg_filter_surface_unref (surface);
|
27
|
+
|
28
|
+
g_test_assert_expected_messages ();
|
29
|
+
}
|
30
|
+
|
31
|
+
static void
|
32
|
+
similar (void)
|
33
|
+
{
|
34
|
+
LsmSvgFilterSurface *surface_a;
|
35
|
+
LsmSvgFilterSurface *surface_b;
|
36
|
+
|
37
|
+
surface_a = lsm_svg_filter_surface_new ("test_a", 320, 200, NULL);
|
38
|
+
surface_b = lsm_svg_filter_surface_new_similar ("test_b", surface_a, NULL);
|
39
|
+
|
40
|
+
g_assert_cmpstr (lsm_svg_filter_surface_get_name (surface_a), ==, "test_a");
|
41
|
+
g_assert_cmpstr (lsm_svg_filter_surface_get_name (surface_b), ==, "test_b");
|
42
|
+
|
43
|
+
lsm_svg_filter_surface_unref (surface_a);
|
44
|
+
lsm_svg_filter_surface_unref (surface_b);
|
45
|
+
}
|
46
|
+
|
47
|
+
static void
|
48
|
+
operations (LsmSvgFilterSurface *input_1, LsmSvgFilterSurface *input_2, LsmSvgFilterSurface *output)
|
49
|
+
{
|
50
|
+
cairo_matrix_t transform;
|
51
|
+
|
52
|
+
cairo_matrix_init_identity (&transform);
|
53
|
+
|
54
|
+
lsm_svg_filter_surface_alpha (input_1, output);
|
55
|
+
lsm_svg_filter_surface_blend (input_1, input_2, output, LSM_SVG_BLENDING_MODE_XOR);
|
56
|
+
lsm_svg_filter_surface_blur (input_1, output, 0.0, 0.0);
|
57
|
+
lsm_svg_filter_surface_blur (input_1, output, 1.0, 1.0);
|
58
|
+
lsm_svg_filter_surface_blur (input_1, output, 10.0, 10.0);
|
59
|
+
lsm_svg_filter_surface_blur (input_1, output, 1000.0, 1000.0);
|
60
|
+
lsm_svg_filter_surface_color_matrix (input_1, output, LSM_SVG_COLOR_FILTER_TYPE_HUE_ROTATE, 0, NULL);
|
61
|
+
lsm_svg_filter_surface_convolve_matrix (input_1, output, 0, 0, 0, NULL, 1.0, 0.0, 0, 0, LSM_SVG_EDGE_MODE_NONE, TRUE);
|
62
|
+
lsm_svg_filter_surface_displacement_map (input_1, input_2, output, 2.0, 2.0,
|
63
|
+
LSM_SVG_CHANNEL_SELECTOR_RED, LSM_SVG_CHANNEL_SELECTOR_GREEN);
|
64
|
+
lsm_svg_filter_surface_displacement_map (input_1, input_2, output, 2.0, 3.0,
|
65
|
+
LSM_SVG_CHANNEL_SELECTOR_BLUE, LSM_SVG_CHANNEL_SELECTOR_ALPHA);
|
66
|
+
lsm_svg_filter_surface_displacement_map (input_1, input_2, output, 0.0, 0.0,
|
67
|
+
LSM_SVG_CHANNEL_SELECTOR_ALPHA, LSM_SVG_CHANNEL_SELECTOR_ALPHA);
|
68
|
+
lsm_svg_filter_surface_flood (output, 1.0, 0.0, 0.5, 0.25);
|
69
|
+
lsm_svg_filter_surface_merge (input_1, output);
|
70
|
+
lsm_svg_filter_surface_morphology (input_1, output, LSM_SVG_MORPHOLOGY_OPERATOR_ERODE, 1, 1);
|
71
|
+
lsm_svg_filter_surface_morphology (input_1, output, LSM_SVG_MORPHOLOGY_OPERATOR_DILATE, 1, 1);
|
72
|
+
lsm_svg_filter_surface_offset (input_1, output, 10, 10);
|
73
|
+
lsm_svg_filter_surface_offset (input_1, output, -10, -10);
|
74
|
+
lsm_svg_filter_surface_offset (input_1, output, -1000, -1000);
|
75
|
+
lsm_svg_filter_surface_tile (input_1, output);
|
76
|
+
lsm_svg_filter_surface_turbulence (output, 10.0, 10.0, 2, 1.0, LSM_SVG_STITCH_TILES_STITCH, LSM_SVG_TURBULENCE_TYPE_FRACTAL_NOISE,
|
77
|
+
&transform);
|
78
|
+
}
|
79
|
+
|
80
|
+
static void
|
81
|
+
processing (void)
|
82
|
+
{
|
83
|
+
LsmSvgFilterSurface *input_1;
|
84
|
+
LsmSvgFilterSurface *input_2;
|
85
|
+
LsmSvgFilterSurface *output;
|
86
|
+
|
87
|
+
input_1 = lsm_svg_filter_surface_new ("input_1", 320, 200, NULL);
|
88
|
+
input_2 = lsm_svg_filter_surface_new_similar ("input_2", input_1, NULL);
|
89
|
+
output = lsm_svg_filter_surface_new_similar ("output", input_1, NULL);
|
90
|
+
|
91
|
+
operations (input_1, input_2, output);
|
92
|
+
|
93
|
+
lsm_svg_filter_surface_unref (input_1);
|
94
|
+
lsm_svg_filter_surface_unref (input_2);
|
95
|
+
lsm_svg_filter_surface_unref (output);
|
96
|
+
}
|
97
|
+
|
98
|
+
static void
|
99
|
+
processing_mismatch (void)
|
100
|
+
{
|
101
|
+
LsmSvgFilterSurface *input_1;
|
102
|
+
LsmSvgFilterSurface *input_2;
|
103
|
+
LsmSvgFilterSurface *output;
|
104
|
+
|
105
|
+
input_1 = lsm_svg_filter_surface_new ("input_1", 320, 200, NULL);
|
106
|
+
input_2 = lsm_svg_filter_surface_new ("input_2", 100, 10, NULL);
|
107
|
+
output = lsm_svg_filter_surface_new ("output", 10, 5, NULL);
|
108
|
+
|
109
|
+
operations (input_1, input_2, output);
|
110
|
+
|
111
|
+
lsm_svg_filter_surface_unref (input_1);
|
112
|
+
lsm_svg_filter_surface_unref (input_2);
|
113
|
+
lsm_svg_filter_surface_unref (output);
|
114
|
+
}
|
115
|
+
|
116
|
+
static void
|
117
|
+
processing_null (void)
|
118
|
+
{
|
119
|
+
unsigned int i;
|
120
|
+
|
121
|
+
for (i = 0; i < 20; i++)
|
122
|
+
g_test_expect_message ("Lasem", G_LOG_LEVEL_CRITICAL, "*assertion*NULL*failed");
|
123
|
+
|
124
|
+
operations (NULL, NULL, NULL);
|
125
|
+
|
126
|
+
for (i = 0; i < 20; i++)
|
127
|
+
g_test_assert_expected_messages ();
|
128
|
+
}
|
129
|
+
|
130
|
+
int
|
131
|
+
main (int argc, char *argv[])
|
132
|
+
{
|
133
|
+
int result;
|
134
|
+
|
135
|
+
g_test_init (&argc, &argv, NULL);
|
136
|
+
|
137
|
+
g_test_add_func ("/filter/surface", surface);
|
138
|
+
g_test_add_func ("/filter/similar", similar);
|
139
|
+
g_test_add_func ("/filter/processing", processing);
|
140
|
+
g_test_add_func ("/filter/processing_mismatch", processing_mismatch);
|
141
|
+
g_test_add_func ("/filter/processing_null", processing_null);
|
142
|
+
|
143
|
+
#if !GLIB_CHECK_VERSION(2,36,0)
|
144
|
+
g_type_init ();
|
145
|
+
#endif
|
146
|
+
|
147
|
+
result = g_test_run ();
|
148
|
+
|
149
|
+
lsm_shutdown ();
|
150
|
+
|
151
|
+
return result;
|
152
|
+
}
|
@@ -61,7 +61,7 @@ static gboolean option_debug_mask = FALSE;
|
|
61
61
|
static gboolean option_debug_group = FALSE;
|
62
62
|
static gboolean option_debug_text = FALSE;
|
63
63
|
static gboolean option_dry_run = FALSE;
|
64
|
-
static double option_compare_fuzz =
|
64
|
+
static double option_compare_fuzz = 10.0;
|
65
65
|
|
66
66
|
static const GOptionEntry entries[] =
|
67
67
|
{
|
@@ -246,7 +246,7 @@ compare_surfaces (const char *test_name, cairo_surface_t *surface_a, cairo_surfa
|
|
246
246
|
}
|
247
247
|
|
248
248
|
static void
|
249
|
-
lasem_test_render (char const *filename, gboolean compare, gboolean dry_run, Statistic *statistic)
|
249
|
+
lasem_test_render (char const *filename, gboolean compare, gboolean dry_run, gboolean save_png, Statistic *statistic)
|
250
250
|
{
|
251
251
|
LsmDomDocument *document;
|
252
252
|
LsmDomView *view;
|
@@ -341,7 +341,7 @@ lasem_test_render (char const *filename, gboolean compare, gboolean dry_run, Sta
|
|
341
341
|
statistic->rendered_count++;
|
342
342
|
g_timer_destroy (timer);
|
343
343
|
|
344
|
-
if (!dry_run)
|
344
|
+
if (!dry_run && save_png)
|
345
345
|
cairo_surface_write_to_png (surface, png_filename);
|
346
346
|
|
347
347
|
if (check) {
|
@@ -368,39 +368,41 @@ lasem_test_render (char const *filename, gboolean compare, gboolean dry_run, Sta
|
|
368
368
|
g_object_unref (view);
|
369
369
|
g_object_unref (document);
|
370
370
|
|
371
|
-
|
372
|
-
|
371
|
+
if (save_png) {
|
372
|
+
lasem_test_html ("<table border=\"1\" cellpadding=\"8\">\n");
|
373
|
+
lasem_test_html ("<tr>");
|
373
374
|
|
374
|
-
|
375
|
-
|
376
|
-
|
375
|
+
lasem_test_html ("<td><a href=\"%s\"><img border=\"0\" src=\"%s\"/></a></td>",
|
376
|
+
filename, png_filename);
|
377
|
+
lasem_test_html ("<td><img src=\"%s\"/></td>", reference_png_filename);
|
377
378
|
|
378
|
-
|
379
|
+
lasem_test_html ("<td>");
|
379
380
|
|
380
|
-
|
381
|
-
|
382
|
-
|
381
|
+
if (is_mathml) {
|
382
|
+
regex = g_regex_new ("<math>", 0, 0, &error);
|
383
|
+
assert (error == NULL);
|
383
384
|
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
385
|
+
filtered_buffer = g_regex_replace (regex, xml,
|
386
|
+
-1, 0,
|
387
|
+
"<math xmlns=\"http://www.w3.org/1998/Math/MathML\">",
|
388
|
+
0, NULL);
|
389
|
+
g_regex_unref (regex);
|
389
390
|
|
390
|
-
|
391
|
+
lasem_test_html ("%s", filtered_buffer);
|
391
392
|
|
392
|
-
|
393
|
-
|
393
|
+
g_free (filtered_buffer);
|
394
|
+
}
|
394
395
|
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
396
|
+
if (is_svg) {
|
397
|
+
lasem_test_html ("<object type=\"image/svg+xml\" data=\"");
|
398
|
+
lasem_test_html ("%s", filename);
|
399
|
+
lasem_test_html ("\" width=\"%dpx\"/>", width + 2);
|
400
|
+
}
|
400
401
|
|
401
|
-
|
402
|
-
|
403
|
-
|
402
|
+
lasem_test_html ("</td>");
|
403
|
+
lasem_test_html ("</tr>\n");
|
404
|
+
lasem_test_html ("</table>\n");
|
405
|
+
}
|
404
406
|
|
405
407
|
if (!is_xml && !g_file_test (reference_png_filename, G_FILE_TEST_IS_REGULAR) && !dry_run) {
|
406
408
|
FILE *file;
|
@@ -476,13 +478,15 @@ lasem_test_process_dir (const char *name, gboolean compare, gboolean dry_run, St
|
|
476
478
|
strstr (entry, "ignore-") != entry &&
|
477
479
|
strcmp (entry, "images") != 0)
|
478
480
|
{
|
481
|
+
gboolean save_png = strstr (entry, "dont-render-") != entry;
|
482
|
+
|
479
483
|
filename = g_build_filename (name, entry, NULL);
|
480
484
|
|
481
485
|
if (g_file_test (filename, G_FILE_TEST_IS_DIR))
|
482
486
|
lasem_test_process_dir (filename, compare, dry_run, statistic);
|
483
487
|
else if (g_file_test (filename, G_FILE_TEST_IS_REGULAR) &&
|
484
488
|
g_regex_match (regex_mml, filename, 0, NULL)) {
|
485
|
-
lasem_test_render (filename, compare, dry_run, statistic);
|
489
|
+
lasem_test_render (filename, compare, dry_run, save_png, statistic);
|
486
490
|
n_files++;
|
487
491
|
}
|
488
492
|
|
@@ -570,7 +574,7 @@ main (int argc, char **argv)
|
|
570
574
|
else {
|
571
575
|
if (n_input_files > 0)
|
572
576
|
for (i = 0; i < n_input_files; i++)
|
573
|
-
lasem_test_render (option_input_filenames[i], TRUE, option_dry_run, &statistic);
|
577
|
+
lasem_test_render (option_input_filenames[i], TRUE, option_dry_run, TRUE, &statistic);
|
574
578
|
else
|
575
579
|
lasem_test_process_dir (".", TRUE, option_dry_run, &statistic);
|
576
580
|
}
|
@@ -32,7 +32,8 @@ build_file_list (const char *path, GRegex *filename_regex)
|
|
32
32
|
if (g_file_test (filename, G_FILE_TEST_IS_DIR))
|
33
33
|
files = g_slist_concat (files, build_file_list (filename, filename_regex));
|
34
34
|
else if (g_file_test (filename, G_FILE_TEST_IS_REGULAR) &&
|
35
|
-
g_regex_match (filename_regex, filename, 0, NULL)
|
35
|
+
g_regex_match (filename_regex, filename, 0, NULL) &&
|
36
|
+
!g_key_file_get_boolean (suite_options, entry, "ignore", NULL)) {
|
36
37
|
files = g_slist_prepend (files, g_strdup (filename));
|
37
38
|
}
|
38
39
|
|
@@ -84,8 +85,10 @@ render_test (gconstpointer user_data)
|
|
84
85
|
|
85
86
|
if (cairo_status (cairo) != CAIRO_STATUS_SUCCESS) {
|
86
87
|
g_test_message ("cairo_status = %s", cairo_status_to_string (cairo_status (cairo)));
|
87
|
-
if (!g_key_file_get_boolean (suite_options, basename, "ignore-cairo-status", NULL))
|
88
|
+
if (!g_key_file_get_boolean (suite_options, basename, "ignore-cairo-status", NULL)) {
|
89
|
+
g_test_message ("incorrect cairo status");
|
88
90
|
g_test_fail ();
|
91
|
+
}
|
89
92
|
}
|
90
93
|
}
|
91
94
|
|
Binary file
|