diff --git a/src/OT/Color/COLR/COLR.hh b/src/OT/Color/COLR/COLR.hh index 4f250a9d1..3e7d8091c 100644 --- a/src/OT/Color/COLR/COLR.hh +++ b/src/OT/Color/COLR/COLR.hh @@ -1516,10 +1516,12 @@ struct PaintComposite void paint_glyph (hb_paint_context_t *c) const { TRACE_PAINT (this); + c->funcs->push_group (c->data); c->recurse (this+backdrop); c->funcs->push_group (c->data); c->recurse (this+src); c->funcs->pop_group (c->data, (hb_paint_composite_mode_t) (int) mode); + c->funcs->pop_group (c->data, HB_PAINT_COMPOSITE_MODE_SRC_OVER); } HBUINT8 format; /* format = 32 */ @@ -2802,9 +2804,7 @@ void PaintColrLayers::paint_glyph (hb_paint_context_t *c) const return; const Paint &paint = paint_offset_lists.get_paint (i); - c->funcs->push_group (c->data); c->recurse (paint); - c->funcs->pop_group (c->data, HB_PAINT_COMPOSITE_MODE_SRC_OVER); } } diff --git a/src/hb-ft-colr.hh b/src/hb-ft-colr.hh index 792efe383..22ae26f9a 100644 --- a/src/hb-ft-colr.hh +++ b/src/hb-ft-colr.hh @@ -231,9 +231,7 @@ _hb_ft_paint (hb_ft_paint_context_t *c, if (unlikely (!node.visit ((uintptr_t) other_paint.p))) continue; - c->funcs->push_group (c->data); c->recurse (other_paint); - c->funcs->pop_group (c->data, HB_PAINT_COMPOSITE_MODE_SRC_OVER); } } break; @@ -453,10 +451,12 @@ _hb_ft_paint (hb_ft_paint_context_t *c, break; case FT_COLR_PAINTFORMAT_COMPOSITE: { + c->funcs->push_group (c->data); c->recurse (paint.u.composite.backdrop_paint); c->funcs->push_group (c->data); c->recurse (paint.u.composite.source_paint); c->funcs->pop_group (c->data, _hb_ft_paint_composite_mode (paint.u.composite.composite_mode)); + c->funcs->pop_group (c->data, HB_PAINT_COMPOSITE_MODE_SRC_OVER); } break; diff --git a/test/api/data-paint/README b/test/api/data-paint/README new file mode 100644 index 000000000..60d6cef88 --- /dev/null +++ b/test/api/data-paint/README @@ -0,0 +1,7 @@ +Imported from https://roettsch.es/var_colrv1.html + +To be tested with +https://github.com/googlefonts/color-fonts/blob/main/fonts/noto-glyf_colr_1.ttf + +See description of each glyph in: +https://github.com/googlefonts/color-fonts/blob/main/glyph_descriptions.md diff --git a/test/api/data-paint/clipbox.test b/test/api/data-paint/clipbox.test new file mode 100644 index 000000000..32a127bc5 --- /dev/null +++ b/test/api/data-paint/clipbox.test @@ -0,0 +1 @@ +󰰀​󰰁​󰰂​󰰃​󰰄 diff --git a/test/api/data-paint/color_circles_palette.test b/test/api/data-paint/color_circles_palette.test new file mode 100644 index 000000000..0ae7d0508 --- /dev/null +++ b/test/api/data-paint/color_circles_palette.test @@ -0,0 +1 @@ +󰸀​󰸁 diff --git a/test/api/data-paint/composite_mode.test b/test/api/data-paint/composite_mode.test new file mode 100644 index 000000000..37daf981c --- /dev/null +++ b/test/api/data-paint/composite_mode.test @@ -0,0 +1 @@ +󰨀​󰨁​󰨂​󰨃​󰨄​󰨅​󰨆​󰨇​󰨈​󰨉​󰨊​󰨋​󰨌​󰨍​󰨎​󰨏​󰨐​󰨑​󰨒​󰨓​󰨔​󰨕​󰨖​󰨗​󰨘​󰨙​󰨚​󰨛 diff --git a/test/api/data-paint/extend_mode.test b/test/api/data-paint/extend_mode.test new file mode 100644 index 000000000..f7c5346c5 --- /dev/null +++ b/test/api/data-paint/extend_mode.test @@ -0,0 +1 @@ +󰔀​󰔁​󰔂​󰔃​󰔄​󰔅​󰔆​󰔇​󰔈 diff --git a/test/api/data-paint/foreground_color.test b/test/api/data-paint/foreground_color.test new file mode 100644 index 000000000..f4aa1e421 --- /dev/null +++ b/test/api/data-paint/foreground_color.test @@ -0,0 +1 @@ +󰬀​󰬁​󰬂​󰬃​󰬄​󰬅​󰬆​󰬇 diff --git a/test/api/data-paint/gradient_p2_skewed.test b/test/api/data-paint/gradient_p2_skewed.test new file mode 100644 index 000000000..ca528d0a5 --- /dev/null +++ b/test/api/data-paint/gradient_p2_skewed.test @@ -0,0 +1 @@ +󰴀 diff --git a/test/api/data-paint/paint_rotate.test b/test/api/data-paint/paint_rotate.test new file mode 100644 index 000000000..002a3701e --- /dev/null +++ b/test/api/data-paint/paint_rotate.test @@ -0,0 +1 @@ +󰘀​󰘁​󰘂​󰘃 diff --git a/test/api/data-paint/paint_scale.test b/test/api/data-paint/paint_scale.test new file mode 100644 index 000000000..b00bdf027 --- /dev/null +++ b/test/api/data-paint/paint_scale.test @@ -0,0 +1 @@ +󰌀​󰌁​󰌂​󰌃​󰌄​󰌅 diff --git a/test/api/data-paint/paint_skew.test b/test/api/data-paint/paint_skew.test new file mode 100644 index 000000000..0ff07962f --- /dev/null +++ b/test/api/data-paint/paint_skew.test @@ -0,0 +1 @@ +󰜀​󰜁​󰜂​󰜃​󰜄​󰜅 diff --git a/test/api/data-paint/paint_transform.test b/test/api/data-paint/paint_transform.test new file mode 100644 index 000000000..a66ab4f27 --- /dev/null +++ b/test/api/data-paint/paint_transform.test @@ -0,0 +1 @@ +󰠀​󰠁​󰠂​󰠃 diff --git a/test/api/data-paint/paint_translate.test b/test/api/data-paint/paint_translate.test new file mode 100644 index 000000000..faa1fedc9 --- /dev/null +++ b/test/api/data-paint/paint_translate.test @@ -0,0 +1 @@ +󰤀​󰤁​󰤂​󰤃​󰤄​󰤅​󰤆 diff --git a/test/api/data-paint/sweep_varsweep.test b/test/api/data-paint/sweep_varsweep.test new file mode 100644 index 000000000..dc6b166c2 --- /dev/null +++ b/test/api/data-paint/sweep_varsweep.test @@ -0,0 +1 @@ +󰈀​󰈁​󰈂​󰈃​󰈄​󰈅​󰈆​󰈇​󰈈​󰈉​󰈊​󰈋​󰈌​󰈍​󰈎​󰈏​󰈐​󰈑​󰈒​󰈓​󰈔​󰈕​󰈖​󰈗​󰈘​󰈙​󰈚​󰈛​󰈜​󰈝​󰈞​󰈟​󰈠​󰈡​󰈢​󰈣​󰈤​󰈥​󰈦​󰈧​󰈨​󰈩​󰈪​󰈫​󰈬​󰈭​󰈮​󰈯​󰈰​󰈱​󰈲​󰈳​󰈴​󰈵​󰈶​󰈷​󰈸​󰈹​󰈺​󰈻​󰈼​󰈽​󰈾​󰈿​󰉀​󰉁​󰉂​󰉃​󰉄​󰉅​󰉆​󰉇 diff --git a/test/api/data-paint/variable_alpha.test b/test/api/data-paint/variable_alpha.test new file mode 100644 index 000000000..f61150392 --- /dev/null +++ b/test/api/data-paint/variable_alpha.test @@ -0,0 +1 @@ +󱀀 diff --git a/test/api/results-paint/bad-154 b/test/api/results-paint/bad-154 new file mode 100644 index 000000000..6b90a3953 --- /dev/null +++ b/test/api/results-paint/bad-154 @@ -0,0 +1,15 @@ +start clip rectangle 0 500 500 1e+03 + start transform 1 0 0 1 0 0 + push group + push group + start transform 1 0 -0 1 0 0 + start clip glyph 159 + start transform 1 0 0 1 0 0 + solid 128 128 128 102 + end transform + end clip + end transform + pop group mode 3 + pop group mode 3 + end transform +end clip diff --git a/test/api/results-paint/hand-10 b/test/api/results-paint/hand-10 new file mode 100644 index 000000000..742120104 --- /dev/null +++ b/test/api/results-paint/hand-10 @@ -0,0 +1,97 @@ +start clip rectangle 64 -224 1.22e+03 928 + start transform 1 0 0 1 0 0 + start transform 1 0 -0 1 0 0 + start clip glyph 13 + start transform 1 0 0 1 0 0 + start transform 1 0 0 0.977 0 0 + radial gradient + p0 280 440 radius 0 + p1 280 440 radius 467 + colors 0 + 0 186 141 104 255 + 0.449 183 138 103 255 + 0.809 173 130 100 255 + 1 164 123 98 255 + end transform + end transform + end clip + end transform + start transform 1 0 -0 1 0 0 + start clip glyph 14 + start transform 1 0 0 1 0 0 + linear gradient + p0 231 -27 + p1 1.02e+03 -27 + p2 231 -815 + colors 0 + 0 164 123 98 255 + 1 164 123 98 255 + end transform + end clip + end transform + start transform 1 0 -0 1 0 0 + start clip glyph 15 + start transform 1 0 0 1 0 0 + solid 145 103 77 255 + end transform + end clip + end transform + start transform 1 0 -0 1 0 0 + start clip glyph 16 + start transform 1 0 0 1 0 0 + solid 30 136 229 255 + end transform + end clip + end transform + start transform 1 0 -0 1 0 0 + start clip glyph 21 + start transform 1 0 0 1 0 0 + solid 145 103 77 255 + end transform + end clip + end transform + start transform 1 0 -0 1 0 0 + start clip glyph 16 + start transform 1 0 0 1 0 0 + linear gradient + p0 669 776 + p1 180 -106 + p2 -212 1.26e+03 + colors 0 + 0 100 181 246 255 + 1 33 150 243 255 + end transform + end clip + end transform + start transform 1 0 -0 1 0 0 + start clip glyph 18 + start transform 1 0 0 1 0 0 + solid 66 66 66 51 + end transform + end clip + end transform + start transform 1 0 -0 1 0 0 + start clip glyph 19 + start transform 1 0 0 1 0 0 + start transform 1 0 0 0.969 0 0 + radial gradient + p0 588 198 radius 0 + p1 588 198 radius 342 + colors 0 + 0 186 141 104 255 + 0.449 183 138 103 255 + 0.809 173 130 100 255 + 1 164 123 98 255 + end transform + end transform + end clip + end transform + start transform 1 0 -0 1 0 0 + start clip glyph 20 + start transform 1 0 0 1 0 0 + solid 145 103 77 255 + end transform + end clip + end transform + end transform +end clip diff --git a/test/api/results-paint/hand-10.2 b/test/api/results-paint/hand-10.2 new file mode 100644 index 000000000..ceeee5e8c --- /dev/null +++ b/test/api/results-paint/hand-10.2 @@ -0,0 +1,97 @@ +start clip rectangle 19 -224 1.4e+03 928 + start transform 1 0 0.2 1 0 0 + start transform 1 0 -0.2 1 0 0 + start clip glyph 13 + start transform 1 0 0.2 1 0 0 + start transform 1 0 0 0.977 0 0 + radial gradient + p0 280 440 radius 0 + p1 280 440 radius 467 + colors 0 + 0 186 141 104 255 + 0.449 183 138 103 255 + 0.809 173 130 100 255 + 1 164 123 98 255 + end transform + end transform + end clip + end transform + start transform 1 0 -0.2 1 0 0 + start clip glyph 14 + start transform 1 0 0.2 1 0 0 + linear gradient + p0 231 -27 + p1 1.02e+03 -27 + p2 231 -815 + colors 0 + 0 164 123 98 255 + 1 164 123 98 255 + end transform + end clip + end transform + start transform 1 0 -0.2 1 0 0 + start clip glyph 15 + start transform 1 0 0.2 1 0 0 + solid 145 103 77 255 + end transform + end clip + end transform + start transform 1 0 -0.2 1 0 0 + start clip glyph 16 + start transform 1 0 0.2 1 0 0 + solid 30 136 229 255 + end transform + end clip + end transform + start transform 1 0 -0.2 1 0 0 + start clip glyph 21 + start transform 1 0 0.2 1 0 0 + solid 145 103 77 255 + end transform + end clip + end transform + start transform 1 0 -0.2 1 0 0 + start clip glyph 16 + start transform 1 0 0.2 1 0 0 + linear gradient + p0 669 776 + p1 180 -106 + p2 -212 1.26e+03 + colors 0 + 0 100 181 246 255 + 1 33 150 243 255 + end transform + end clip + end transform + start transform 1 0 -0.2 1 0 0 + start clip glyph 18 + start transform 1 0 0.2 1 0 0 + solid 66 66 66 51 + end transform + end clip + end transform + start transform 1 0 -0.2 1 0 0 + start clip glyph 19 + start transform 1 0 0.2 1 0 0 + start transform 1 0 0 0.969 0 0 + radial gradient + p0 588 198 radius 0 + p1 588 198 radius 342 + colors 0 + 0 186 141 104 255 + 0.449 183 138 103 255 + 0.809 173 130 100 255 + 1 164 123 98 255 + end transform + end transform + end clip + end transform + start transform 1 0 -0.2 1 0 0 + start clip glyph 20 + start transform 1 0 0.2 1 0 0 + solid 145 103 77 255 + end transform + end clip + end transform + end transform +end clip diff --git a/test/api/results/rocher-1 b/test/api/results-paint/rocher-1 similarity index 63% rename from test/api/results/rocher-1 rename to test/api/results-paint/rocher-1 index bcd871ff0..9cb0e66e6 100644 --- a/test/api/results/rocher-1 +++ b/test/api/results-paint/rocher-1 @@ -1,7 +1,3 @@ -# random seed: R02Sbe08283e5db998c0ef8db485be24c9ce -# Start of hb tests -# Start of paint tests -# Start of ot tests start clip glyph 8 solid 81 61 50 255 end clip diff --git a/test/api/results/rocher-2 b/test/api/results-paint/rocher-2 similarity index 64% rename from test/api/results/rocher-2 rename to test/api/results-paint/rocher-2 index 0b840ab3b..d26bb572b 100644 --- a/test/api/results/rocher-2 +++ b/test/api/results-paint/rocher-2 @@ -1,7 +1,3 @@ -# random seed: R02S44e738ad8b5a9b0616dbb5ed381f9fd9 -# Start of hb tests -# Start of paint tests -# Start of ot tests start clip glyph 12 solid 81 61 50 255 end clip diff --git a/test/api/results/rocher-3 b/test/api/results-paint/rocher-3 similarity index 64% rename from test/api/results/rocher-3 rename to test/api/results-paint/rocher-3 index 7d1e1d10b..326fdc4f9 100644 --- a/test/api/results/rocher-3 +++ b/test/api/results-paint/rocher-3 @@ -1,7 +1,3 @@ -# random seed: R02Sf5cb8d4e67af171b27fea99802b3c8e6 -# Start of hb tests -# Start of paint tests -# Start of ot tests start clip glyph 16 solid 81 61 50 255 end clip diff --git a/test/api/results-paint/test-02 b/test/api/results-paint/test-02 new file mode 100644 index 000000000..cb74ffef9 --- /dev/null +++ b/test/api/results-paint/test-02 @@ -0,0 +1,9 @@ +TAP version 14 +# random seed: R02S9d61dc15f8b01010ba25e1b3a743218d +# Start of hb tests +# Start of paint tests +# Start of ot tests +# End of ot tests +# End of paint tests +# End of hb tests +1..0 diff --git a/test/api/results/test-10 b/test/api/results-paint/test-10 similarity index 80% rename from test/api/results/test-10 rename to test/api/results-paint/test-10 index 78d3e233a..f67f70c72 100644 --- a/test/api/results/test-10 +++ b/test/api/results-paint/test-10 @@ -1,7 +1,3 @@ -# random seed: R02S730db577e65f80492e3e3eacc21152fa -# Start of hb tests -# Start of paint tests -# Start of ot tests start clip rectangle 0 0 1e+03 1e+03 start transform 1 0 0 1 0 0 start transform 1 0 -0 1 0 0 diff --git a/test/api/results-paint/test-106 b/test/api/results-paint/test-106 new file mode 100644 index 000000000..688fd2d4b --- /dev/null +++ b/test/api/results-paint/test-106 @@ -0,0 +1,28 @@ +start clip rectangle 118 -22.9 750 750 + start transform 1 0 0 1 0 0 + push group + start transform 1 0 -0 1 0 0 + start clip glyph 3 + start transform 1 0 0 1 0 0 + solid 0 0 255 127 + end transform + end clip + end transform + push group + start transform 1 0 0 1 1e+03 1e+03 + start transform 1 0.364 0.176 1 0 0 + start transform 1 0 0 1 -1e+03 -1e+03 + start transform 1 0 -0 1 0 0 + start clip glyph 3 + start transform 1 0 0 1 0 0 + solid 255 165 0 178 + end transform + end clip + end transform + end transform + end transform + end transform + pop group mode 4 + pop group mode 3 + end transform +end clip diff --git a/test/api/results-paint/test-116 b/test/api/results-paint/test-116 new file mode 100644 index 000000000..930e00232 --- /dev/null +++ b/test/api/results-paint/test-116 @@ -0,0 +1,24 @@ +start clip rectangle 250 250 950 950 + start transform 1 0 0 1 0 0 + push group + start transform 1 0 -0 1 0 0 + start clip glyph 3 + start transform 1 0 0 1 0 0 + solid 0 0 255 127 + end transform + end clip + end transform + push group + start transform 1 0 0 1 200 200 + start transform 1 0 -0 1 0 0 + start clip glyph 3 + start transform 1 0 0 1 0 0 + solid 255 165 0 178 + end transform + end clip + end transform + end transform + pop group mode 4 + pop group mode 3 + end transform +end clip diff --git a/test/api/results/test-123 b/test/api/results-paint/test-123 similarity index 75% rename from test/api/results/test-123 rename to test/api/results-paint/test-123 index 21f24115c..cb7b96e8b 100644 --- a/test/api/results/test-123 +++ b/test/api/results-paint/test-123 @@ -1,18 +1,12 @@ -# random seed: R02Sa683270814db638bd7dc3f8fc211d03f -# Start of hb tests -# Start of paint tests -# Start of ot tests start clip rectangle 0 0 1e+03 1e+03 start transform 1 0 0 1 0 0 - push group - start transform 1 0 -0 1 0 0 - start clip glyph 3 - start transform 1 0 0 1 0 0 - solid 0 0 0 255 - end transform - end clip - end transform - pop group mode 3 + start transform 1 0 -0 1 0 0 + start clip glyph 3 + start transform 1 0 0 1 0 0 + solid 0 0 0 255 + end transform + end clip + end transform push group start transform 1 0 0 1 333 667 start transform 0.5 0 0 0.5 0 0 diff --git a/test/api/results-paint/test-154 b/test/api/results-paint/test-154 new file mode 100644 index 000000000..6b50a9475 --- /dev/null +++ b/test/api/results-paint/test-154 @@ -0,0 +1,38 @@ +start clip rectangle 0 500 500 1e+03 + start transform 1 0 0 1 0 0 + push group + start transform 1 0 -0 1 0 0 + paint color glyph 164; acting as failed + end transform + start clip rectangle 100 100 900 900 + start transform 1 0 -0 1 0 0 + paint color glyph 93; acting as failed + end transform + start clip rectangle 0 0 1e+03 1e+03 + start transform 1 0 -0 1 0 0 + start clip glyph 2 + start transform 1 0 0 1 0 0 + radial gradient + p0 166 768 radius 0 + p1 166 768 radius 256 + colors 2 + 0 0 128 0 255 + 0.5 255 255 255 255 + 1 255 0 0 255 + end transform + end clip + end transform + end clip + end clip + push group + start transform 1 0 -0 1 0 0 + start clip glyph 159 + start transform 1 0 0 1 0 0 + solid 128 128 128 102 + end transform + end clip + end transform + pop group mode 3 + pop group mode 3 + end transform +end clip diff --git a/test/api/results/test-165 b/test/api/results-paint/test-165 similarity index 79% rename from test/api/results/test-165 rename to test/api/results-paint/test-165 index b122f667b..24bf7543f 100644 --- a/test/api/results/test-165 +++ b/test/api/results-paint/test-165 @@ -1,7 +1,3 @@ -# random seed: R02Sd7e42dc5034eae428f9fdf486603e319 -# Start of hb tests -# Start of paint tests -# Start of ot tests start clip rectangle 100 250 1.2e+03 950 start transform 1 0 0 1 0 0 start transform 1 0 -0 1 0 0 diff --git a/test/api/results-paint/test-175 b/test/api/results-paint/test-175 new file mode 100644 index 000000000..a0d7c8152 --- /dev/null +++ b/test/api/results-paint/test-175 @@ -0,0 +1,28 @@ +start clip rectangle 0 0 1e+03 1e+03 + start transform 1 0 0 1 0 0 + start transform 1 0 0 1 150 0 + start transform 1 0 -0 1 0 0 + start clip glyph 174 + start transform 1 0 0 1 0 0 + solid 0 128 0 255 + end transform + end clip + end transform + end transform + start transform 1 0 0 1 -150 0 + start transform 1 0 -0 1 0 0 + start clip glyph 174 + start transform 1 0 0 1 0 0 + linear gradient + p0 500 250 + p1 500 950 + p2 600 250 + colors 1 + 0 255 0 0 255 + 1 0 0 255 255 + end transform + end clip + end transform + end transform + end transform +end clip diff --git a/test/api/results/test-6 b/test/api/results-paint/test-6 similarity index 78% rename from test/api/results/test-6 rename to test/api/results-paint/test-6 index 94b543ec5..ff4ae4f67 100644 --- a/test/api/results/test-6 +++ b/test/api/results-paint/test-6 @@ -1,7 +1,3 @@ -# random seed: R02S68886e711ff0007004bb488f8b8c3904 -# Start of hb tests -# Start of paint tests -# Start of ot tests start clip rectangle 100 250 900 950 start transform 1 0 0 1 0 0 start transform 1 0 -0 1 0 0 diff --git a/test/api/results/test-92 b/test/api/results-paint/test-92 similarity index 79% rename from test/api/results/test-92 rename to test/api/results-paint/test-92 index 422e9171e..0e2548189 100644 --- a/test/api/results/test-92 +++ b/test/api/results-paint/test-92 @@ -1,7 +1,3 @@ -# random seed: R02Se8a9546dc34a7e4d4f5c5e997ddcf0d8 -# Start of hb tests -# Start of paint tests -# Start of ot tests start clip rectangle 0 0 1e+03 1e+03 start transform 1 0 0 1 0 0 start transform 1 0 -0 1 0 0 diff --git a/test/api/results/testvf-10 b/test/api/results-paint/testvf-10 similarity index 80% rename from test/api/results/testvf-10 rename to test/api/results-paint/testvf-10 index 9b399db29..f67f70c72 100644 --- a/test/api/results/testvf-10 +++ b/test/api/results-paint/testvf-10 @@ -1,7 +1,3 @@ -# random seed: R02S4cc6a292019f2eefbbaf24127cc6b053 -# Start of hb tests -# Start of paint tests -# Start of ot tests start clip rectangle 0 0 1e+03 1e+03 start transform 1 0 0 1 0 0 start transform 1 0 -0 1 0 0 diff --git a/test/api/results-paint/testvf-106 b/test/api/results-paint/testvf-106 new file mode 100644 index 000000000..688fd2d4b --- /dev/null +++ b/test/api/results-paint/testvf-106 @@ -0,0 +1,28 @@ +start clip rectangle 118 -22.9 750 750 + start transform 1 0 0 1 0 0 + push group + start transform 1 0 -0 1 0 0 + start clip glyph 3 + start transform 1 0 0 1 0 0 + solid 0 0 255 127 + end transform + end clip + end transform + push group + start transform 1 0 0 1 1e+03 1e+03 + start transform 1 0.364 0.176 1 0 0 + start transform 1 0 0 1 -1e+03 -1e+03 + start transform 1 0 -0 1 0 0 + start clip glyph 3 + start transform 1 0 0 1 0 0 + solid 255 165 0 178 + end transform + end clip + end transform + end transform + end transform + end transform + pop group mode 4 + pop group mode 3 + end transform +end clip diff --git a/test/api/results-paint/testvf-116 b/test/api/results-paint/testvf-116 new file mode 100644 index 000000000..930e00232 --- /dev/null +++ b/test/api/results-paint/testvf-116 @@ -0,0 +1,24 @@ +start clip rectangle 250 250 950 950 + start transform 1 0 0 1 0 0 + push group + start transform 1 0 -0 1 0 0 + start clip glyph 3 + start transform 1 0 0 1 0 0 + solid 0 0 255 127 + end transform + end clip + end transform + push group + start transform 1 0 0 1 200 200 + start transform 1 0 -0 1 0 0 + start clip glyph 3 + start transform 1 0 0 1 0 0 + solid 255 165 0 178 + end transform + end clip + end transform + end transform + pop group mode 4 + pop group mode 3 + end transform +end clip diff --git a/test/api/results/testvf-123 b/test/api/results-paint/testvf-123 similarity index 75% rename from test/api/results/testvf-123 rename to test/api/results-paint/testvf-123 index d2d8b6747..cb7b96e8b 100644 --- a/test/api/results/testvf-123 +++ b/test/api/results-paint/testvf-123 @@ -1,18 +1,12 @@ -# random seed: R02S486e6425a6369f1d079b0c273210d642 -# Start of hb tests -# Start of paint tests -# Start of ot tests start clip rectangle 0 0 1e+03 1e+03 start transform 1 0 0 1 0 0 - push group - start transform 1 0 -0 1 0 0 - start clip glyph 3 - start transform 1 0 0 1 0 0 - solid 0 0 0 255 - end transform - end clip - end transform - pop group mode 3 + start transform 1 0 -0 1 0 0 + start clip glyph 3 + start transform 1 0 0 1 0 0 + solid 0 0 0 255 + end transform + end clip + end transform push group start transform 1 0 0 1 333 667 start transform 0.5 0 0 0.5 0 0 diff --git a/test/api/results-paint/testvf-154 b/test/api/results-paint/testvf-154 new file mode 100644 index 000000000..6b50a9475 --- /dev/null +++ b/test/api/results-paint/testvf-154 @@ -0,0 +1,38 @@ +start clip rectangle 0 500 500 1e+03 + start transform 1 0 0 1 0 0 + push group + start transform 1 0 -0 1 0 0 + paint color glyph 164; acting as failed + end transform + start clip rectangle 100 100 900 900 + start transform 1 0 -0 1 0 0 + paint color glyph 93; acting as failed + end transform + start clip rectangle 0 0 1e+03 1e+03 + start transform 1 0 -0 1 0 0 + start clip glyph 2 + start transform 1 0 0 1 0 0 + radial gradient + p0 166 768 radius 0 + p1 166 768 radius 256 + colors 2 + 0 0 128 0 255 + 0.5 255 255 255 255 + 1 255 0 0 255 + end transform + end clip + end transform + end clip + end clip + push group + start transform 1 0 -0 1 0 0 + start clip glyph 159 + start transform 1 0 0 1 0 0 + solid 128 128 128 102 + end transform + end clip + end transform + pop group mode 3 + pop group mode 3 + end transform +end clip diff --git a/test/api/results/testvf-165 b/test/api/results-paint/testvf-165 similarity index 79% rename from test/api/results/testvf-165 rename to test/api/results-paint/testvf-165 index 94de0b720..24bf7543f 100644 --- a/test/api/results/testvf-165 +++ b/test/api/results-paint/testvf-165 @@ -1,7 +1,3 @@ -# random seed: R02S4f2af10d205b3b3052f5a575490a2686 -# Start of hb tests -# Start of paint tests -# Start of ot tests start clip rectangle 100 250 1.2e+03 950 start transform 1 0 0 1 0 0 start transform 1 0 -0 1 0 0 diff --git a/test/api/results-paint/testvf-175 b/test/api/results-paint/testvf-175 new file mode 100644 index 000000000..a0d7c8152 --- /dev/null +++ b/test/api/results-paint/testvf-175 @@ -0,0 +1,28 @@ +start clip rectangle 0 0 1e+03 1e+03 + start transform 1 0 0 1 0 0 + start transform 1 0 0 1 150 0 + start transform 1 0 -0 1 0 0 + start clip glyph 174 + start transform 1 0 0 1 0 0 + solid 0 128 0 255 + end transform + end clip + end transform + end transform + start transform 1 0 0 1 -150 0 + start transform 1 0 -0 1 0 0 + start clip glyph 174 + start transform 1 0 0 1 0 0 + linear gradient + p0 500 250 + p1 500 950 + p2 600 250 + colors 1 + 0 255 0 0 255 + 1 0 0 255 255 + end transform + end clip + end transform + end transform + end transform +end clip diff --git a/test/api/results/testvf-6 b/test/api/results-paint/testvf-6 similarity index 78% rename from test/api/results/testvf-6 rename to test/api/results-paint/testvf-6 index 73c70edf6..ff4ae4f67 100644 --- a/test/api/results/testvf-6 +++ b/test/api/results-paint/testvf-6 @@ -1,7 +1,3 @@ -# random seed: R02Sc96e8c0cb2d824e493d9a1088730d188 -# Start of hb tests -# Start of paint tests -# Start of ot tests start clip rectangle 100 250 900 950 start transform 1 0 0 1 0 0 start transform 1 0 -0 1 0 0 diff --git a/test/api/results/testvf-92 b/test/api/results-paint/testvf-92 similarity index 79% rename from test/api/results/testvf-92 rename to test/api/results-paint/testvf-92 index 382d1ac77..0e2548189 100644 --- a/test/api/results/testvf-92 +++ b/test/api/results-paint/testvf-92 @@ -1,7 +1,3 @@ -# random seed: R02See3981a17ce77670e1392178e6b57952 -# Start of hb tests -# Start of paint tests -# Start of ot tests start clip rectangle 0 0 1e+03 1e+03 start transform 1 0 0 1 0 0 start transform 1 0 -0 1 0 0 diff --git a/test/api/results-paint/testvf02 b/test/api/results-paint/testvf02 new file mode 100644 index 000000000..4740b164c --- /dev/null +++ b/test/api/results-paint/testvf02 @@ -0,0 +1,9 @@ +TAP version 14 +# random seed: R02S9d8a1a6293f81feeb807d06ea3a93793 +# Start of hb tests +# Start of paint tests +# Start of ot tests +# End of ot tests +# End of paint tests +# End of hb tests +1..0 diff --git a/test/api/results/bad-154 b/test/api/results/bad-154 deleted file mode 100644 index 5f88e0309..000000000 --- a/test/api/results/bad-154 +++ /dev/null @@ -1,17 +0,0 @@ -# random seed: R02S13f44c97ec7b03f792b3b9650a81b62a -# Start of hb tests -# Start of paint tests -# Start of ot tests -start clip rectangle 0 500 500 1e+03 - start transform 1 0 0 1 0 0 - push group - start transform 1 0 -0 1 0 0 - start clip glyph 159 - start transform 1 0 0 1 0 0 - solid 128 128 128 102 - end transform - end clip - end transform - pop group mode 3 - end transform -end clip diff --git a/test/api/results/hand-10 b/test/api/results/hand-10 deleted file mode 100644 index 10410e6ee..000000000 --- a/test/api/results/hand-10 +++ /dev/null @@ -1,121 +0,0 @@ -# random seed: R02Se2b1d61d9c4fd31724517ef138cff8f6 -# Start of hb tests -# Start of paint tests -# Start of ot tests -start clip rectangle 64 -224 1.22e+03 928 - start transform 1 0 0 1 0 0 - push group - start transform 1 0 -0 1 0 0 - start clip glyph 13 - start transform 1 0 0 1 0 0 - start transform 1 0 0 0.977 0 0 - radial gradient - p0 280 440 radius 0 - p1 280 440 radius 467 - colors 0 - 0 186 141 104 255 - 0.449 183 138 103 255 - 0.809 173 130 100 255 - 1 164 123 98 255 - end transform - end transform - end clip - end transform - pop group mode 3 - push group - start transform 1 0 -0 1 0 0 - start clip glyph 14 - start transform 1 0 0 1 0 0 - linear gradient - p0 231 -27 - p1 1.02e+03 -27 - p2 231 -815 - colors 0 - 0 164 123 98 255 - 1 164 123 98 255 - end transform - end clip - end transform - pop group mode 3 - push group - start transform 1 0 -0 1 0 0 - start clip glyph 15 - start transform 1 0 0 1 0 0 - solid 145 103 77 255 - end transform - end clip - end transform - pop group mode 3 - push group - start transform 1 0 -0 1 0 0 - start clip glyph 16 - start transform 1 0 0 1 0 0 - solid 30 136 229 255 - end transform - end clip - end transform - pop group mode 3 - push group - start transform 1 0 -0 1 0 0 - start clip glyph 21 - start transform 1 0 0 1 0 0 - solid 145 103 77 255 - end transform - end clip - end transform - pop group mode 3 - push group - push group - start transform 1 0 -0 1 0 0 - start clip glyph 16 - start transform 1 0 0 1 0 0 - linear gradient - p0 669 776 - p1 180 -106 - p2 -212 1.26e+03 - colors 0 - 0 100 181 246 255 - 1 33 150 243 255 - end transform - end clip - end transform - pop group mode 3 - push group - start transform 1 0 -0 1 0 0 - start clip glyph 18 - start transform 1 0 0 1 0 0 - solid 66 66 66 51 - end transform - end clip - end transform - pop group mode 3 - pop group mode 3 - push group - start transform 1 0 -0 1 0 0 - start clip glyph 19 - start transform 1 0 0 1 0 0 - start transform 1 0 0 0.969 0 0 - radial gradient - p0 588 198 radius 0 - p1 588 198 radius 342 - colors 0 - 0 186 141 104 255 - 0.449 183 138 103 255 - 0.809 173 130 100 255 - 1 164 123 98 255 - end transform - end transform - end clip - end transform - pop group mode 3 - push group - start transform 1 0 -0 1 0 0 - start clip glyph 20 - start transform 1 0 0 1 0 0 - solid 145 103 77 255 - end transform - end clip - end transform - pop group mode 3 - end transform -end clip diff --git a/test/api/results/hand-10.2 b/test/api/results/hand-10.2 deleted file mode 100644 index 2076624ae..000000000 --- a/test/api/results/hand-10.2 +++ /dev/null @@ -1,121 +0,0 @@ -# random seed: R02S962715a93cddae2d3121a44b0e86cc22 -# Start of hb tests -# Start of paint tests -# Start of ot tests -start clip rectangle 19 -224 1.4e+03 928 - start transform 1 0 0.2 1 0 0 - push group - start transform 1 0 -0.2 1 0 0 - start clip glyph 13 - start transform 1 0 0.2 1 0 0 - start transform 1 0 0 0.977 0 0 - radial gradient - p0 280 440 radius 0 - p1 280 440 radius 467 - colors 0 - 0 186 141 104 255 - 0.449 183 138 103 255 - 0.809 173 130 100 255 - 1 164 123 98 255 - end transform - end transform - end clip - end transform - pop group mode 3 - push group - start transform 1 0 -0.2 1 0 0 - start clip glyph 14 - start transform 1 0 0.2 1 0 0 - linear gradient - p0 231 -27 - p1 1.02e+03 -27 - p2 231 -815 - colors 0 - 0 164 123 98 255 - 1 164 123 98 255 - end transform - end clip - end transform - pop group mode 3 - push group - start transform 1 0 -0.2 1 0 0 - start clip glyph 15 - start transform 1 0 0.2 1 0 0 - solid 145 103 77 255 - end transform - end clip - end transform - pop group mode 3 - push group - start transform 1 0 -0.2 1 0 0 - start clip glyph 16 - start transform 1 0 0.2 1 0 0 - solid 30 136 229 255 - end transform - end clip - end transform - pop group mode 3 - push group - start transform 1 0 -0.2 1 0 0 - start clip glyph 21 - start transform 1 0 0.2 1 0 0 - solid 145 103 77 255 - end transform - end clip - end transform - pop group mode 3 - push group - push group - start transform 1 0 -0.2 1 0 0 - start clip glyph 16 - start transform 1 0 0.2 1 0 0 - linear gradient - p0 669 776 - p1 180 -106 - p2 -212 1.26e+03 - colors 0 - 0 100 181 246 255 - 1 33 150 243 255 - end transform - end clip - end transform - pop group mode 3 - push group - start transform 1 0 -0.2 1 0 0 - start clip glyph 18 - start transform 1 0 0.2 1 0 0 - solid 66 66 66 51 - end transform - end clip - end transform - pop group mode 3 - pop group mode 3 - push group - start transform 1 0 -0.2 1 0 0 - start clip glyph 19 - start transform 1 0 0.2 1 0 0 - start transform 1 0 0 0.969 0 0 - radial gradient - p0 588 198 radius 0 - p1 588 198 radius 342 - colors 0 - 0 186 141 104 255 - 0.449 183 138 103 255 - 0.809 173 130 100 255 - 1 164 123 98 255 - end transform - end transform - end clip - end transform - pop group mode 3 - push group - start transform 1 0 -0.2 1 0 0 - start clip glyph 20 - start transform 1 0 0.2 1 0 0 - solid 145 103 77 255 - end transform - end clip - end transform - pop group mode 3 - end transform -end clip diff --git a/test/api/results/test-106 b/test/api/results/test-106 deleted file mode 100644 index 2e04261a8..000000000 --- a/test/api/results/test-106 +++ /dev/null @@ -1,30 +0,0 @@ -# random seed: R02S33079790f9ab4f19e7151add3612840f -# Start of hb tests -# Start of paint tests -# Start of ot tests -start clip rectangle 118 -22.9 750 750 - start transform 1 0 0 1 0 0 - start transform 1 0 -0 1 0 0 - start clip glyph 3 - start transform 1 0 0 1 0 0 - solid 0 0 255 127 - end transform - end clip - end transform - push group - start transform 1 0 0 1 1e+03 1e+03 - start transform 1 0.364 0.176 1 0 0 - start transform 1 0 0 1 -1e+03 -1e+03 - start transform 1 0 -0 1 0 0 - start clip glyph 3 - start transform 1 0 0 1 0 0 - solid 255 165 0 178 - end transform - end clip - end transform - end transform - end transform - end transform - pop group mode 4 - end transform -end clip diff --git a/test/api/results/test-116 b/test/api/results/test-116 deleted file mode 100644 index 3cb18d38d..000000000 --- a/test/api/results/test-116 +++ /dev/null @@ -1,26 +0,0 @@ -# random seed: R02S7f8abf2d360ae53f6acb756fc1d06756 -# Start of hb tests -# Start of paint tests -# Start of ot tests -start clip rectangle 250 250 950 950 - start transform 1 0 0 1 0 0 - start transform 1 0 -0 1 0 0 - start clip glyph 3 - start transform 1 0 0 1 0 0 - solid 0 0 255 127 - end transform - end clip - end transform - push group - start transform 1 0 0 1 200 200 - start transform 1 0 -0 1 0 0 - start clip glyph 3 - start transform 1 0 0 1 0 0 - solid 255 165 0 178 - end transform - end clip - end transform - end transform - pop group mode 4 - end transform -end clip diff --git a/test/api/results/test-154 b/test/api/results/test-154 deleted file mode 100644 index f108da8d7..000000000 --- a/test/api/results/test-154 +++ /dev/null @@ -1,40 +0,0 @@ -# random seed: R02S46170a7a8abc3ad07d2b70fd08efc176 -# Start of hb tests -# Start of paint tests -# Start of ot tests -start clip rectangle 0 500 500 1e+03 - start transform 1 0 0 1 0 0 - start transform 1 0 -0 1 0 0 - paint color glyph 164; acting as failed - end transform - start clip rectangle 100 100 900 900 - start transform 1 0 -0 1 0 0 - paint color glyph 93; acting as failed - end transform - start clip rectangle 0 0 1e+03 1e+03 - start transform 1 0 -0 1 0 0 - start clip glyph 2 - start transform 1 0 0 1 0 0 - radial gradient - p0 166 768 radius 0 - p1 166 768 radius 256 - colors 2 - 0 0 128 0 255 - 0.5 255 255 255 255 - 1 255 0 0 255 - end transform - end clip - end transform - end clip - end clip - push group - start transform 1 0 -0 1 0 0 - start clip glyph 159 - start transform 1 0 0 1 0 0 - solid 128 128 128 102 - end transform - end clip - end transform - pop group mode 3 - end transform -end clip diff --git a/test/api/results/test-175 b/test/api/results/test-175 deleted file mode 100644 index be14b8117..000000000 --- a/test/api/results/test-175 +++ /dev/null @@ -1,36 +0,0 @@ -# random seed: R02Se9d7defb0878dc8a90f62d9f42a715f3 -# Start of hb tests -# Start of paint tests -# Start of ot tests -start clip rectangle 0 0 1e+03 1e+03 - start transform 1 0 0 1 0 0 - push group - start transform 1 0 0 1 150 0 - start transform 1 0 -0 1 0 0 - start clip glyph 174 - start transform 1 0 0 1 0 0 - solid 0 128 0 255 - end transform - end clip - end transform - end transform - pop group mode 3 - push group - start transform 1 0 0 1 -150 0 - start transform 1 0 -0 1 0 0 - start clip glyph 174 - start transform 1 0 0 1 0 0 - linear gradient - p0 500 250 - p1 500 950 - p2 600 250 - colors 1 - 0 255 0 0 255 - 1 0 0 255 255 - end transform - end clip - end transform - end transform - pop group mode 3 - end transform -end clip diff --git a/test/api/results/testvf-106 b/test/api/results/testvf-106 deleted file mode 100644 index 7ab6569c1..000000000 --- a/test/api/results/testvf-106 +++ /dev/null @@ -1,30 +0,0 @@ -# random seed: R02S2b4bb33484e694adbb383b09d19251a7 -# Start of hb tests -# Start of paint tests -# Start of ot tests -start clip rectangle 118 -22.9 750 750 - start transform 1 0 0 1 0 0 - start transform 1 0 -0 1 0 0 - start clip glyph 3 - start transform 1 0 0 1 0 0 - solid 0 0 255 127 - end transform - end clip - end transform - push group - start transform 1 0 0 1 1e+03 1e+03 - start transform 1 0.364 0.176 1 0 0 - start transform 1 0 0 1 -1e+03 -1e+03 - start transform 1 0 -0 1 0 0 - start clip glyph 3 - start transform 1 0 0 1 0 0 - solid 255 165 0 178 - end transform - end clip - end transform - end transform - end transform - end transform - pop group mode 4 - end transform -end clip diff --git a/test/api/results/testvf-116 b/test/api/results/testvf-116 deleted file mode 100644 index 9ac2926bf..000000000 --- a/test/api/results/testvf-116 +++ /dev/null @@ -1,26 +0,0 @@ -# random seed: R02S5710187ea075c431f16412c38d1f7407 -# Start of hb tests -# Start of paint tests -# Start of ot tests -start clip rectangle 250 250 950 950 - start transform 1 0 0 1 0 0 - start transform 1 0 -0 1 0 0 - start clip glyph 3 - start transform 1 0 0 1 0 0 - solid 0 0 255 127 - end transform - end clip - end transform - push group - start transform 1 0 0 1 200 200 - start transform 1 0 -0 1 0 0 - start clip glyph 3 - start transform 1 0 0 1 0 0 - solid 255 165 0 178 - end transform - end clip - end transform - end transform - pop group mode 4 - end transform -end clip diff --git a/test/api/results/testvf-154 b/test/api/results/testvf-154 deleted file mode 100644 index cd6e9b9b9..000000000 --- a/test/api/results/testvf-154 +++ /dev/null @@ -1,40 +0,0 @@ -# random seed: R02Sd6c6e6b574cffce42448b4c7ec9ed3b1 -# Start of hb tests -# Start of paint tests -# Start of ot tests -start clip rectangle 0 500 500 1e+03 - start transform 1 0 0 1 0 0 - start transform 1 0 -0 1 0 0 - paint color glyph 164; acting as failed - end transform - start clip rectangle 100 100 900 900 - start transform 1 0 -0 1 0 0 - paint color glyph 93; acting as failed - end transform - start clip rectangle 0 0 1e+03 1e+03 - start transform 1 0 -0 1 0 0 - start clip glyph 2 - start transform 1 0 0 1 0 0 - radial gradient - p0 166 768 radius 0 - p1 166 768 radius 256 - colors 2 - 0 0 128 0 255 - 0.5 255 255 255 255 - 1 255 0 0 255 - end transform - end clip - end transform - end clip - end clip - push group - start transform 1 0 -0 1 0 0 - start clip glyph 159 - start transform 1 0 0 1 0 0 - solid 128 128 128 102 - end transform - end clip - end transform - pop group mode 3 - end transform -end clip diff --git a/test/api/results/testvf-175 b/test/api/results/testvf-175 deleted file mode 100644 index f0b6e9acb..000000000 --- a/test/api/results/testvf-175 +++ /dev/null @@ -1,36 +0,0 @@ -# random seed: R02S4c022e014005a52e2898416210be4ddf -# Start of hb tests -# Start of paint tests -# Start of ot tests -start clip rectangle 0 0 1e+03 1e+03 - start transform 1 0 0 1 0 0 - push group - start transform 1 0 0 1 150 0 - start transform 1 0 -0 1 0 0 - start clip glyph 174 - start transform 1 0 0 1 0 0 - solid 0 128 0 255 - end transform - end clip - end transform - end transform - pop group mode 3 - push group - start transform 1 0 0 1 -150 0 - start transform 1 0 -0 1 0 0 - start clip glyph 174 - start transform 1 0 0 1 0 0 - linear gradient - p0 500 250 - p1 500 950 - p2 600 250 - colors 1 - 0 255 0 0 255 - 1 0 0 255 255 - end transform - end clip - end transform - end transform - pop group mode 3 - end transform -end clip diff --git a/test/api/test-paint.c b/test/api/test-paint.c index 184b799ab..5752359c5 100644 --- a/test/api/test-paint.c +++ b/test/api/test-paint.c @@ -334,7 +334,7 @@ typedef struct { /* To verify the rendering visually, use * - * hb-view --font-slant SLANT --font-palette PALETTE FONT --glyphs [gidGID=0+1000] + * hb-view --font-slant SLANT --font-palette PALETTE FONT --glyphs gidGID * * where GID is the glyph value of the test. */ @@ -404,17 +404,19 @@ test_hb_paint (gconstpointer d, /* Run * - * GENERATE_DATA=1 G_TEST_SRCDIR=./test/api ./build/test/api/test-paint -p TESTCASE > test/api/results/OUTPUT + * GENERATE_DATA=1 G_TEST_SRCDIR=./test/api ./build/test/api/test-paint * - * to produce the expected results file. + * to regenerate the expected output for all tests. */ + file = g_test_build_filename (G_TEST_DIST, "results-paint", test->output, NULL); if (getenv ("GENERATE_DATA")) { - g_print ("%s", data.string->str); - exit (0); + if (!g_file_set_contents (file, data.string->str, data.string->len, NULL)) + g_error ("Failed to write %s.", file); + + return; } - file = g_test_build_filename (G_TEST_DIST, "results", test->output, NULL); if (!g_file_get_contents (file, &buffer, &len, &error)) { g_test_message ("File %s not found.", file); @@ -429,22 +431,6 @@ test_hb_paint (gconstpointer d, else expected = g_strsplit (buffer, "\n", 0); - /* Strip initial comments */ - int i; - for (i = 0; expected[i]; i++) - { - if (expected[i][0] != '#') - { - if (i > 0) - { - char **tmp = g_strdupv (expected + i); - g_strfreev (expected); - expected = tmp; - } - break; - } - } - if (g_strv_length (lines) != g_strv_length (expected)) { g_test_message ("Unexpected number of lines in output (%d instead of %d):\n%s", g_strv_length (lines), g_strv_length (expected), data.string->str);