Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-browser-render

Source of release 0.6.2

0.6.2 / src / gfx / tests_sk_path_cases.lucb

#==============================================================================================
#
#   tests_sk_path_cases - Gfx::Path cases replayed on the SkPath port (generated)
#
#   DESCRIPTION:
#       Each case replays Gfx::Path calls with the helpers of tests_sk_path and checks the
#       to_svg_string, bounding_box (as bits), last_point (as bits), is_empty and contains
#       (nonzero, even-odd) answers that Ladybird 47c82b38d0 (Build/release) printed for the same
#       calls. Generated test vectors.
#
#==============================================================================================

test "sk path: basic":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 10.0, 20.0)
    sk_path_line_to(&p.path, 30.5, 40.25)
    sk_path_quad_to(&p.path, 1.0, 2.0, 3.0, 4.0)
    test_sk_close(&p)
    test_sk_elliptical_arc_to(&p, 50.0, 60.0, 20.0, 10.0, 0.3, false, true)
    test_sk_check_svg(&p, "M10 20L30.5 40.25Q1 2 3 4L10 20ZM10 20Q10.709711 19.898115 11.442657 19.820444Q12.175604 19.742773 12.93002 19.689503Q13.684437 19.63623 14.458506 19.607491Q15.232574 19.578747 16.024431 19.574604Q16.816288 19.570461 17.624027 19.590925Q18.431765 19.611389 19.253437 19.656414Q20.075109 19.701439 20.908737 19.770912Q21.742363 19.840387 22.585938 19.934145Q23.429512 20.027903 24.281 20.145718Q25.132488 20.263535 25.98984 20.405123Q26.847191 20.546711 27.708338 20.711731Q28.569489 20.876751 29.43236 21.064806Q30.295231 21.252861 31.157749 21.463499Q32.020264 21.674137 32.880348 21.906849Q33.740433 22.139559 34.596008 22.393784Q35.451584 22.648008 36.300598 22.923136Q37.149609 23.198261 37.990005 23.493626Q38.830406 23.788992 39.660168 24.103886Q40.489929 24.418776 41.307056 24.752436Q42.124184 25.086094 42.926704 25.437719Q43.729225 25.789343 44.515213 26.158085Q45.301197 26.526825 46.068752 26.911798Q46.836304 27.296768 47.583576 27.697041Q48.330849 28.097313 49.056046 28.511923Q49.781239 28.926533 50.482605 29.354481Q51.183975 29.782429 51.859825 30.222687Q52.535675 30.662941 53.18438 31.114443Q53.833084 31.565945 54.453079 32.027607Q55.073074 32.489265 55.662872 32.959976Q56.25267 33.430687 56.810844 33.909309Q57.369011 34.387932 57.894215 34.873314Q58.419418 35.358696 58.910393 35.849667Q59.401367 36.340637 59.856926 36.836021Q60.312485 37.331398 60.731529 37.829994Q61.150574 38.32859 61.532093 38.829197Q61.913612 39.329803 62.256691 39.831219Q62.59977 40.332634 62.903584 40.833649Q63.207397 41.334663 63.47121 41.834072Q63.73502 42.333477 63.958199 42.83007Q64.181374 43.326668 64.36338 43.819256Q64.545387 44.311844 64.685783 44.79924Q64.826172 45.286636 64.924622 45.767666Q65.023064 46.248692 65.079315 46.722191Q65.135574 47.195694 65.149506 47.660526Q65.163437 48.125359 65.135025 48.580402Q65.106606 49.035446 65.035904 49.479614Q64.965195 49.923775 64.852364 50.355984Q64.73954 50.788193 64.584869 51.207405Q64.430199 51.626617 64.234055 52.031826Q64.037918 52.437035 63.80077 52.827267Q63.563622 53.217491 63.286049 53.591797Q63.008476 53.966103 62.691143 54.323586Q62.37381 54.681068 62.017483 55.020866Q61.661156 55.360672 61.266689 55.681969Q60.872223 56.003265 60.440567 56.305286Q60.008915 56.607307 59.541115 56.88932Q59.073318 57.171337 58.570499 57.432671Q58.06768 57.694004 57.531052 57.934025Q56.994423 58.174042 56.425278 58.39217Q55.856133 58.610298 55.255844 58.806007Q54.655556 59.00172 54.02557 59.174545Q53.39558 59.347366 52.737411 59.496887Q52.079239 59.646408 51.394478 59.772263Q50.709709 59.898113 50 60")
    test_sk_check_bounds(&p, 0x3f800000, 0x40000000, 0x429bd21f, 0x42680000)
    test_sk_check_last_point(&p, 0x42480000, 0x42700000)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 20.0, 30.0, true, true)
    test_sk_check_contains(&p, 10.0, 20.0, true, false)
    test_sk_check_contains(&p, 40.0, 40.0, true, true)

test "sk path: every_verb":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    sk_path_line_to(&p.path, 10.0, 0.0)
    sk_path_quad_to(&p.path, 20.0, 0.0, 20.0, 10.0)
    sk_path_cubic_to(&p.path, 20.0, 20.0, 10.0, 20.0, 0.0, 20.0)
    test_sk_close(&p)
    test_sk_check_svg(&p, "M0 0L10 0Q20 0 20 10C20 20 10 20 0 20L0 0Z")
    test_sk_check_bounds(&p, 0x0, 0x0, 0x41a00000, 0x41a00000)
    test_sk_check_last_point(&p, 0x0, 0x0)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 5.0, 5.0, true, true)
    test_sk_check_contains(&p, 15.0, 15.0, true, true)
    test_sk_check_contains(&p, 0.0, 0.0, true, true)
    test_sk_check_contains(&p, 10.0, 0.0, true, true)
    test_sk_check_contains(&p, -1.0, 5.0, false, false)
    test_sk_check_contains(&p, 20.0, 10.0, true, true)
    test_sk_check_contains(&p, 19.9, 10.0, true, true)
    test_sk_check_contains(&p, 5.0, 20.0, false, false)
    test_sk_check_contains(&p, 0.0, 10.0, true, true)
    test_sk_check_contains(&p, 15.0, 18.5, false, false)

test "sk path: move_collapse":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 1.0, 1.0)
    test_sk_move_to(&p, 2.0, 2.0)
    sk_path_line_to(&p.path, 3.0, 3.0)
    test_sk_move_to(&p, 5.0, 5.0)
    test_sk_check_svg(&p, "M2 2L3 3")
    test_sk_check_bounds(&p, 0x40000000, 0x40000000, 0x40400000, 0x40400000)
    test_sk_check_last_point(&p, 0x40a00000, 0x40a00000)
    assert(sk_path_is_empty(&p.path) == false)

test "sk path: close_continue":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    sk_path_line_to(&p.path, 10.0, 0.0)
    sk_path_line_to(&p.path, 10.0, 10.0)
    test_sk_close(&p)
    test_sk_close(&p)
    sk_path_line_to(&p.path, 20.0, 20.0)
    sk_path_quad_to(&p.path, 30.0, 20.0, 30.0, 30.0)
    test_sk_check_svg(&p, "M0 0L10 0L10 10L0 0ZM0 0ZM0 0L20 20Q30 20 30 30")
    test_sk_check_bounds(&p, 0x0, 0x0, 0x41f00000, 0x41f00000)
    test_sk_check_last_point(&p, 0x41f00000, 0x41f00000)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 8.0, 2.0, true, true)
    test_sk_check_contains(&p, 25.0, 24.0, true, true)

test "sk path: line_first":
    var p = test_sk_gfx_path()
    sk_path_line_to(&p.path, 5.0, 5.0)
    sk_path_line_to(&p.path, 5.0, 0.0)
    test_sk_check_svg(&p, "M0 0L5 5L5 0")
    test_sk_check_bounds(&p, 0x0, 0x0, 0x40a00000, 0x40a00000)
    test_sk_check_last_point(&p, 0x40a00000, 0x0)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 4.0, 2.0, true, true)

test "sk path: arc_ff":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    test_sk_elliptical_arc_to(&p, 100.0, 0.0, 50.0, 50.0, 0.0, false, false)
    test_sk_check_svg(&p, "M0 0Q0 1.2274312 0.060227182 2.4533837Q0.12045436 3.6793361 0.24076365 4.900857Q0.36107293 6.1223774 0.54117441 7.3365231Q0.72127593 8.5506697 0.96073586 9.7545156Q1.2001958 10.958362 1.4984372 12.149008Q1.7966785 13.339655 2.152983 14.514234Q2.5092874 15.688811 2.9227962 16.844492Q3.3363054 18.000172 3.8060229 19.134171Q4.2757406 20.268169 4.8005347 21.377752Q5.3253293 22.487339 5.9039364 23.569836Q6.482543 24.652332 7.1135688 25.705135Q7.7445946 26.757938 8.4265184 27.778511Q9.1084423 28.799084 9.8396225 29.784964Q10.570803 30.770847 11.349477 31.719666Q12.128151 32.668484 12.952443 33.57795Q13.776735 34.487415 14.64466 35.355339Q15.512585 36.223263 16.42205 37.047554Q17.331516 37.871849 18.280334 38.65052Q19.229151 39.429195 20.215033 40.160374Q21.200914 40.891556 22.221485 41.573479Q23.242058 42.255402 24.294861 42.886425Q25.347664 43.517452 26.430162 44.096062Q27.512657 44.674667 28.622242 45.199463Q29.731827 45.724258 30.865826 46.193974Q31.999825 46.663689 33.155506 47.077202Q34.311188 47.490707 35.485767 47.847015Q36.660347 48.203316 37.85099 48.50156Q39.041637 48.799801 40.245483 49.039261Q41.449333 49.278725 42.663475 49.458824Q43.877625 49.638927 45.099144 49.759239Q46.320663 49.879547 47.546616 49.939774Q48.772568 50 50 50Q51.227432 50 52.453384 49.939774Q53.679337 49.879547 54.90086 49.759239Q56.122379 49.638927 57.336525 49.458824Q58.550667 49.278725 59.754513 49.039261Q60.958359 48.799801 62.149006 48.501556Q63.339653 48.203316 64.514236 47.847015Q65.688812 47.490707 66.84449 47.077202Q68.000168 46.663689 69.134171 46.193974Q70.268173 45.724258 71.377754 45.199463Q72.487343 44.674667 73.569839 44.096062Q74.652336 43.517452 75.705139 42.886425Q76.757935 42.255402 77.778511 41.573479Q78.799088 40.891556 79.784966 40.160374Q80.770851 39.429199 81.719666 38.650524Q82.668488 37.871849 83.57795 37.047558Q84.487411 36.223263 85.355339 35.355339Q86.223267 34.487415 87.047554 33.57795Q87.871849 32.668484 88.650528 31.719666Q89.429199 30.770847 90.160378 29.784966Q90.891556 28.799084 91.573479 27.778511Q92.255402 26.757938 92.886429 25.705135Q93.517456 24.652334 94.096069 23.569838Q94.674667 22.487339 95.199463 21.377752Q95.724251 20.268169 96.19397 19.134171Q96.663681 18.000172 97.077194 16.844492Q97.490707 15.688811 97.847015 14.514234Q98.203323 13.339655 98.501556 12.149009Q98.799805 10.958362 99.039261 9.7545156Q99.278725 8.5506697 99.458824 7.3365235Q99.638924 6.1223774 99.759232 4.900857Q99.879539 3.6793361 99.939774 2.4533837Q100 1.2274312 100 0")
    test_sk_check_bounds(&p, 0x0, 0x0, 0x42c80000, 0x42480000)
    test_sk_check_last_point(&p, 0x42c80000, 0x0)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 50.0, 10.0, true, true)
    test_sk_check_contains(&p, 50.0, -10.0, false, false)
    test_sk_check_contains(&p, 50.0, 0.0, true, true)

test "sk path: arc_ft":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    test_sk_elliptical_arc_to(&p, 100.0, 0.0, 50.0, 50.0, 0.0, false, true)
    test_sk_check_svg(&p, "M0 0Q0 -1.2274309 0.060227197 -2.4533834Q0.12045439 -3.6793356 0.24076371 -4.9008565Q0.36107302 -6.1223764 0.54117453 -7.3365226Q0.72127616 -8.5506687 0.9607361 -9.7545147Q1.200196 -10.958361 1.4984375 -12.149008Q1.796679 -13.339654 2.1529837 -14.514233Q2.5092881 -15.68881 2.9227972 -16.844492Q3.3363061 -18.000172 3.8060238 -19.134171Q4.2757416 -20.268169 4.8005357 -21.377752Q5.3253303 -22.487339 5.9039373 -23.569836Q6.4825444 -24.652332 7.1135702 -25.705135Q7.7445965 -26.757938 8.4265203 -27.778509Q9.1084442 -28.79908 9.8396244 -29.784964Q10.570805 -30.770847 11.349479 -31.719666Q12.128153 -32.66848 12.952445 -33.577946Q13.776737 -34.487411 14.644662 -35.355339Q15.512587 -36.223263 16.422054 -37.047554Q17.33152 -37.871849 18.280338 -38.65052Q19.229153 -39.429195 20.215034 -40.160374Q21.200916 -40.891556 22.221489 -41.573479Q23.242062 -42.255402 24.294865 -42.886429Q25.347668 -43.517456 26.430166 -44.096066Q27.512661 -44.674671 28.622246 -45.199467Q29.731831 -45.724258 30.865829 -46.193977Q31.999828 -46.663696 33.15551 -47.077206Q34.311188 -47.490715 35.485767 -47.847019Q36.660347 -48.203323 37.85099 -48.501564Q39.041637 -48.799805 40.245483 -49.039265Q41.449333 -49.278725 42.663475 -49.458824Q43.877625 -49.638931 45.099144 -49.759239Q46.320663 -49.879547 47.546616 -49.939774Q48.772568 -50 50 -50Q51.227432 -50 52.453384 -49.939774Q53.679337 -49.879547 54.90086 -49.759239Q56.122379 -49.638927 57.336525 -49.458824Q58.550667 -49.278725 59.754513 -49.039261Q60.958359 -48.799805 62.149006 -48.501564Q63.339653 -48.203323 64.514236 -47.847019Q65.688812 -47.490715 66.84449 -47.077206Q68.000168 -46.663696 69.134171 -46.193977Q70.268173 -45.724258 71.377754 -45.199463Q72.487335 -44.674671 73.569839 -44.096066Q74.652328 -43.517456 75.705132 -42.886429Q76.757935 -42.255402 77.778503 -41.573479Q78.799072 -40.891556 79.784966 -40.160374Q80.770844 -39.429199 81.719666 -38.650524Q82.668488 -37.871849 83.57795 -37.047558Q84.487411 -36.223263 85.355339 -35.355339Q86.223267 -34.487411 87.047554 -33.57795Q87.871849 -32.66848 88.650528 -31.719664Q89.429199 -30.770845 90.160378 -29.784962Q90.891556 -28.79908 91.573479 -27.778507Q92.255402 -26.757935 92.886429 -25.705133Q93.517456 -24.652332 94.096069 -23.569836Q94.674667 -22.487339 95.199463 -21.377752Q95.724251 -20.268169 96.19397 -19.134171Q96.663681 -18.000172 97.077194 -16.844492Q97.490707 -15.688811 97.847015 -14.514234Q98.203323 -13.339655 98.501556 -12.149008Q98.799805 -10.958361 99.039261 -9.7545147Q99.278725 -8.5506687 99.458824 -7.3365221Q99.638924 -6.1223764 99.759232 -4.9008565Q99.879539 -3.6793356 99.939774 -2.4533834Q100 -1.2274309 100 0")
    test_sk_check_bounds(&p, 0x0, 0xc2480000, 0x42c80000, 0x42480000)
    test_sk_check_last_point(&p, 0x42c80000, 0x0)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 50.0, 10.0, false, false)
    test_sk_check_contains(&p, 50.0, -10.0, true, true)

test "sk path: arc_tf":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    test_sk_elliptical_arc_to(&p, 100.0, 0.0, 60.0, 60.0, 0.0, true, false)
    test_sk_check_svg(&p, "M0 0Q-0.74515015 1.1233566 -1.4390967 2.2790456Q-2.1330433 3.4347348 -2.7743859 4.6204243Q-3.4157286 5.8061132 -4.0031729 7.0194097Q-4.5906172 8.2327061 -5.1229777 9.4711618Q-5.6553378 10.709616 -6.1315403 11.970731Q-6.6077418 13.231845 -7.026825 14.513075Q-7.4459076 15.794302 -7.8070259 17.093061Q-8.1681442 18.391819 -8.4705696 19.705486Q-8.7729931 21.01915 -9.0161142 22.345072Q-9.2592335 23.670994 -9.4425602 25.0065Q-9.625886 26.342003 -9.7490473 27.684395Q-9.8722095 29.026783 -9.9349585 30.373352Q-9.9977055 31.719917 -9.9999142 33.06794Q-10.002123 34.41597 -9.9437876 35.762733Q-9.8854513 37.109497 -9.7666893 38.452286Q-9.6479263 39.795071 -9.4689789 41.131172Q-9.2900286 42.467266 -9.0512533 43.793976Q-8.812479 45.120689 -8.5143614 46.435341Q-8.2162418 47.749989 -7.8593812 49.049923Q-7.5025206 50.349861 -7.0876384 51.632462Q-6.6727548 52.915054 -6.2006874 54.177719Q-5.7286196 55.440384 -5.2003202 56.68058Q-4.6720204 57.920769 -4.0885549 59.135986Q-3.5050893 60.3512 -2.8676357 61.53899Q-2.2301815 62.726768 -1.5400251 63.88472Q-0.84986901 65.042679 -0.1084035 66.168472Q0.63306201 67.294266 1.4243405 68.38562Q2.2156191 69.476982 3.0551138 70.531708Q3.894608 71.586411 4.7806244 72.602364Q5.6666403 73.618309 6.5973911 74.593445Q7.528141 75.568573 8.5017471 76.500916Q9.4753532 77.433266 10.489851 78.320953Q11.504347 79.208626 12.557687 80.04985Q13.611027 80.891068 14.701086 81.684135Q15.791143 82.477203 16.915718 83.220512Q18.040295 83.963821 19.197121 84.655876Q20.353943 85.347931 21.54068 85.987328Q22.727417 86.626724 23.941675 87.212173Q25.15593 87.797623 26.395256 88.327957Q27.634583 88.858292 28.896477 89.332428Q30.158367 89.806557 31.440281 90.223534Q32.722195 90.640518 34.021545 90.999519Q35.320889 91.358505 36.635048 91.658783Q37.949211 91.959061 39.275532 92.20002Q40.601849 92.440956 41.937653 92.622093Q43.273453 92.803223 44.616047 92.924194Q45.958633 93.045151 47.305302 93.105698Q48.65197 93.166237 50 93.166245Q51.348022 93.166237 52.694687 93.10569Q54.041359 93.045151 55.383949 92.924194Q56.726536 92.803223 58.062336 92.622093Q59.39814 92.440956 60.724464 92.20002Q62.050781 91.959061 63.364937 91.658783Q64.679092 91.358505 65.978447 90.999527Q67.277786 90.640533 68.559708 90.223549Q69.841614 89.806564 71.103516 89.332436Q72.365402 88.858292 73.604729 88.327957Q74.844055 87.797623 76.058319 87.212173Q77.272568 86.626724 78.459305 85.98732Q79.646042 85.347931 80.802879 84.655884Q81.959702 83.963821 83.084274 83.220512Q84.208847 82.477203 85.298912 81.684143Q86.388962 80.891068 87.442307 80.04985Q88.495651 79.208626 89.510147 78.320953Q90.524643 77.433266 91.498238 76.500923Q92.471848 75.568573 93.402603 74.593445Q94.333344 73.618309 95.21936 72.602356Q96.105385 71.586411 96.944885 70.5317Q97.784378 69.476974 98.575653 68.38562Q99.366928 67.294258 100.1084 66.168472Q100.84985 65.042679 101.54002 63.884724Q102.23017 62.726768 102.86764 61.538994Q103.50508 60.351204 104.08855 59.13599Q104.67201 57.920776 105.20032 56.680588Q105.72861 55.440392 106.20068 54.177723Q106.67274 52.915054 107.08764 51.632462Q107.50252 50.349861 107.85937 49.049927Q108.21623 47.749989 108.51436 46.435341Q108.81247 45.120689 109.05125 43.79398Q109.29002 42.467266 109.46899 41.131172Q109.64793 39.795071 109.76669 38.452286Q109.88544 37.109497 109.94379 35.762737Q110.00211 34.41597 109.99991 33.067944Q109.9977 31.719917 109.93497 30.373354Q109.87221 29.026787 109.74905 27.684395Q109.62589 26.342003 109.44257 25.0065Q109.25923 23.670994 109.01611 22.345072Q108.77299 21.01915 108.47057 19.705486Q108.16814 18.391819 107.80702 17.093061Q107.4459 15.794302 107.02682 14.513075Q106.60773 13.231845 106.13154 11.97073Q105.65533 10.709616 105.12299 9.4711618Q104.59061 8.2327061 104.00317 7.0194097Q103.41572 5.8061132 102.77438 4.6204243Q102.13303 3.4347348 101.43909 2.2790456Q100.74514 1.1233566 100 0")
    test_sk_check_bounds(&p, 0xc1e82993, 0x0, 0x431e0a65, 0x42e1c8c7)
    test_sk_check_last_point(&p, 0x42c80000, 0x0)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 50.0, 40.0, true, true)
    test_sk_check_contains(&p, 50.0, -40.0, false, false)

test "sk path: arc_tt":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    test_sk_elliptical_arc_to(&p, 100.0, 0.0, 60.0, 60.0, 0.0, true, true)
    test_sk_check_svg(&p, "M0 0Q-0.74515015 -1.1233566 -1.4390967 -2.2790456Q-2.1330433 -3.4347348 -2.7743859 -4.6204243Q-3.4157286 -5.8061132 -4.0031729 -7.0194097Q-4.5906172 -8.2327061 -5.1229777 -9.4711618Q-5.6553378 -10.709616 -6.1315403 -11.970731Q-6.6077418 -13.231845 -7.026825 -14.513075Q-7.4459076 -15.794302 -7.8070259 -17.093061Q-8.1681442 -18.391819 -8.4705696 -19.705486Q-8.7729931 -21.01915 -9.0161142 -22.345072Q-9.2592335 -23.670994 -9.4425602 -25.0065Q-9.625886 -26.342003 -9.7490473 -27.684395Q-9.8722095 -29.026783 -9.9349585 -30.373352Q-9.9977055 -31.719917 -9.9999142 -33.06794Q-10.002123 -34.41597 -9.9437876 -35.762733Q-9.8854513 -37.109497 -9.7666893 -38.452286Q-9.6479263 -39.795071 -9.4689789 -41.131172Q-9.2900286 -42.467266 -9.0512533 -43.793976Q-8.812479 -45.120689 -8.5143614 -46.435341Q-8.2162418 -47.749989 -7.8593812 -49.049923Q-7.5025206 -50.349861 -7.0876384 -51.632462Q-6.6727548 -52.915054 -6.2006874 -54.177719Q-5.7286196 -55.440384 -5.2003202 -56.68058Q-4.6720204 -57.920769 -4.0885549 -59.135986Q-3.5050893 -60.3512 -2.8676357 -61.53899Q-2.2301815 -62.726768 -1.5400251 -63.88472Q-0.84986901 -65.042679 -0.1084035 -66.168472Q0.63306201 -67.294266 1.4243405 -68.38562Q2.2156191 -69.476982 3.0551138 -70.531708Q3.894608 -71.586411 4.7806244 -72.602364Q5.6666403 -73.618309 6.5973911 -74.593445Q7.528141 -75.568573 8.5017471 -76.500916Q9.4753532 -77.433266 10.489851 -78.320953Q11.504347 -79.208626 12.557687 -80.04985Q13.611027 -80.891068 14.701086 -81.684135Q15.791143 -82.477203 16.915718 -83.220512Q18.040295 -83.963821 19.197121 -84.655876Q20.353943 -85.347931 21.54068 -85.987328Q22.727417 -86.626724 23.941675 -87.212173Q25.15593 -87.797623 26.395256 -88.327957Q27.634583 -88.858292 28.896477 -89.332428Q30.158367 -89.806557 31.440281 -90.223534Q32.722195 -90.640518 34.021545 -90.999519Q35.320889 -91.358505 36.635048 -91.658783Q37.949211 -91.959061 39.275532 -92.20002Q40.601849 -92.440956 41.937653 -92.622093Q43.273453 -92.803223 44.616047 -92.924194Q45.958633 -93.045151 47.305302 -93.105698Q48.65197 -93.166237 50 -93.166245Q51.348022 -93.166237 52.694687 -93.10569Q54.041359 -93.045151 55.383949 -92.924194Q56.726536 -92.803223 58.062336 -92.622093Q59.39814 -92.440956 60.724464 -92.20002Q62.050781 -91.959061 63.364937 -91.658783Q64.679092 -91.358505 65.978447 -90.999527Q67.277786 -90.640533 68.559708 -90.223549Q69.841614 -89.806564 71.103516 -89.332436Q72.365402 -88.858292 73.604729 -88.327957Q74.844055 -87.797623 76.058319 -87.212173Q77.272568 -86.626724 78.459305 -85.98732Q79.646042 -85.347931 80.802879 -84.655884Q81.959702 -83.963821 83.084274 -83.220512Q84.208847 -82.477203 85.298912 -81.684143Q86.388962 -80.891068 87.442307 -80.04985Q88.495651 -79.208626 89.510147 -78.320953Q90.524643 -77.433266 91.498238 -76.500923Q92.471848 -75.568573 93.402603 -74.593445Q94.333344 -73.618309 95.21936 -72.602356Q96.105385 -71.586411 96.944885 -70.5317Q97.784378 -69.476974 98.575653 -68.38562Q99.366928 -67.294258 100.1084 -66.168472Q100.84985 -65.042679 101.54002 -63.884724Q102.23017 -62.726768 102.86764 -61.538994Q103.50508 -60.351204 104.08855 -59.13599Q104.67201 -57.920776 105.20032 -56.680588Q105.72861 -55.440392 106.20068 -54.177723Q106.67274 -52.915054 107.08764 -51.632462Q107.50252 -50.349861 107.85937 -49.049927Q108.21623 -47.749989 108.51436 -46.435341Q108.81247 -45.120689 109.05125 -43.79398Q109.29002 -42.467266 109.46899 -41.131172Q109.64793 -39.795071 109.76669 -38.452286Q109.88544 -37.109497 109.94379 -35.762737Q110.00211 -34.41597 109.99991 -33.067944Q109.9977 -31.719917 109.93497 -30.373354Q109.87221 -29.026787 109.74905 -27.684395Q109.62589 -26.342003 109.44257 -25.0065Q109.25923 -23.670994 109.01611 -22.345072Q108.77299 -21.01915 108.47057 -19.705486Q108.16814 -18.391819 107.80702 -17.093061Q107.4459 -15.794302 107.02682 -14.513075Q106.60773 -13.231845 106.13154 -11.97073Q105.65533 -10.709616 105.12299 -9.4711618Q104.59061 -8.2327061 104.00317 -7.0194097Q103.41572 -5.8061132 102.77438 -4.6204243Q102.13303 -3.4347348 101.43909 -2.2790456Q100.74514 -1.1233566 100 0")
    test_sk_check_bounds(&p, 0xc1e82993, 0xc2e1c8c7, 0x431e0a65, 0x42e1c8c7)
    test_sk_check_last_point(&p, 0x42c80000, 0x0)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 50.0, 40.0, false, false)
    test_sk_check_contains(&p, 50.0, -40.0, true, true)

test "sk path: arc_rotated_scaled":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    test_sk_elliptical_arc_to(&p, 100.0, 50.0, 10.0, 5.0, 0.5, false, true)
    test_sk_check_svg(&p, "M0 0Q0.24120274 -0.64958292 0.54234207 -1.2682698Q0.84348142 -1.8869567 1.203832 -2.4732571Q1.5641825 -3.0595574 1.9828761 -3.6120586Q2.4015696 -4.1645603 2.8775976 -4.6819315Q3.3536255 -5.1993027 3.8858409 -5.6802983Q4.4180565 -6.161293 5.0051775 -6.6047535Q5.5922985 -7.0482135 6.2329102 -7.4530697Q6.8735228 -7.8579264 7.566082 -8.2232037Q8.2586422 -8.5884819 9.0014801 -8.9133005Q9.7443199 -9.2381191 10.535648 -9.521697Q11.326977 -9.805275 12.164889 -10.046927Q13.002801 -10.28858 13.885278 -10.487727Q14.767755 -10.686874 15.69267 -10.843034Q16.617586 -10.999194 17.582712 -11.111992Q18.547838 -11.224789 19.55085 -11.293952Q20.553862 -11.363115 21.592342 -11.388477Q22.630823 -11.413839 23.702271 -11.39534Q24.77372 -11.376841 25.875555 -11.314524Q26.977388 -11.252206 28.106953 -11.146221Q29.236521 -11.040236 30.391098 -10.890839Q31.545675 -10.741442 32.722481 -10.548993Q33.899284 -10.356544 35.095486 -10.121507Q36.291683 -9.8864689 37.504395 -9.6094093Q38.717106 -9.3323498 39.943409 -9.0139351Q41.169716 -8.6955204 42.406654 -8.3365183Q43.643593 -7.9775162 44.888191 -7.5787921Q46.132786 -7.1800671 47.382042 -6.7425795Q48.631294 -6.3050919 49.882195 -5.8298965Q51.133099 -5.354701 52.382637 -4.8429418Q53.632175 -4.3311825 54.877338 -3.7840929Q56.122505 -3.2370028 57.360291 -2.6559002Q58.59808 -2.0747976 59.825508 -1.4610825Q61.05294 -0.84736681 62.267056 -0.20251688Q63.481174 0.44233304 64.679054 1.1167638Q65.87693 1.7911944 67.055679 2.4935813Q68.234436 3.1959677 69.39122 3.9246185Q70.548004 4.6532688 71.680046 5.4064283Q72.812088 6.1595879 73.916649 6.935441Q75.02121 7.7112942 76.095634 8.5079727Q77.170059 9.3046503 78.211746 10.120234Q79.253441 10.935819 80.259895 11.768344Q81.266357 12.600868 82.235153 13.448329Q83.203949 14.29579 84.132744 15.156142Q85.061546 16.016495 85.948112 16.887671Q86.834686 17.758846 87.676872 18.638742Q88.519073 19.518641 89.314873 20.40514Q90.110672 21.291641 90.858162 22.182606Q91.605644 23.073574 92.303017 23.96686Q93.000381 24.860146 93.64595 25.753601Q94.291534 26.647057 94.883759 27.53853Q95.475967 28.43 96.013412 29.317341Q96.550858 30.204678 97.032227 31.085749Q97.513596 31.966818 97.937737 32.839497Q98.361877 33.712177 98.727768 34.574364Q99.093643 35.436546 99.400398 36.28616Q99.707146 37.135773 99.954025 37.970768Q100.2009 38.805763 100.38731 39.62413Q100.57372 40.442497 100.6992 41.24226Q100.82469 42.042023 100.88896 42.821262Q100.95323 43.600498 100.95612 44.35733Q100.95901 45.114162 100.90052 45.846764Q100.84203 46.579369 100.72231 47.28598Q100.60257 47.992588 100.42189 48.671501Q100.2412 49.350414 100 50")
    test_sk_check_bounds(&p, 0x0, 0xc1d3b049, 0x42dba6aa, 0x4298ec12)
    test_sk_check_last_point(&p, 0x42c80000, 0x42480000)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 50.0, 25.0, true, true)
    test_sk_check_contains(&p, 60.0, 10.0, true, true)

test "sk path: arc_rotated_large":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 3.5, 7.25)
    test_sk_elliptical_arc_to(&p, -40.0, 12.5, 30.0, 17.0, -1.2, true, false)
    test_sk_close(&p)
    test_sk_check_svg(&p, "M3.5 7.25Q3.6693845 6.4178305 3.812366 5.5898256Q3.9553475 4.7618203 4.0715823 3.9399743Q4.1878161 3.1181281 4.2770233 2.3044209Q4.36623 1.4907138 4.428195 0.68710601Q4.49016 -0.11650187 4.5247331 -0.9080745Q4.5593066 -1.6996472 4.5664053 -2.4772778Q4.5735035 -3.2549081 4.5531101 -4.0167232Q4.5327168 -4.7785378 4.4848804 -5.5227022Q4.4370441 -6.2668667 4.3618808 -6.9915872Q4.2867169 -7.7163081 4.1844068 -8.4198399Q4.0820961 -9.1233702 3.9528861 -9.8040161Q3.8236759 -10.484663 3.667877 -11.140785Q3.5120783 -11.796908 3.330066 -12.426927Q3.1480536 -13.056944 2.9402666 -13.65934Q2.7324796 -14.261735 2.499418 -14.835056Q2.2663565 -15.408378 2.0085821 -15.951244Q1.7508079 -16.494112 1.4689417 -17.005215Q1.1870756 -17.516319 0.88179666 -17.994429Q0.5765177 -18.472538 0.24856138 -18.916502Q-0.079394922 -19.360466 -0.4292385 -19.769215Q-0.77908206 -20.177963 -1.1499702 -20.550512Q-1.5208583 -20.923061 -1.9118973 -21.258512Q-2.3029363 -21.593964 -2.7131841 -21.891508Q-3.1234322 -22.189053 -3.5519009 -22.447975Q-3.9803696 -22.706898 -4.4260263 -22.926575Q-4.8716836 -23.146252 -5.3334556 -23.326153Q-5.7952271 -23.506054 -6.2720013 -23.645744Q-6.7487755 -23.785437 -7.2394032 -23.884583Q-7.730031 -23.98373 -8.2333307 -24.042091Q-8.7366304 -24.100454 -9.2513895 -24.117891Q-9.7661486 -24.135326 -10.291126 -24.111797Q-10.816105 -24.088268 -11.350037 -24.023829Q-11.883968 -23.959389 -12.42557 -23.854193Q-12.967171 -23.748997 -13.515135 -23.603302Q-14.063098 -23.457603 -14.616104 -23.271755Q-15.169112 -23.085909 -15.725831 -22.860359Q-16.282551 -22.634808 -16.841639 -22.3701Q-17.400726 -22.105391 -17.960838 -21.80216Q-18.52095 -21.498928 -19.080734 -21.157904Q-19.640518 -20.816881 -20.198627 -20.438889Q-20.756737 -20.060896 -21.311829 -19.646845Q-21.86692 -19.232794 -22.417654 -18.783682Q-22.968388 -18.334568 -23.513435 -17.851475Q-24.058487 -17.368382 -24.59654 -16.852474Q-25.134594 -16.336565 -25.664356 -15.789085Q-26.194117 -15.241604 -26.71431 -14.663868Q-27.234501 -14.086132 -27.74387 -13.479533Q-28.253239 -12.872936 -28.750561 -12.238937Q-29.247881 -11.604939 -29.731955 -10.945066Q-30.216028 -10.285194 -30.685688 -9.601038Q-31.155346 -8.9168816 -31.609459 -8.2100897Q-32.063572 -7.5032983 -32.501049 -6.7755733Q-32.938522 -6.0478487 -33.358307 -5.3009448Q-33.778091 -4.55404 -34.179169 -3.7897553Q-34.580242 -3.0254703 -34.961647 -2.2456462Q-35.343056 -1.4658221 -35.703873 -0.67233753Q-36.06469 0.12114695 -36.404053 0.92638046Q-36.743412 1.7316139 -37.060497 2.5466566Q-37.377579 3.3616991 -37.671623 4.1845875Q-37.965668 5.0074754 -38.235962 5.8362265Q-38.506256 6.664978 -38.752151 7.4975958Q-38.998047 8.3302145 -39.218956 9.1646938Q-39.439857 9.9991722 -39.635239 10.833502Q-39.830616 11.66783 -40 12.5L3.5 7.25Z")
    test_sk_check_bounds(&p, 0xc2200000, 0xc1d530cb, 0x4249998f, 0x421c9866)
    test_sk_check_last_point(&p, 0x40600000, 0x40e80000)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, -20.0, 0.0, true, true)
    test_sk_check_contains(&p, 0.0, 20.0, false, false)

test "sk path: arc_zero_radius":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    test_sk_elliptical_arc_to(&p, 10.0, 10.0, 0.0, 5.0, 0.0, false, false)
    test_sk_check_svg(&p, "M0 0L10 10")
    test_sk_check_bounds(&p, 0x0, 0x0, 0x41200000, 0x41200000)
    test_sk_check_last_point(&p, 0x41200000, 0x41200000)
    assert(sk_path_is_empty(&p.path) == false)

test "sk path: arc_same_point":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 3.0, 3.0)
    test_sk_elliptical_arc_to(&p, 3.0, 3.0, 5.0, 5.0, 0.0, false, false)
    test_sk_check_svg(&p, "M3 3L3 3")
    test_sk_check_bounds(&p, 0x40400000, 0x40400000, 0x0, 0x0)
    test_sk_check_last_point(&p, 0x40400000, 0x40400000)
    assert(sk_path_is_empty(&p.path) == false)

test "sk path: arc_tiny":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    test_sk_elliptical_arc_to(&p, 0.000001, 0.0, 1000.0, 1000.0, 0.0, false, true)
    # the arc's angle is the difference of two atan2 results a millionth of a radius apart:
    # macOS's atan2 makes it 0, a line; glibc's makes it a last-bit negative, which a clockwise
    # sweep turns into a whole circle less that bit (tests_sk_path's libm_ulps)
    # (the bounds follow from the points the SVG shows)
    if os.macos:
        test_sk_check_svg(&p, "M0 0L1e-06 0")
        test_sk_check_bounds(&p, 0x0, 0x0, 0x358637bd, 0x0)
    else:
        test_sk_check_svg(&p, "M0 0Q32.736618 2.2531142e-06 65.403137 2.1410816Q98.069664 4.2821612 130.52621 8.5551491Q162.98276 12.828137 195.09035 19.214737Q227.19794 25.601336 258.81906 34.074196Q290.44022 42.547058 321.43951 53.069901Q352.43878 63.592743 382.68344 76.120499Q412.92816 88.64827 442.28876 103.1273Q471.64929 117.60634 500 133.97464Q528.35077 150.34296 555.57031 168.53046Q582.78979 186.71794 608.76147 206.64673Q634.73322 226.57553 659.34595 248.16028Q683.95862 269.74503 707.10681 292.89331Q730.25513 316.04163 751.83984 340.6543Q773.42462 365.267 793.35339 391.23868Q813.28217 417.21039 831.4696 444.42987Q849.6571 471.64938 866.02539 500.00009Q882.39368 528.35089 896.87274 557.71149Q911.35181 587.07202 923.87952 617.31671Q936.40729 647.5614 946.93011 678.56067Q957.45294 709.55994 965.92578 741.18109Q974.39868 772.80225 980.78528 804.90985Q987.17188 837.01746 991.44482 869.474Q995.71777 901.93054 997.85883 934.59705Q999.99994 967.26355 999.99988 1000.0001Q999.99988 1032.7368 997.85883 1065.4033Q995.71777 1098.0698 991.44482 1130.5264Q987.17188 1162.9829 980.78528 1195.0906Q974.39868 1227.1982 965.92578 1258.8193Q957.45288 1290.4404 946.93005 1321.4397Q936.40723 1352.439 923.87939 1382.6836Q911.35168 1412.9283 896.87262 1442.2888Q882.39368 1471.6494 866.02533 1500.0001Q849.65704 1528.3508 831.4696 1555.5704Q813.2821 1582.7899 793.35327 1608.7616Q773.4245 1634.7334 751.83978 1659.3461Q730.255 1683.9587 707.10669 1707.1069Q683.9585 1730.2552 659.34576 1751.84Q634.73303 1773.4248 608.76129 1793.3535Q582.78961 1813.2822 555.57013 1831.4697Q528.35059 1849.6571 499.99982 1866.0254Q471.64911 1882.3938 442.28854 1896.8728Q412.92798 1911.3521 382.68329 1923.8798Q352.4386 1936.4075 321.43933 1946.9303Q290.44003 1957.4531 258.81888 1965.926Q227.19775 1974.3989 195.09015 1980.7855Q162.98257 1987.172 130.52602 1991.4448Q98.069473 1995.7178 65.402954 1997.859Q32.736435 2000 -0.00018310547 2000Q-32.736797 2000 -65.40332 1997.859Q-98.069839 1995.7179 -130.52638 1991.4449Q-162.98294 1987.172 -195.09053 1980.7854Q-227.19812 1974.3988 -258.81924 1965.9259Q-290.44037 1957.453 -321.43967 1946.9302Q-352.43896 1936.4072 -382.68362 1923.8795Q-412.92834 1911.3518 -442.28891 1896.8727Q-471.64948 1882.3937 -500.00018 1866.0253Q-528.35095 1849.657 -555.57043 1831.4695Q-582.78998 1813.2821 -608.76166 1793.3533Q-634.7334 1773.4246 -659.34607 1751.8397Q-683.95874 1730.255 -707.10699 1707.1067Q-730.25531 1683.9585 -751.84009 1659.3458Q-773.4248 1634.7332 -793.35352 1608.7614Q-813.28229 1582.7897 -831.46973 1555.5702Q-849.65723 1528.3506 -866.02551 1499.9998Q-882.3938 1471.6492 -896.8728 1442.2886Q-911.35193 1412.928 -923.87964 1382.6833Q-936.40741 1352.4387 -946.93024 1321.4395Q-957.45312 1290.4402 -965.92596 1258.819Q-974.39886 1227.1979 -980.78546 1195.0903Q-987.17206 1162.9827 -991.44501 1130.5261Q-995.71802 1098.0696 -997.85907 1065.4031Q-1000.0001 1032.7366 -1000.0001 999.99988Q-1000.0001 967.26331 -997.85907 934.5968Q-995.71802 901.9303 -991.44507 869.47375Q-987.17212 837.01727 -980.78546 804.90973Q-974.39893 772.80212 -965.92603 741.18097Q-957.45312 709.55981 -946.93036 678.56055Q-936.40747 647.56128 -923.8797 617.31659Q-911.35193 587.0719 -896.87286 557.7113Q-882.3938 528.35071 -866.02545 499.99994Q-849.65717 471.64923 -831.46967 444.42975Q-813.28223 417.21027 -793.35339 391.23853Q-773.42468 365.26685 -751.83997 340.65417Q-730.25519 316.0415 -707.10687 292.89319Q-683.95862 269.74493 -659.34589 248.16017Q-634.73322 226.57544 -608.76147 206.64664Q-582.78979 186.71786 -555.57031 168.53036Q-528.35077 150.3429 -500 133.97458Q-471.64929 117.60628 -442.28876 103.12724Q-412.92816 88.648224 -382.68344 76.120461Q-352.43878 63.592709 -321.43951 53.06987Q-290.44022 42.547035 -258.81906 34.074173Q-227.19794 25.601316 -195.09035 19.21472Q-162.98276 12.828125 -130.52621 8.5551386Q-98.069664 4.2821536 -65.403137 2.1410768Q-32.736618 0 1e-06 0")
    test_sk_check_last_point(&p, 0x358637bd, 0x0)
    assert(sk_path_is_empty(&p.path) == false)

test "sk path: arc_integers":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    test_sk_elliptical_arc_to(&p, 10.0, 10.0, 10.0, 10.0, 0.0, false, true)
    test_sk_elliptical_arc_to(&p, 0.0, 20.0, 10.0, 10.0, 0.0, false, true)
    test_sk_check_svg(&p, "M0 0Q0.24548623 0 0.49067676 0.012045437Q0.73586726 0.024090873 0.98017144 0.04815273Q1.2244756 0.072214581 1.4673047 0.10823488Q1.7101339 0.14425519 1.9509032 0.19214717Q2.1916723 0.24003914 2.4298017 0.29968742Q2.6679311 0.35933572 2.9028468 0.43059659Q3.1377625 0.50185746 3.3688984 0.58455926Q3.6000345 0.667261 3.8268342 0.76120454Q4.0536337 0.85514808 4.2755508 0.96010691Q4.497468 1.0650659 4.7139673 1.1807872Q4.9304667 1.2965086 5.141027 1.4227138Q5.3515878 1.5489187 5.5557022 1.6853036Q5.7598162 1.8216884 5.9569926 1.9679244Q6.1541691 2.1141605 6.3439331 2.2698953Q6.5336962 2.4256301 6.7155895 2.5904884Q6.8974829 2.755347 7.0710678 2.928932Q7.2446527 3.1025169 7.4095111 3.28441Q7.5743694 3.4663036 7.7301044 3.6560671Q7.8858385 3.8458304 8.032074 4.0430069Q8.1783104 4.2401829 8.3146954 4.4442973Q8.4510803 4.6484118 8.5772858 4.8589725Q8.7034912 5.0695333 8.8192129 5.2860327Q8.9349337 5.502532 9.0398922 5.7244482Q9.1448507 5.9463654 9.2387943 6.1731648Q9.3327389 6.3999643 9.4154406 6.6311007Q9.4981422 6.862237 9.5694036 7.0971532Q9.6406651 7.3320689 9.7003126 7.5701981Q9.7599602 7.8083277 9.8078518 8.0490971Q9.8557434 8.2898655 9.8917637 8.5326948Q9.9277849 8.7755241 9.951848 9.0198288Q9.9759102 9.2641325 9.9879551 9.5093231Q10 9.7545137 10 10Q10 10.245486 9.9879551 10.490677Q9.9759102 10.735868 9.951848 10.980172Q9.9277859 11.224476 9.8917646 11.467304Q9.8557444 11.710133 9.8078527 11.950903Q9.7599602 12.191671 9.7003126 12.429801Q9.6406651 12.667931 9.5694036 12.902846Q9.4981422 13.137762 9.4154406 13.368898Q9.3327389 13.600033 9.2387953 13.826833Q9.1448517 14.053633 9.0398932 14.275549Q8.9349346 14.497466 8.8192129 14.713966Q8.7034912 14.930466 8.5772867 15.141026Q8.4510813 15.351585 8.3146963 15.5557Q8.1783113 15.759815 8.0320759 15.956991Q7.8858395 16.154167 7.7301054 16.343931Q7.5743704 16.533695 7.4095116 16.715588Q7.2446527 16.897482 7.0710678 17.071068Q6.8974829 17.244652 6.7155895 17.409512Q6.5336962 17.574371 6.3439331 17.730106Q6.1541691 17.885841 5.9569926 18.032076Q5.7598162 18.17831 5.5557022 18.314695Q5.3515878 18.45108 5.1410275 18.577286Q4.9304667 18.703491 4.7139673 18.819212Q4.497468 18.934933 4.2755508 19.039892Q4.0536337 19.144852 3.8268342 19.238794Q3.6000345 19.332737 3.3688984 19.41544Q3.1377625 19.498142 2.9028468 19.569403Q2.6679311 19.640663 2.4298017 19.700314Q2.1916723 19.75996 1.9509032 19.807854Q1.7101339 19.855745 1.4673047 19.891766Q1.2244756 19.927788 0.98017144 19.951849Q0.73586726 19.97591 0.49067676 19.987955Q0.24548623 20 0 20")
    test_sk_check_bounds(&p, 0x0, 0x0, 0x41200000, 0x41a00000)
    test_sk_check_last_point(&p, 0x0, 0x41a00000)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 5.0, 10.0, true, true)
    test_sk_check_contains(&p, 9.0, 10.0, true, true)

test "sk path: arc_to":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    test_sk_elliptical_arc_to(&p, 50.0, 50.0, 25.0, 25.0, 0.0, true, false)
    test_sk_elliptical_arc_to(&p, 0.0, 0.0, 25.0, 25.0, 0.0, false, true)
    test_sk_check_svg(&p, "M0 0Q-0.61371553 0.61371577 -1.1965783 1.2568059Q-1.7794409 1.899896 -2.3300467 2.5708113Q-2.8806522 3.2417264 -3.3976743 3.9388499Q-3.9146962 4.6359739 -4.3968892 5.3576269Q-4.8790827 6.0792799 -5.325285 6.8237243Q-5.7714872 7.5681686 -6.1806245 8.3336105Q-6.5897613 9.0990515 -6.9608464 9.883646Q-7.3319321 10.668241 -7.664072 11.470098Q-7.996213 12.271957 -8.2886076 13.089147Q-8.5810032 13.906336 -8.8329487 14.736889Q-9.0848942 15.56744 -9.2957821 16.409355Q-9.50667 17.251268 -9.675993 18.102518Q-9.8453169 18.953766 -9.9726677 19.812298Q-10.100019 20.67083 -10.185091 21.534575Q-10.270163 22.398319 -10.31275 23.2652Q-10.355336 24.132078 -10.355336 25.000004Q-10.355336 25.867928 -10.31275 26.734808Q-10.270163 27.601688 -10.185091 28.465435Q-10.100019 29.329178 -9.9726677 30.18771Q-9.8453159 31.046238 -9.675992 31.897486Q-9.5066681 32.748734 -9.2957802 33.590649Q-9.0848923 34.432564 -8.8329468 35.263115Q-8.5810013 36.093666 -8.2886047 36.910858Q-7.9962101 37.728046 -7.6640697 38.529903Q-7.3319292 39.33176 -6.9608436 40.116356Q-6.5897579 40.900948 -6.1806211 41.666393Q-5.7714839 42.431831 -5.3252811 43.176277Q-4.8790784 43.920723 -4.3968849 44.642376Q-3.9146917 45.364029 -3.3976693 46.061153Q-2.8806469 46.758278 -2.3300412 47.429195Q-1.7794352 48.100109 -1.1965723 48.743198Q-0.61370939 49.386288 6.3220273e-06 50.000004Q0.61372215 50.613716 1.2568123 51.196583Q1.8999025 51.779446 2.5708177 52.330051Q3.2417331 52.880657 3.9388568 53.397678Q4.6359806 53.9147 5.3576341 54.396893Q6.0792875 54.879086 6.8237319 55.325291Q7.5681763 55.771492 8.3336182 56.180634Q9.0990591 56.589767 9.8836536 56.96085Q10.668248 57.331932 11.470106 57.664074Q12.271965 57.996216 13.089154 58.288612Q13.906343 58.581005 14.736896 58.832951Q15.567448 59.084892 16.409361 59.295784Q17.251274 59.506668 18.102524 59.675995Q18.95377 59.845322 19.812302 59.972672Q20.670834 60.100021 21.53458 60.185097Q22.398325 60.270164 23.265205 60.312752Q24.132082 60.355339 25.000008 60.355339Q25.867931 60.355339 26.73481 60.312748Q27.601692 60.270164 28.465439 60.185097Q29.329182 60.100021 30.187714 59.972672Q31.046244 59.845322 31.897491 59.675995Q32.748741 59.506668 33.590652 59.295784Q34.432564 59.084892 35.263119 58.832951Q36.093666 58.581001 36.910858 58.288609Q37.72805 57.996208 38.529907 57.66407Q39.331764 57.331932 40.116356 56.960846Q40.900955 56.589764 41.666397 56.18063Q42.431839 55.771492 43.176281 55.325291Q43.920723 54.879086 44.642376 54.396893Q45.364029 53.9147 46.06115 53.397678Q46.758278 52.880653 47.429192 52.330048Q48.100105 51.779442 48.743195 51.196579Q49.386284 50.613716 50 50Q49.386284 50.613716 48.743195 51.196579Q48.100105 51.779442 47.429192 52.330051Q46.758274 52.880657 46.06115 53.397678Q45.364025 53.9147 44.642372 54.396893Q43.920715 54.879086 43.176273 55.325291Q42.431831 55.771492 41.666393 56.180634Q40.900948 56.589767 40.116352 56.96085Q39.331757 57.331932 38.5299 57.664074Q37.728043 57.996216 36.910851 58.288612Q36.093658 58.581005 35.263111 58.832951Q34.432556 59.084892 33.590645 59.295784Q32.74873 59.506668 31.897482 59.675995Q31.046234 59.845322 30.187704 59.972672Q29.329174 60.100021 28.465431 60.185097Q27.601685 60.270164 26.734802 60.312752Q25.867924 60.355339 25 60.355339Q24.132074 60.355339 23.265194 60.312748Q22.398317 60.270164 21.534573 60.185097Q20.670826 60.100021 19.812294 59.972672Q18.953762 59.845322 18.102516 59.675995Q17.251266 59.506668 16.409353 59.295784Q15.567439 59.084892 14.736887 58.832951Q13.906335 58.581001 13.089145 58.288609Q12.271955 57.996208 11.470098 57.66407Q10.66824 57.331932 9.883646 56.960846Q9.0990515 56.589764 8.3336105 56.18063Q7.5681686 55.771492 6.8237247 55.325291Q6.0792809 54.879086 5.3576274 54.396893Q4.6359744 53.9147 3.9388509 53.397678Q3.2417271 52.880657 2.5708122 52.330051Q1.8998973 51.779446 1.2568073 51.196583Q0.61371762 50.613716 2.1073424e-06 50.000004Q-0.6137135 49.386288 -1.1965762 48.743198Q-1.779439 48.100109 -2.3300447 47.429195Q-2.8806505 46.758278 -3.3976727 46.06115Q-3.9146948 45.364029 -4.3968878 44.642372Q-4.8790808 43.920715 -5.325284 43.176273Q-5.7714863 42.431831 -6.1806235 41.666393Q-6.5897603 40.900948 -6.9608459 40.116352Q-7.3319311 39.331757 -7.6640716 38.5299Q-7.996212 37.728043 -8.2886076 36.910851Q-8.5810032 36.093658 -8.8329487 35.263107Q-9.0848942 34.432556 -9.2957821 33.590645Q-9.50667 32.74873 -9.675993 31.89748Q-9.8453178 31.046232 -9.9726686 30.187702Q-10.10002 29.32917 -10.185092 28.465427Q-10.270164 27.601681 -10.31275 26.7348Q-10.355337 25.86792 -10.355337 24.999996Q-10.355337 24.132071 -10.312751 23.265192Q-10.270164 22.398312 -10.185093 21.534567Q-10.100021 20.670822 -9.9726696 19.81229Q-9.8453178 18.953758 -9.6759939 18.10251Q-9.50667 17.251263 -9.2957821 16.409348Q-9.0848942 15.567434 -8.8329496 14.736883Q-8.5810032 13.906331 -8.2886086 13.089142Q-7.996213 12.271953 -7.6640725 11.470095Q-7.3319321 10.668238 -6.9608469 9.8836422Q-6.5897613 9.0990486 -6.1806245 8.3336067Q-5.7714872 7.5681658 -5.325285 6.8237214Q-4.8790827 6.079278 -4.3968892 5.3576245Q-3.9146962 4.635972 -3.3976743 3.9388483Q-2.8806522 3.2417247 -2.3300467 2.5708098Q-1.7794409 1.899895 -1.1965783 1.2568052Q-0.61371553 0.61371541 0 0")
    test_sk_check_bounds(&p, 0xc1c7ffff, 0x0, 0x42960000, 0x42960001)
    test_sk_check_last_point(&p, 0x0, 0x0)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 25.0, 25.0, false, false)
    test_sk_check_contains(&p, 10.0, 40.0, false, false)

test "sk path: circle":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 50.0)
    test_sk_elliptical_arc_to(&p, 100.0, 50.0, 50.0, 50.0, 0.0, false, true)
    test_sk_elliptical_arc_to(&p, 0.0, 50.0, 50.0, 50.0, 0.0, false, true)
    test_sk_close(&p)
    test_sk_check_svg(&p, "M0 50Q0 48.772568 0.060227197 47.546619Q0.12045439 46.320667 0.24076371 45.099148Q0.36107302 43.877625 0.54117453 42.663479Q0.72127616 41.449333 0.9607361 40.245487Q1.200196 39.041641 1.4984375 37.850994Q1.796679 36.660347 2.1529837 35.485771Q2.5092881 34.311192 2.9227972 33.15551Q3.3363061 31.999828 3.8060238 30.865831Q4.2757416 29.731833 4.8005357 28.622248Q5.3253303 27.512663 5.9039373 26.430166Q6.4825444 25.347668 7.1135702 24.294865Q7.7445965 23.242062 8.4265203 22.221489Q9.1084442 21.200916 9.8396244 20.215034Q10.570805 19.229153 11.349479 18.280338Q12.128153 17.33152 12.952445 16.422054Q13.776737 15.512587 14.644662 14.644662Q15.512587 13.776737 16.422054 12.952444Q17.33152 12.128153 18.280338 11.349479Q19.229153 10.570805 20.215034 9.8396244Q21.200916 9.1084442 22.221489 8.4265203Q23.242062 7.7445965 24.294865 7.1135707Q25.347668 6.4825449 26.430166 5.9039378Q27.512661 5.3253307 28.622246 4.8005362Q29.731831 4.2757416 30.865829 3.8060238Q31.999828 3.3363061 33.15551 2.9227972Q34.311188 2.5092881 35.485767 2.1529837Q36.660347 1.796679 37.85099 1.4984376Q39.041637 1.200196 40.245483 0.9607361Q41.449333 0.72127616 42.663475 0.54117459Q43.877625 0.36107302 45.099144 0.24076371Q46.320663 0.12045439 47.546616 0.060227197Q48.772568 0 50 0Q51.227432 0 52.453384 0.060227197Q53.679337 0.12045439 54.90086 0.24076371Q56.122379 0.36107302 57.336525 0.54117453Q58.550667 0.72127616 59.754513 0.9607361Q60.958359 1.200196 62.149006 1.4984375Q63.339653 1.796679 64.514236 2.1529837Q65.688812 2.5092881 66.84449 2.9227972Q68.000168 3.3363061 69.134171 3.8060238Q70.268173 4.2757416 71.377754 4.8005357Q72.487335 5.3253303 73.569839 5.9039373Q74.652328 6.4825444 75.705132 7.1135702Q76.757935 7.7445965 77.778503 8.4265203Q78.799072 9.1084442 79.784966 9.8396244Q80.770844 10.570805 81.719666 11.349479Q82.668488 12.128153 83.57795 12.952445Q84.487411 13.776737 85.355339 14.644662Q86.223267 15.512587 87.047554 16.422054Q87.871849 17.33152 88.650528 18.280338Q89.429199 19.229153 90.160378 20.215034Q90.891556 21.200916 91.573479 22.221489Q92.255402 23.242062 92.886429 24.294865Q93.517456 25.347668 94.096069 26.430166Q94.674667 27.512661 95.199463 28.622246Q95.724251 29.731831 96.19397 30.865829Q96.663681 31.999828 97.077194 33.15551Q97.490707 34.311188 97.847015 35.485767Q98.203323 36.660347 98.501556 37.85099Q98.799805 39.041637 99.039261 40.245483Q99.278725 41.449333 99.458824 42.663475Q99.638924 43.877625 99.759232 45.099144Q99.879539 46.320663 99.939774 47.546616Q100 48.772568 100 50Q100 51.227432 99.939774 52.453384Q99.879547 53.679337 99.759239 54.90086Q99.638931 56.122379 99.458824 57.336525Q99.278725 58.550667 99.039261 59.754513Q98.799805 60.958359 98.501564 62.149006Q98.203323 63.339653 97.847015 64.514236Q97.490707 65.688812 97.077194 66.84449Q96.663681 68.000168 96.19397 69.134171Q95.724251 70.268173 95.199463 71.377754Q94.674667 72.487343 94.096062 73.569839Q93.517456 74.652336 92.886429 75.705139Q92.255409 76.757935 91.573486 77.778511Q90.891556 78.799088 90.160378 79.784966Q89.429199 80.770851 88.650528 81.719666Q87.871849 82.668488 87.047554 83.57795Q86.223267 84.487411 85.355339 85.355339Q84.487411 86.223267 83.57795 87.047554Q82.668488 87.871849 81.719666 88.650528Q80.770851 89.429199 79.784966 90.160378Q78.799088 90.891556 77.778511 91.573479Q76.757935 92.255402 75.705139 92.886429Q74.652336 93.517456 73.569839 94.096069Q72.487343 94.674667 71.377762 95.199463Q70.268173 95.724251 69.134171 96.19397Q68.000168 96.663681 66.844498 97.077194Q65.688812 97.490707 64.514236 97.847015Q63.339653 98.203323 62.14901 98.501556Q60.958359 98.799805 59.754513 99.039261Q58.550667 99.278725 57.336521 99.458824Q56.122375 99.638924 54.900856 99.759232Q53.679337 99.879539 52.453384 99.939774Q51.227432 100 50 100Q48.772568 100 47.546616 99.939774Q46.320663 99.879547 45.099144 99.759239Q43.877621 99.638931 42.663471 99.458824Q41.449326 99.278725 40.24548 99.039261Q39.041634 98.799805 37.85099 98.501564Q36.660339 98.203323 35.485764 97.847015Q34.311188 97.490707 33.155506 97.077194Q31.999825 96.663681 30.865826 96.19397Q29.731827 95.724251 28.622242 95.199463Q27.512659 94.674667 26.430164 94.096062Q25.347664 93.517456 24.294861 92.886429Q23.242058 92.255409 22.221487 91.573486Q21.200916 90.891556 20.215034 90.160378Q19.229153 89.429199 18.280336 88.650528Q17.331518 87.871849 16.422052 87.047554Q15.512585 86.223267 14.64466 85.355339Q13.776735 84.487411 12.952443 83.57795Q12.128151 82.668488 11.349478 81.719666Q10.570803 80.770851 9.8396225 79.784966Q9.1084423 78.799088 8.4265184 77.778511Q7.7445946 76.757935 7.1135688 75.705139Q6.482543 74.652336 5.9039364 73.569839Q5.3253293 72.487343 4.8005352 71.377762Q4.2757406 70.268173 3.8060229 69.134171Q3.3363054 68.000168 2.9227965 66.844498Q2.5092874 65.688812 2.152983 64.514236Q1.7966785 63.339653 1.498437 62.14901Q1.2001958 60.958359 0.96073586 59.754513Q0.72127593 58.550667 0.54117441 57.336521Q0.36107293 56.122375 0.24076365 54.900856Q0.12045436 53.679337 0.060227182 52.453384Q0 51.227432 0 50Z")
    test_sk_check_bounds(&p, 0x0, 0x0, 0x42c80000, 0x42c80000)
    test_sk_check_last_point(&p, 0x0, 0x42480000)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 50.0, 50.0, true, true)
    test_sk_check_contains(&p, 0.0, 50.0, true, true)
    test_sk_check_contains(&p, 50.0, 0.0, true, true)
    test_sk_check_contains(&p, 50.0, 100.0, true, true)
    test_sk_check_contains(&p, 100.0, 50.0, true, true)
    test_sk_check_contains(&p, 99.9, 50.0, true, true)
    test_sk_check_contains(&p, 85.0, 85.0, true, true)
    test_sk_check_contains(&p, 86.0, 86.0, false, false)

test "sk path: hv":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 1.0, 2.0)
    test_sk_horizontal_line_to(&p, 7.0)
    test_sk_vertical_line_to(&p, 9.0)
    test_sk_horizontal_line_to(&p, 1.0)
    test_sk_close(&p)
    test_sk_check_svg(&p, "M1 2L7 2L7 9L1 9L1 2Z")
    test_sk_check_bounds(&p, 0x3f800000, 0x40000000, 0x40c00000, 0x40e00000)
    test_sk_check_last_point(&p, 0x3f800000, 0x40000000)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 3.0, 3.0, true, true)

test "sk path: offset":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    sk_path_line_to(&p.path, 10.0, 10.0)
    sk_path_quad_to(&p.path, 20.0, 0.0, 30.0, 10.0)
    test_sk_close(&p)
    sk_path_offset(&p.path, 5.5, -3.25)
    test_sk_check_svg(&p, "M5.5 -3.25L15.5 6.75Q25.5 -3.25 35.5 6.75L5.5 -3.25Z")
    test_sk_check_bounds(&p, 0x40b00000, 0xc0500000, 0x41f00000, 0x41200000)
    test_sk_check_last_point(&p, 0x40b00000, 0xc0500000)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 10.0, 5.0, false, false)

test "sk path: transform_affine":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    sk_path_line_to(&p.path, 10.0, 0.0)
    sk_path_cubic_to(&p.path, 10.0, 5.0, 5.0, 10.0, 0.0, 10.0)
    test_sk_close(&p)
    test_sk_transform(&p, 0.8, 0.6, -0.6, 0.8, 10.0, 20.0)
    test_sk_check_svg(&p, "M10 20L18 26C15 30 8 31 4 28L10 20Z")
    test_sk_check_bounds(&p, 0x40800000, 0x41a00000, 0x41600000, 0x41300000)
    test_sk_check_last_point(&p, 0x41200000, 0x41a00000)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 10.0, 25.0, true, true)
    test_sk_check_contains(&p, 12.0, 22.0, true, true)

test "sk path: transform_scale":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 1.0, 1.0)
    sk_path_quad_to(&p.path, 5.0, 0.0, 3.0, 3.0)
    test_sk_elliptical_arc_to(&p, 0.0, 5.0, 4.0, 4.0, 0.0, false, true)
    test_sk_transform(&p, 2.0, 0.0, 0.0, 3.0, 0.0, 0.0)
    test_sk_check_svg(&p, "M2 3Q10 0 6 9Q5.8847752 9.3052177 5.7578626 9.5998192Q5.63095 9.8944197 5.4927816 10.177399Q5.3546143 10.460378 5.2056632 10.730768Q5.0567122 11.001158 4.8974867 11.258036Q4.7382612 11.514915 4.5693045 11.757404Q4.4003477 11.999893 4.2222371 12.227165Q4.0441265 12.454437 3.8574705 12.665717Q3.6708145 12.876997 3.4762497 13.071562Q3.2816849 13.266127 3.0798759 13.443312Q2.878067 13.620498 2.669703 13.779699Q2.461339 13.938902 2.2471316 14.079576Q2.0329239 14.220251 1.8136044 14.341918Q1.5942848 14.463585 1.3706019 14.565828Q1.146919 14.668073 0.91963673 14.750544Q0.6923545 14.833015 0.46224886 14.895432Q0.23214327 14.95785 0 15")
    test_sk_check_bounds(&p, 0x0, 0x0, 0x41200000, 0x41700000)
    test_sk_check_last_point(&p, 0x0, 0x41700000)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 4.0, 6.0, true, true)

test "sk path: transform_translate":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 1.0, 1.0)
    sk_path_line_to(&p.path, 4.0, 4.0)
    test_sk_transform(&p, 1.0, 0.0, 0.0, 1.0, -7.0, 2.5)
    test_sk_check_svg(&p, "M-6 3.5L-3 6.5")
    test_sk_check_bounds(&p, 0xc0c00000, 0x40600000, 0x40400000, 0x40400000)
    test_sk_check_last_point(&p, 0xc0400000, 0x40d00000)
    assert(sk_path_is_empty(&p.path) == false)

test "sk path: append":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    sk_path_line_to(&p.path, 10.0, 0.0)
    sk_path_line_to(&p.path, 10.0, 10.0)
    test_sk_close(&p)
    var sub0 = test_sk_gfx_path()
    test_sk_move_to(&sub0, 20.0, 20.0)
    sk_path_quad_to(&sub0.path, 30.0, 20.0, 30.0, 30.0)
    test_sk_elliptical_arc_to(&sub0, 40.0, 40.0, 5.0, 5.0, 0.0, false, true)
    test_sk_append(&p.path, &sub0.path)
    test_sk_check_svg(&p, "M0 0L10 0L10 10L0 0ZM0 0M20 20Q30 20 30 30Q30.122742 29.877258 30.251362 29.760685Q30.37998 29.644112 30.514164 29.533991Q30.648346 29.42387 30.787771 29.320465Q30.927197 29.21706 31.071526 29.120621Q31.215857 29.024181 31.364746 28.934942Q31.513634 28.845703 31.666721 28.763876Q31.819809 28.682047 31.976728 28.607828Q32.133644 28.533611 32.294018 28.467182Q32.454391 28.400753 32.617828 28.342278Q32.781269 28.283798 32.94738 28.23341Q33.113487 28.183022 33.281872 28.140842Q33.450253 28.098665 33.620502 28.0648Q33.790752 28.030937 33.96246 28.005466Q34.134163 27.979996 34.306915 27.962982Q34.47966 27.945969 34.653038 27.93745Q34.826416 27.928932 35 27.928932Q35.173584 27.928932 35.346962 27.93745Q35.520336 27.945969 35.693085 27.962982Q35.865829 27.979996 36.037537 28.005466Q36.209244 28.030937 36.379494 28.0648Q36.549744 28.098665 36.718128 28.140844Q36.886513 28.183022 37.052624 28.233414Q37.218735 28.283802 37.382172 28.342281Q37.545609 28.400761 37.705978 28.467188Q37.866348 28.533615 38.02327 28.607834Q38.180191 28.682053 38.333282 28.76388Q38.48637 28.845707 38.635258 28.934948Q38.784149 29.024189 38.928478 29.120626Q39.072807 29.217064 39.212234 29.320471Q39.351662 29.423874 39.485844 29.533997Q39.620026 29.644117 39.748642 29.760689Q39.877258 29.877262 40.000004 30.000006Q40.122749 30.122749 40.239319 30.251366Q40.355892 30.379986 40.466015 30.51417Q40.576134 30.648352 40.679535 30.787777Q40.782936 30.9272 40.879375 31.071529Q40.975815 31.21586 41.065056 31.36475Q41.154297 31.513638 41.236126 31.666727Q41.317951 31.819815 41.39217 31.97673Q41.466385 32.133652 41.532814 32.294022Q41.599239 32.454391 41.657719 32.617832Q41.716198 32.781269 41.76659 32.94738Q41.816978 33.113487 41.859154 33.281872Q41.901329 33.450253 41.935196 33.620502Q41.969059 33.790752 41.99453 33.96246Q42.020004 34.134163 42.037018 34.306915Q42.054031 34.47966 42.06255 34.653038Q42.071064 34.826416 42.071064 35Q42.07106 35.173584 42.062546 35.346962Q42.054028 35.520336 42.037014 35.693085Q42.019997 35.865829 41.994526 36.037537Q41.969055 36.209244 41.935192 36.379494Q41.901329 36.549744 41.859154 36.718128Q41.816975 36.886513 41.766586 37.052624Q41.716194 37.218735 41.657715 37.382172Q41.599236 37.545609 41.53281 37.705978Q41.466385 37.866348 41.392166 38.02327Q41.317951 38.180187 41.236126 38.333279Q41.154297 38.486366 41.065056 38.635254Q40.975815 38.784142 40.879375 38.928474Q40.782936 39.072807 40.679535 39.212234Q40.57613 39.351658 40.466011 39.48584Q40.355888 39.620026 40.239315 39.748642Q40.122742 39.877258 40 40")
    test_sk_check_bounds(&p, 0x0, 0x0, 0x42340000, 0x42200000)
    test_sk_check_last_point(&p, 0x42200000, 0x42200000)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 8.0, 2.0, true, true)
    test_sk_check_contains(&p, 29.0, 25.0, true, true)

test "sk path: append_to_empty":
    var p = test_sk_gfx_path()
    var sub0 = test_sk_gfx_path()
    test_sk_move_to(&sub0, 1.0, 2.0)
    sk_path_line_to(&sub0.path, 3.0, 4.0)
    test_sk_close(&sub0)
    test_sk_append(&p.path, &sub0.path)
    sk_path_line_to(&p.path, 9.0, 9.0)
    test_sk_check_svg(&p, "M1 2L3 4L1 2ZM1 2L9 9")
    test_sk_check_bounds(&p, 0x3f800000, 0x40000000, 0x41000000, 0x40e00000)
    test_sk_check_last_point(&p, 0x41100000, 0x41100000)
    assert(sk_path_is_empty(&p.path) == false)

test "sk path: append_self":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    sk_path_line_to(&p.path, 10.0, 0.0)
    sk_path_line_to(&p.path, 5.0, 8.0)
    test_sk_close(&p)
    test_sk_append(&p.path, &p.path)
    sk_path_offset(&p.path, 1.0, 1.0)
    test_sk_check_svg(&p, "M1 1L11 1L6 9L1 1ZM1 1M1 1L11 1L6 9L1 1Z")
    test_sk_check_bounds(&p, 0x3f800000, 0x3f800000, 0x41200000, 0x41000000)
    test_sk_check_last_point(&p, 0x3f800000, 0x3f800000)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 5.0, 2.0, true, false)

test "sk path: append_after_move":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 7.0, 7.0)
    var sub0 = test_sk_gfx_path()
    test_sk_move_to(&sub0, 1.0, 2.0)
    sk_path_line_to(&sub0.path, 3.0, 4.0)
    test_sk_append(&p.path, &sub0.path)
    test_sk_check_svg(&p, "M1 2L3 4")
    test_sk_check_bounds(&p, 0x3f800000, 0x40000000, 0x40000000, 0x40000000)
    test_sk_check_last_point(&p, 0x40400000, 0x40800000)
    assert(sk_path_is_empty(&p.path) == false)

test "sk path: bounds_empty":
    var p = test_sk_gfx_path()
    test_sk_check_svg(&p, "")
    test_sk_check_bounds(&p, 0x0, 0x0, 0x0, 0x0)
    test_sk_check_last_point(&p, 0x0, 0x0)
    assert(sk_path_is_empty(&p.path) == true)
    test_sk_check_contains(&p, 0.0, 0.0, false, false)

test "sk path: bounds_nan":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    sk_path_line_to(&p.path, math32.nan, 5.0)
    sk_path_line_to(&p.path, 3.0, math32.infinity)
    test_sk_check_svg(&p, "M0 0Lnan 5Lnan inf")
    test_sk_check_bounds(&p, 0x0, 0x0, 0x0, 0x0)
    test_sk_check_last_point(&p, 0x40400000, 0x7f800000)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 1.0, 1.0, false, false)

test "sk path: format_edges":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0000001, 123456789.0)
    sk_path_line_to(&p.path, 1234567.25, 0.1)
    sk_path_line_to(&p.path, -0.0, 340000000000000000000000000000000000000.0)
    sk_path_line_to(&p.path, 1e20, 1e-20)
    sk_path_line_to(&p.path, -math32.infinity, math32.infinity)
    sk_path_line_to(&p.path, 0.30000001, 2.5e-45)
    test_sk_check_svg(&p, "M1e-07 1.2345679e+08L1234567.2 0.1L-0 3.4e+38L1e+20 9.9999997e-21L-inf infLnan nan")
    test_sk_check_bounds(&p, 0x0, 0x0, 0x0, 0x0)
    test_sk_check_last_point(&p, 0x3e99999a, 0x2)
    assert(sk_path_is_empty(&p.path) == false)

test "sk path: format_more":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, -1.5, 1234.5678)
    sk_path_line_to(&p.path, 99999999.0, 0.000012345678)
    sk_path_line_to(&p.path, 16777217.0, -0.001)
    test_sk_check_svg(&p, "M-1.5 1234.5677L1e+08 1.2345678e-05L16777216 -0.001")
    test_sk_check_bounds(&p, 0xbfc00000, 0xba83126f, 0x4cbebc20, 0x449a5233)
    test_sk_check_last_point(&p, 0x4b800000, 0xba83126f)
    assert(sk_path_is_empty(&p.path) == false)

test "sk path: evenodd_nested":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    sk_path_line_to(&p.path, 100.0, 0.0)
    sk_path_line_to(&p.path, 100.0, 100.0)
    sk_path_line_to(&p.path, 0.0, 100.0)
    test_sk_close(&p)
    test_sk_move_to(&p, 25.0, 25.0)
    sk_path_line_to(&p.path, 75.0, 25.0)
    sk_path_line_to(&p.path, 75.0, 75.0)
    sk_path_line_to(&p.path, 25.0, 75.0)
    test_sk_close(&p)
    test_sk_check_svg(&p, "M0 0L100 0L100 100L0 100L0 0ZM25 25L75 25L75 75L25 75L25 25Z")
    test_sk_check_bounds(&p, 0x0, 0x0, 0x42c80000, 0x42c80000)
    test_sk_check_last_point(&p, 0x41c80000, 0x41c80000)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 50.0, 50.0, true, false)
    test_sk_check_contains(&p, 10.0, 10.0, true, true)
    test_sk_check_contains(&p, 25.0, 25.0, true, true)
    test_sk_check_contains(&p, 50.0, 25.0, true, true)
    test_sk_check_contains(&p, 0.0, 50.0, true, true)
    test_sk_check_contains(&p, 100.0, 50.0, true, true)
    test_sk_check_contains(&p, 101.0, 50.0, false, false)

test "sk path: reverse_nested":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    sk_path_line_to(&p.path, 100.0, 0.0)
    sk_path_line_to(&p.path, 100.0, 100.0)
    sk_path_line_to(&p.path, 0.0, 100.0)
    test_sk_close(&p)
    test_sk_move_to(&p, 25.0, 25.0)
    sk_path_line_to(&p.path, 25.0, 75.0)
    sk_path_line_to(&p.path, 75.0, 75.0)
    sk_path_line_to(&p.path, 75.0, 25.0)
    test_sk_close(&p)
    test_sk_check_svg(&p, "M0 0L100 0L100 100L0 100L0 0ZM25 25L25 75L75 75L75 25L25 25Z")
    test_sk_check_bounds(&p, 0x0, 0x0, 0x42c80000, 0x42c80000)
    test_sk_check_last_point(&p, 0x41c80000, 0x41c80000)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 50.0, 50.0, false, false)
    test_sk_check_contains(&p, 10.0, 10.0, true, true)
    test_sk_check_contains(&p, 25.0, 50.0, true, true)

test "sk path: cubic_loop":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    sk_path_cubic_to(&p.path, 100.0, 100.0, -50.0, 100.0, 50.0, 0.0)
    test_sk_close(&p)
    test_sk_check_svg(&p, "M0 0C100 100 -50 100 50 0L0 0Z")
    test_sk_check_bounds(&p, 0xc2480000, 0x0, 0x43160000, 0x42c80000)
    test_sk_check_last_point(&p, 0x0, 0x0)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 10.0, 30.0, false, false)
    test_sk_check_contains(&p, 25.0, 60.0, true, true)
    test_sk_check_contains(&p, 0.0, 0.0, true, true)
    test_sk_check_contains(&p, 25.0, 0.0, true, true)
    test_sk_check_contains(&p, -5.0, 5.0, false, false)
    test_sk_check_contains(&p, 20.0, 40.0, true, true)

test "sk path: coincident":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    sk_path_line_to(&p.path, 10.0, 0.0)
    sk_path_line_to(&p.path, 10.0, 10.0)
    test_sk_close(&p)
    test_sk_move_to(&p, 10.0, 0.0)
    sk_path_line_to(&p.path, 20.0, 0.0)
    sk_path_line_to(&p.path, 10.0, 10.0)
    test_sk_close(&p)
    test_sk_check_svg(&p, "M0 0L10 0L10 10L0 0ZM10 0L20 0L10 10L10 0Z")
    test_sk_check_bounds(&p, 0x0, 0x0, 0x41a00000, 0x41200000)
    test_sk_check_last_point(&p, 0x41200000, 0x0)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 10.0, 5.0, true, true)
    test_sk_check_contains(&p, 10.0, 0.0, true, true)
    test_sk_check_contains(&p, 15.0, 0.0, true, true)

test "sk path: quad_extrema":
    var p = test_sk_gfx_path()
    test_sk_move_to(&p, 0.0, 0.0)
    sk_path_quad_to(&p.path, 50.0, 100.0, 100.0, 0.0)
    sk_path_quad_to(&p.path, 50.0, -100.0, 0.0, 0.0)
    test_sk_check_svg(&p, "M0 0Q50 100 100 0Q50 -100 0 0")
    test_sk_check_bounds(&p, 0x0, 0xc2c80000, 0x42c80000, 0x43480000)
    test_sk_check_last_point(&p, 0x0, 0x0)
    assert(sk_path_is_empty(&p.path) == false)
    test_sk_check_contains(&p, 50.0, 40.0, true, true)
    test_sk_check_contains(&p, 50.0, 49.0, true, true)
    test_sk_check_contains(&p, 50.0, 51.0, false, false)
    test_sk_check_contains(&p, 50.0, -40.0, true, true)
    test_sk_check_contains(&p, 2.0, 0.0, true, true)