forked from google/skia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pathops_visualizer.htm
3962 lines (3827 loc) · 170 KB
/
pathops_visualizer.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<html>
<head>
<div height="0" hidden="true">
<div id="battleOp183">
seg=1 {{{6.31801322e-006f, -60}, {0, -83}}}
seg=2 {{{0, -83}, {32.0712242f, -83}, {61.2726326f, -64.5230865f}, {75.0056381f, -35.5408783f}}}
seg=3 {{{75.0056381f, -35.5408783f}, {88.7386475f, -6.55867052f}, {84.545517f, 27.7420006f}, {64.2353287f, 52.562561f}}}
seg=4 {{{64.2353287f, 52.562561f}, {60.2773972f, 57.3994484f}, {55.7858162f, 61.773819f}, {50.8459854f, 65.6024933f}}}
seg=5 {{{50.8459854f, 65.6024933f}, {36.756134f, 47.423481f}}}
seg=6 {{{36.756134f, 47.423481f}, {40.3270988f, 44.6557693f}, {43.5740242f, 41.493576f}, {46.4351768f, 37.9970322f}}}
seg=7 {{{46.4351768f, 37.9970322f}, {61.1172447f, 20.0544662f}, {64.1484222f, -4.74120331f}, {54.2209473f, -25.6921959f}}}
seg=8 {{{54.2209473f, -25.6921959f}, {44.2934723f, -46.6431847f}, {23.1840267f, -60}, {6.31801322e-006f, -60}}}
op union
seg=9 {{{50.8459854f, 65.6024857f}, {23.334074f, 86.9259186f}, {-14.5602179f, 88.8177719f}, {-44.0591507f, 70.3405457f}}}
seg=10 {{{-44.0591507f, 70.3405457f}, {-73.5580902f, 51.8633156f}, {-88.3942261f, 16.9427452f}, {-81.2158127f, -17.116993f}}}
seg=11 {{{-81.2158127f, -17.116993f}, {-74.0374069f, -51.1767159f}, {-46.3696136f, -77.1391754f}, {-11.9226456f, -82.1392059f}}}
seg=12 {{{-11.9226456f, -82.1392059f}, {-8.61876869f, -59.3777466f}}}
seg=13 {{{-8.61876869f, -59.3777466f}, {-33.5202026f, -55.7632599f}, {-53.5210152f, -36.9952087f}, {-58.7102203f, -12.3737135f}}}
seg=14 {{{-58.7102203f, -12.3737135f}, {-63.8994179f, 12.2477798f}, {-53.1744957f, 37.4915581f}, {-31.849966f, 50.8485832f}}}
seg=15 {{{-31.849966f, 50.8485832f}, {-10.5254354f, 64.2056046f}, {16.8680305f, 62.8380051f}, {36.7561607f, 47.4234695f}}}
seg=16 {{{36.7561607f, 47.4234695f}, {50.8459854f, 65.6024857f}}}
debugShowCubicLineIntersection wtTs[0]=0 {{{0,-83}, {32.0712242,-83}, {61.2726326,-64.5230865}, {75.0056381,-35.5408783}}} {{0,-83}} wnTs[0]=1 {{{6.31801322e-006,-60}, {0,-83}}}
debugShowCubicLineIntersection wtTs[0]=1 {{{54.2209473,-25.6921959}, {44.2934723,-46.6431847}, {23.1840267,-60}, {6.31801322e-006,-60}}} {{6.31801322e-006,-60}} wnTs[0]=0 {{{6.31801322e-006,-60}, {0,-83}}}
debugShowCubicIntersection wtTs[0]=1 {{{0,-83}, {32.0712242,-83}, {61.2726326,-64.5230865}, {75.0056381,-35.5408783}}} {{75.0056381,-35.5408783}} wnTs[0]=0 {{{75.0056381,-35.5408783}, {88.7386475,-6.55867052}, {84.545517,27.7420006}, {64.2353287,52.562561}}}
debugShowCubicIntersection no intersect {{{0,-83}, {32.0712242,-83}, {61.2726326,-64.5230865}, {75.0056381,-35.5408783}}} {{{54.2209473,-25.6921959}, {44.2934723,-46.6431847}, {23.1840267,-60}, {6.31801322e-006,-60}}}
debugShowCubicIntersection wtTs[0]=1 {{{75.0056381,-35.5408783}, {88.7386475,-6.55867052}, {84.545517,27.7420006}, {64.2353287,52.562561}}} {{64.2353287,52.562561}} wnTs[0]=0 {{{64.2353287,52.562561}, {60.2773972,57.3994484}, {55.7858162,61.773819}, {50.8459854,65.6024933}}}
debugShowCubicLineIntersection wtTs[0]=1 {{{64.2353287,52.562561}, {60.2773972,57.3994484}, {55.7858162,61.773819}, {50.8459854,65.6024933}}} {{50.8459854,65.6024933}} wnTs[0]=0 {{{50.8459854,65.6024933}, {36.756134,47.423481}}}
debugShowCubicLineIntersection wtTs[0]=0 {{{36.756134,47.423481}, {40.3270988,44.6557693}, {43.5740242,41.493576}, {46.4351768,37.9970322}}} {{36.756134,47.423481}} wnTs[0]=1 {{{50.8459854,65.6024933}, {36.756134,47.423481}}}
debugShowCubicIntersection wtTs[0]=1 {{{36.756134,47.423481}, {40.3270988,44.6557693}, {43.5740242,41.493576}, {46.4351768,37.9970322}}} {{46.4351768,37.9970322}} wnTs[0]=0 {{{46.4351768,37.9970322}, {61.1172447,20.0544662}, {64.1484222,-4.74120331}, {54.2209473,-25.6921959}}}
debugShowCubicIntersection wtTs[0]=1 {{{46.4351768,37.9970322}, {61.1172447,20.0544662}, {64.1484222,-4.74120331}, {54.2209473,-25.6921959}}} {{54.2209473,-25.6921959}} wnTs[0]=0 {{{54.2209473,-25.6921959}, {44.2934723,-46.6431847}, {23.1840267,-60}, {6.31801322e-006,-60}}}
debugShowCubicIntersection no intersect {{{64.2353287,52.562561}, {60.2773972,57.3994484}, {55.7858162,61.773819}, {50.8459854,65.6024933}}} {{{50.8459854,65.6024857}, {23.334074,86.9259186}, {-14.5602179,88.8177719}, {-44.0591507,70.3405457}}}
debugShowCubicLineIntersection no intersect {{{64.2353287,52.562561}, {60.2773972,57.3994484}, {55.7858162,61.773819}, {50.8459854,65.6024933}}} {{{36.7561607,47.4234695}, {50.8459854,65.6024857}}}
debugShowCubicLineIntersection wtTs[0]=0 {{{50.8459854,65.6024857}, {23.334074,86.9259186}, {-14.5602179,88.8177719}, {-44.0591507,70.3405457}}} {{50.8459854,65.6024857}} wnTs[0]=2.62183e-007 {{{50.8459854,65.6024933}, {36.756134,47.423481}}}
SkOpSegment::addT alias t=2.62182896e-007 segID=5 spanID=9
debugShowCubicLineIntersection wtTs[0]=0.999999628 {{{-31.849966,50.8485832}, {-10.5254354,64.2056046}, {16.8680305,62.8380051}, {36.7561607,47.4234695}}} {{36.7561378,47.4234886}} wnTs[0]=1 {{{50.8459854,65.6024933}, {36.756134,47.423481}}}
SkOpSegment::addT alias t=0.999999682 segID=5 spanID=10
SkOpSegment::addT insert t=0.999999628 segID=15 spanID=33
debugShowLineIntersection wtTs[0]=2.62182896e-007 {{{50.8459854,65.6024933}, {36.756134,47.423481}}} {{50.8459854,65.6024857}} wnTs[0]=1 {{{36.7561607,47.4234695}, {50.8459854,65.6024857}}}
debugShowCubicIntersection no intersect {{{36.756134,47.423481}, {40.3270988,44.6557693}, {43.5740242,41.493576}, {46.4351768,37.9970322}}} {{{-31.849966,50.8485832}, {-10.5254354,64.2056046}, {16.8680305,62.8380051}, {36.7561607,47.4234695}}}
debugShowCubicLineIntersection no intersect {{{36.756134,47.423481}, {40.3270988,44.6557693}, {43.5740242,41.493576}, {46.4351768,37.9970322}}} {{{36.7561607,47.4234695}, {50.8459854,65.6024857}}}
debugShowCubicIntersection wtTs[0]=1 {{{50.8459854,65.6024857}, {23.334074,86.9259186}, {-14.5602179,88.8177719}, {-44.0591507,70.3405457}}} {{-44.0591507,70.3405457}} wnTs[0]=0 {{{-44.0591507,70.3405457}, {-73.5580902,51.8633156}, {-88.3942261,16.9427452}, {-81.2158127,-17.116993}}}
debugShowCubicLineIntersection wtTs[0]=0 {{{50.8459854,65.6024857}, {23.334074,86.9259186}, {-14.5602179,88.8177719}, {-44.0591507,70.3405457}}} {{50.8459854,65.6024857}} wnTs[0]=1 {{{36.7561607,47.4234695}, {50.8459854,65.6024857}}}
debugShowCubicIntersection wtTs[0]=1 {{{-44.0591507,70.3405457}, {-73.5580902,51.8633156}, {-88.3942261,16.9427452}, {-81.2158127,-17.116993}}} {{-81.2158127,-17.116993}} wnTs[0]=0 {{{-81.2158127,-17.116993}, {-74.0374069,-51.1767159}, {-46.3696136,-77.1391754}, {-11.9226456,-82.1392059}}}
debugShowCubicIntersection no intersect {{{-44.0591507,70.3405457}, {-73.5580902,51.8633156}, {-88.3942261,16.9427452}, {-81.2158127,-17.116993}}} {{{-8.61876869,-59.3777466}, {-33.5202026,-55.7632599}, {-53.5210152,-36.9952087}, {-58.7102203,-12.3737135}}}
debugShowCubicIntersection no intersect {{{-44.0591507,70.3405457}, {-73.5580902,51.8633156}, {-88.3942261,16.9427452}, {-81.2158127,-17.116993}}} {{{-58.7102203,-12.3737135}, {-63.8994179,12.2477798}, {-53.1744957,37.4915581}, {-31.849966,50.8485832}}}
debugShowCubicLineIntersection wtTs[0]=1 {{{-81.2158127,-17.116993}, {-74.0374069,-51.1767159}, {-46.3696136,-77.1391754}, {-11.9226456,-82.1392059}}} {{-11.9226456,-82.1392059}} wnTs[0]=0 {{{-11.9226456,-82.1392059}, {-8.61876869,-59.3777466}}}
debugShowCubicIntersection no intersect {{{-81.2158127,-17.116993}, {-74.0374069,-51.1767159}, {-46.3696136,-77.1391754}, {-11.9226456,-82.1392059}}} {{{-8.61876869,-59.3777466}, {-33.5202026,-55.7632599}, {-53.5210152,-36.9952087}, {-58.7102203,-12.3737135}}}
debugShowCubicLineIntersection wtTs[0]=0 {{{-8.61876869,-59.3777466}, {-33.5202026,-55.7632599}, {-53.5210152,-36.9952087}, {-58.7102203,-12.3737135}}} {{-8.61876869,-59.3777466}} wnTs[0]=1 {{{-11.9226456,-82.1392059}, {-8.61876869,-59.3777466}}}
debugShowCubicIntersection wtTs[0]=1 {{{-8.61876869,-59.3777466}, {-33.5202026,-55.7632599}, {-53.5210152,-36.9952087}, {-58.7102203,-12.3737135}}} {{-58.7102203,-12.3737135}} wnTs[0]=0 {{{-58.7102203,-12.3737135}, {-63.8994179,12.2477798}, {-53.1744957,37.4915581}, {-31.849966,50.8485832}}}
debugShowCubicIntersection wtTs[0]=1 {{{-58.7102203,-12.3737135}, {-63.8994179,12.2477798}, {-53.1744957,37.4915581}, {-31.849966,50.8485832}}} {{-31.849966,50.8485832}} wnTs[0]=0 {{{-31.849966,50.8485832}, {-10.5254354,64.2056046}, {16.8680305,62.8380051}, {36.7561607,47.4234695}}}
debugShowCubicLineIntersection wtTs[0]=1 {{{-31.849966,50.8485832}, {-10.5254354,64.2056046}, {16.8680305,62.8380051}, {36.7561607,47.4234695}}} {{36.7561607,47.4234695}} wnTs[0]=0 {{{36.7561607,47.4234695}, {50.8459854,65.6024857}}}
SkOpSegment::sortAngles [4] tStart=1 [8]
SkOpAngle::after [4/1] 1/1 tStart=1 tEnd=0 < [16/8] 9/9 tStart=1 tEnd=0 < [5/2] 9/9 tStart=0 tEnd=1 T 7
SkOpAngle::afterPart {{{50.8459854,65.6024933}, {55.7858162,61.773819}, {60.2773972,57.3994484}, {64.2353287,52.562561}}} id=4
SkOpAngle::afterPart {{{50.8459854,65.6024933}, {36.7561607,47.4234695}}} id=16
SkOpAngle::afterPart {{{50.8459854,65.6024933}, {36.756134,47.423481}}} id=5
SkOpAngle::after [4/1] 1/1 tStart=1 tEnd=0 < [9/5] 17/17 tStart=0 tEnd=1 < [16/8] 9/9 tStart=1 tEnd=0 F 4
SkOpAngle::afterPart {{{50.8459854,65.6024933}, {55.7858162,61.773819}, {60.2773972,57.3994484}, {64.2353287,52.562561}}} id=4
SkOpAngle::afterPart {{{50.8459854,65.6024933}, {23.334074,86.9259186}, {-14.5602179,88.8177719}, {-44.0591507,70.3405457}}} id=9
SkOpAngle::afterPart {{{50.8459854,65.6024933}, {36.7561607,47.4234695}}} id=16
SkOpAngle::after [16/8] 9/9 tStart=1 tEnd=0 < [9/5] 17/17 tStart=0 tEnd=1 < [5/2] 9/9 tStart=0 tEnd=1 F 5
SkOpAngle::afterPart {{{50.8459854,65.6024933}, {36.7561607,47.4234695}}} id=16
SkOpAngle::afterPart {{{50.8459854,65.6024933}, {23.334074,86.9259186}, {-14.5602179,88.8177719}, {-44.0591507,70.3405457}}} id=9
SkOpAngle::afterPart {{{50.8459854,65.6024933}, {36.756134,47.423481}}} id=5
SkOpAngle::after [5/2] 9/9 tStart=0 tEnd=1 < [9/5] 17/17 tStart=0 tEnd=1 < [4/1] 1/1 tStart=1 tEnd=0 T 4
SkOpAngle::afterPart {{{50.8459854,65.6024933}, {36.756134,47.423481}}} id=5
SkOpAngle::afterPart {{{50.8459854,65.6024933}, {23.334074,86.9259186}, {-14.5602179,88.8177719}, {-44.0591507,70.3405457}}} id=9
SkOpAngle::afterPart {{{50.8459854,65.6024933}, {55.7858162,61.773819}, {60.2773972,57.3994484}, {64.2353287,52.562561}}} id=4
SkOpSegment::sortAngles [5] tStart=0 [9]
SkOpSegment::sortAngles [5] tStart=1 [10]
SkOpAngle::after [5/3] 25/25 tStart=1 tEnd=0 < [15/7] 1/1 tStart=0.999999628 tEnd=1 < [15/6] 17/17 tStart=0.999999628 tEnd=0 T 4
SkOpAngle::afterPart {{{36.756134,47.423481}, {50.8459854,65.6024933}}} id=5
SkOpAngle::afterPart {{{36.756134,47.423481}, {36.7561414,47.4234752}, {36.7561533,47.4234753}, {36.7561607,47.4234695}}} id=15
SkOpAngle::afterPart {{{36.756134,47.423481}, {16.8680057,62.8380003}, {-10.5254434,64.2055996}, {-31.849966,50.8485832}}} id=15
SkOpAngle::after [5/3] 25/25 tStart=1 tEnd=0 < [6/4] 1/1 tStart=0 tEnd=1 < [15/7] 1/1 tStart=0.999999628 tEnd=1 T 7
SkOpAngle::afterPart {{{36.756134,47.423481}, {50.8459854,65.6024933}}} id=5
SkOpAngle::afterPart {{{36.756134,47.423481}, {40.3270988,44.6557693}, {43.5740242,41.493576}, {46.4351768,37.9970322}}} id=6
SkOpAngle::afterPart {{{36.756134,47.423481}, {36.7561414,47.4234752}, {36.7561533,47.4234753}, {36.7561607,47.4234695}}} id=15
SkOpSegment::sortAngles [6] tStart=0 [11]
SkOpSegment::sortAngles [9] tStart=0 [17]
SkOpSegment::sortAngles [15] tStart=0.999999628 [33]
SkOpSegment::sortAngles [16] tStart=1 [32]
SkOpSegment::debugShowActiveSpans id=1 (6.31801322e-006,-60 0,-83) t=0 (6.31801322e-006,-60) tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=2 (0,-83 32.0712242,-83 61.2726326,-64.5230865 75.0056381,-35.5408783) t=0 (0,-83) tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=3 (75.0056381,-35.5408783 88.7386475,-6.55867052 84.545517,27.7420006 64.2353287,52.562561) t=0 (75.0056381,-35.5408783) tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=4 (64.2353287,52.562561 60.2773972,57.3994484 55.7858162,61.773819 50.8459854,65.6024933) t=0 (64.2353287,52.562561) tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=5 (50.8459854,65.6024933 36.756134,47.423481) t=0 (50.8459854,65.6024933) tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=6 (36.756134,47.423481 40.3270988,44.6557693 43.5740242,41.493576 46.4351768,37.9970322) t=0 (36.756134,47.423481) tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=7 (46.4351768,37.9970322 61.1172447,20.0544662 64.1484222,-4.74120331 54.2209473,-25.6921959) t=0 (46.4351768,37.9970322) tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=8 (54.2209473,-25.6921959 44.2934723,-46.6431847 23.1840267,-60 6.31801322e-006,-60) t=0 (54.2209473,-25.6921959) tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=9 (50.8459854,65.6024933 23.334074,86.9259186 -14.5602179,88.8177719 -44.0591507,70.3405457) t=0 (50.8459854,65.6024933) tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=10 (-44.0591507,70.3405457 -73.5580902,51.8633156 -88.3942261,16.9427452 -81.2158127,-17.116993) t=0 (-44.0591507,70.3405457) tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=11 (-81.2158127,-17.116993 -74.0374069,-51.1767159 -46.3696136,-77.1391754 -11.9226456,-82.1392059) t=0 (-81.2158127,-17.116993) tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=12 (-11.9226456,-82.1392059 -8.61876869,-59.3777466) t=0 (-11.9226456,-82.1392059) tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=13 (-8.61876869,-59.3777466 -33.5202026,-55.7632599 -53.5210152,-36.9952087 -58.7102203,-12.3737135) t=0 (-8.61876869,-59.3777466) tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=14 (-58.7102203,-12.3737135 -63.8994179,12.2477798 -53.1744957,37.4915581 -31.849966,50.8485832) t=0 (-58.7102203,-12.3737135) tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=15 (-31.849966,50.8485832 -10.5254354,64.2056046 16.8680305,62.8380051 36.7561607,47.4234695) t=0 (-31.849966,50.8485832) tEnd=0.999999628 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=15 (-31.849966,50.8485832 -10.5254354,64.2056046 16.8680305,62.8380051 36.7561607,47.4234695) t=0.999999628 (36.756134,47.423481) tEnd=1 windSum=? windValue=1
SkOpSegment::debugShowActiveSpans id=16 (36.7561607,47.4234695 50.8459854,65.6024933) t=0 (36.7561607,47.4234695) tEnd=1 windSum=? windValue=1
SkOpSpan::sortableTop dir=kLeft seg=1 t=0.5 pt=(3.15900661e-006,-71.5)
SkOpSpan::sortableTop [0] valid=1 operand=1 span=21 ccw=1 seg=11 {{{-81.2158127f, -17.116993f}, {-74.0374069f, -51.1767159f}, {-46.3696136f, -77.1391754f}, {-11.9226456f, -82.1392059f}}} t=0.683500004 pt=(-42.1581116,-71.5) slope=(86.347103,-50.9415461)
SkOpSpan::sortableTop [1] valid=1 operand=1 span=23 ccw=0 seg=12 {{{-11.9226456f, -82.1392059f}, {-8.61876869f, -59.3777466f}}} t=0.46742196 pt=(-10.3783407,-71.5) slope=(3.30387688,22.7614594)
SkOpSpan::sortableTop [2] valid=1 operand=0 span=1 ccw=1 seg=1 {{{6.31801322e-006f, -60}, {0, -83}}} t=0.5 pt=(3.15900661e-006,-71.5) slope=(-6.31801322e-006,-23)
SkOpSegment::markWinding id=11 (-81.2158127,-17.116993 -74.0374069,-51.1767159 -46.3696136,-77.1391754 -11.9226456,-82.1392059) t=0 [21] (-81.2158127,-17.116993) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markWinding id=12 (-11.9226456,-82.1392059 -8.61876869,-59.3777466) t=0 [23] (-11.9226456,-82.1392059) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markWinding id=13 (-8.61876869,-59.3777466 -33.5202026,-55.7632599 -53.5210152,-36.9952087 -58.7102203,-12.3737135) t=0 [25] (-8.61876869,-59.3777466) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markWinding id=14 (-58.7102203,-12.3737135 -63.8994179,12.2477798 -53.1744957,37.4915581 -31.849966,50.8485832) t=0 [27] (-58.7102203,-12.3737135) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markWinding id=15 (-31.849966,50.8485832 -10.5254354,64.2056046 16.8680305,62.8380051 36.7561607,47.4234695) t=0 [29] (-31.849966,50.8485832) tEnd=0.999999628 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markWinding id=11 (-81.2158127,-17.116993 -74.0374069,-51.1767159 -46.3696136,-77.1391754 -11.9226456,-82.1392059) t=0 [21] (-81.2158127,-17.116993) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markWinding id=10 (-44.0591507,70.3405457 -73.5580902,51.8633156 -88.3942261,16.9427452 -81.2158127,-17.116993) t=0 [19] (-44.0591507,70.3405457) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markWinding id=9 (50.8459854,65.6024933 23.334074,86.9259186 -14.5602179,88.8177719 -44.0591507,70.3405457) t=0 [17] (50.8459854,65.6024933) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markWinding id=1 (6.31801322e-006,-60 0,-83) t=0 [1] (6.31801322e-006,-60) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markWinding id=2 (0,-83 32.0712242,-83 61.2726326,-64.5230865 75.0056381,-35.5408783) t=0 [3] (0,-83) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markWinding id=3 (75.0056381,-35.5408783 88.7386475,-6.55867052 84.545517,27.7420006 64.2353287,52.562561) t=0 [5] (75.0056381,-35.5408783) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markWinding id=4 (64.2353287,52.562561 60.2773972,57.3994484 55.7858162,61.773819 50.8459854,65.6024933) t=0 [7] (64.2353287,52.562561) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markWinding id=1 (6.31801322e-006,-60 0,-83) t=0 [1] (6.31801322e-006,-60) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markWinding id=8 (54.2209473,-25.6921959 44.2934723,-46.6431847 23.1840267,-60 6.31801322e-006,-60) t=0 [15] (54.2209473,-25.6921959) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markWinding id=7 (46.4351768,37.9970322 61.1172447,20.0544662 64.1484222,-4.74120331 54.2209473,-25.6921959) t=0 [13] (46.4351768,37.9970322) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markWinding id=6 (36.756134,47.423481 40.3270988,44.6557693 43.5740242,41.493576 46.4351768,37.9970322) t=0 [11] (36.756134,47.423481) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::activeOp id=1 t=1 tEnd=0 op=union miFrom=0 miTo=1 suFrom=0 suTo=0 result=1
SkOpSegment::findNextOp simple
SkOpSegment::markDone id=1 (6.31801322e-006,-60 0,-83) t=0 [1] (6.31801322e-006,-60) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
bridgeOp current id=1 from=(0,-83) to=(6.31801322e-006,-60)
SkOpSegment::findNextOp simple
SkOpSegment::markDone id=8 (54.2209473,-25.6921959 44.2934723,-46.6431847 23.1840267,-60 6.31801322e-006,-60) t=0 [15] (54.2209473,-25.6921959) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
bridgeOp current id=8 from=(6.31801322e-006,-60) to=(54.2209473,-25.6921959)
path.moveTo(0,-83);
path.lineTo(6.31801322e-006,-60);
path.cubicTo(23.1840267,-60, 44.2934723,-46.6431847, 54.2209473,-25.6921959);
SkOpSegment::findNextOp simple
SkOpSegment::markDone id=7 (46.4351768,37.9970322 61.1172447,20.0544662 64.1484222,-4.74120331 54.2209473,-25.6921959) t=0 [13] (46.4351768,37.9970322) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
bridgeOp current id=7 from=(54.2209473,-25.6921959) to=(46.4351768,37.9970322)
path.cubicTo(64.1484222,-4.74120331, 61.1172447,20.0544662, 46.4351768,37.9970322);
SkOpSegment::markWinding id=15 (-31.849966,50.8485832 -10.5254354,64.2056046 16.8680305,62.8380051 36.7561607,47.4234695) t=0.999999628 [33] (36.756134,47.423481) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markWinding id=16 (36.7561607,47.4234695 50.8459854,65.6024933) t=0 [31] (36.7561607,47.4234695) tEnd=1 newWindSum=1 newOppSum=0 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markAngle last segment=16 span=32
SkOpSegment::markWinding id=5 (50.8459854,65.6024933 36.756134,47.423481) t=0 [9] (50.8459854,65.6024933) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=? windSum=? windValue=1 oppValue=0
SkOpSegment::markAngle last segment=5 span=9 windSum=-1
SkOpSegment::findNextOp
SkOpAngle::dumpOne [6/4] next=15/7 sect=1/1 s=0 [11] e=1 [12] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=0
SkOpAngle::dumpOne [15/7] next=15/6 sect=1/1 s=0.999999628 [33] e=1 [30] sgn=-1 windVal=1 windSum=1 oppVal=0 oppSum=0 operand
SkOpAngle::dumpOne [15/6] next=5/3 sect=17/17 s=0.999999628 [33] e=0 [29] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=0 operand
SkOpAngle::dumpOne [5/3] next=6/4 sect=25/25 s=1 [10] e=0 [9] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=-1
SkOpSegment::activeOp id=15 t=0.999999628 tEnd=1 op=union miFrom=0 miTo=0 suFrom=0 suTo=1 result=1
SkOpSegment::findNextOp chase.append segment=16 span=32
SkOpSegment::activeOp id=15 t=0.999999628 tEnd=0 op=union miFrom=0 miTo=0 suFrom=1 suTo=0 result=1
SkOpSegment::activeOp id=5 t=1 tEnd=0 op=union miFrom=0 miTo=1 suFrom=0 suTo=0 result=1
SkOpSegment::findNextOp chase.append segment=5 span=9 windSum=-1
SkOpSegment::markDone id=6 (36.756134,47.423481 40.3270988,44.6557693 43.5740242,41.493576 46.4351768,37.9970322) t=0 [11] (36.756134,47.423481) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::findNextOp from:[6] to:[15] start=13585868 end=13585412
bridgeOp current id=6 from=(46.4351768,37.9970322) to=(36.756134,47.423481)
path.cubicTo(43.5740242,41.493576, 40.3270988,44.6557693, 36.756134,47.423481);
SkOpSegment::findNextOp simple
SkOpSegment::markDone id=15 (-31.849966,50.8485832 -10.5254354,64.2056046 16.8680305,62.8380051 36.7561607,47.4234695) t=0.999999628 [33] (36.756134,47.423481) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
bridgeOp current id=15 from=(36.756134,47.423481) to=(36.7561607,47.4234695)
path.cubicTo(36.7561417,47.4234734, 36.7561531,47.4234772, 36.7561607,47.4234695);
SkOpSegment::findNextOp
SkOpAngle::dumpOne [16/8] next=5/2 sect=9/9 s=1 [32] e=0 [31] sgn=1 windVal=1 windSum=1 oppVal=0 oppSum=0 operand
SkOpAngle::dumpOne [5/2] next=9/5 sect=9/9 s=0 [9] e=1 [10] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=-1
SkOpAngle::dumpOne [9/5] next=4/1 sect=17/17 s=0 [17] e=1 [18] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=0 operand
SkOpAngle::dumpOne [4/1] next=16/8 sect=1/1 s=1 [8] e=0 [7] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=0
SkOpSegment::activeOp id=5 t=0 tEnd=1 op=union miFrom=0 miTo=1 suFrom=0 suTo=0 result=1
SkOpSegment::activeOp id=9 t=0 tEnd=1 op=union miFrom=1 miTo=1 suFrom=0 suTo=1 result=0
SkOpSegment::markDone id=9 (50.8459854,65.6024933 23.334074,86.9259186 -14.5602179,88.8177719 -44.0591507,70.3405457) t=0 [17] (50.8459854,65.6024933) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markDone id=10 (-44.0591507,70.3405457 -73.5580902,51.8633156 -88.3942261,16.9427452 -81.2158127,-17.116993) t=0 [19] (-44.0591507,70.3405457) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markDone id=11 (-81.2158127,-17.116993 -74.0374069,-51.1767159 -46.3696136,-77.1391754 -11.9226456,-82.1392059) t=0 [21] (-81.2158127,-17.116993) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markDone id=12 (-11.9226456,-82.1392059 -8.61876869,-59.3777466) t=0 [23] (-11.9226456,-82.1392059) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markDone id=13 (-8.61876869,-59.3777466 -33.5202026,-55.7632599 -53.5210152,-36.9952087 -58.7102203,-12.3737135) t=0 [25] (-8.61876869,-59.3777466) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markDone id=14 (-58.7102203,-12.3737135 -63.8994179,12.2477798 -53.1744957,37.4915581 -31.849966,50.8485832) t=0 [27] (-58.7102203,-12.3737135) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markDone id=15 (-31.849966,50.8485832 -10.5254354,64.2056046 16.8680305,62.8380051 36.7561607,47.4234695) t=0 [29] (-31.849966,50.8485832) tEnd=0.999999628 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::activeOp id=4 t=1 tEnd=0 op=union miFrom=1 miTo=0 suFrom=1 suTo=1 result=0
SkOpSegment::markDone id=4 (64.2353287,52.562561 60.2773972,57.3994484 55.7858162,61.773819 50.8459854,65.6024933) t=0 [7] (64.2353287,52.562561) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markDone id=3 (75.0056381,-35.5408783 88.7386475,-6.55867052 84.545517,27.7420006 64.2353287,52.562561) t=0 [5] (75.0056381,-35.5408783) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markDone id=2 (0,-83 32.0712242,-83 61.2726326,-64.5230865 75.0056381,-35.5408783) t=0 [3] (0,-83) tEnd=1 newWindSum=-1 newOppSum=0 oppSum=0 windSum=-1 windValue=1 oppValue=0
SkOpSegment::markDone id=16 (36.7561607,47.4234695 50.8459854,65.6024933) t=0 [31] (36.7561607,47.4234695) tEnd=1 newWindSum=1 newOppSum=0 oppSum=0 windSum=1 windValue=1 oppValue=0
SkOpSegment::findNextOp from:[16] to:[5] start=13582764 end=13582868
bridgeOp current id=16 from=(36.7561607,47.4234695) to=(50.8459854,65.6024933)
SkOpSegment::findNextOp
SkOpAngle::dumpOne [5/3] next=6/4 sect=25/25 s=1 [10] e=0 [9] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=-1
SkOpAngle::dumpOne [6/4] next=15/7 sect=1/1 s=0 [11] e=1 [12] sgn=-1 windVal=1 windSum=-1 oppVal=0 oppSum=0 done
SkOpAngle::dumpOne [15/7] next=15/6 sect=1/1 s=0.999999628 [33] e=1 [30] sgn=-1 windVal=1 windSum=1 oppVal=0 oppSum=0 done operand
SkOpAngle::dumpOne [15/6] next=5/3 sect=17/17 s=0.999999628 [33] e=0 [29] sgn=1 windVal=1 windSum=-1 oppVal=0 oppSum=0 done operand
SkOpSegment::activeOp id=6 t=0 tEnd=1 op=union miFrom=1 miTo=0 suFrom=1 suTo=1 result=0
SkOpSegment::activeOp id=15 t=0.999999628 tEnd=1 op=union miFrom=0 miTo=0 suFrom=1 suTo=0 result=1
SkOpSegment::activeOp id=15 t=0.999999628 tEnd=0 op=union miFrom=0 miTo=0 suFrom=0 suTo=1 result=1
SkOpSegment::markDone id=5 (50.8459854,65.6024933 36.756134,47.423481) t=0 [9] (50.8459854,65.6024933) tEnd=1 newWindSum=-1 newOppSum=-1 oppSum=-1 windSum=-1 windValue=1 oppValue=0
SkOpSegment::findNextOp from:[5] to:[15] start=13585868 end=13585412
bridgeOp current id=5 from=(50.8459854,65.6024933) to=(36.756134,47.423481)
path.lineTo(50.8459854,65.6024933);
path.lineTo(36.756134,47.423481);
</div>
</div>
<script type="text/javascript">
var testDivs = [
battleOp183,
];
var decimal_places = 3; // make this 3 to show more precision
var tests = [];
var testLines = [];
var testTitles = [];
var testIndex = 0;
var ctx;
var xmin, xmax, focusXmin, focusXmax;
var ymin, ymax, focusYmin, focusYmax;
var scale;
var mouseX, mouseY;
var srcLeft, srcTop;
var screenWidth, screenHeight;
var drawnPts, drawnLines, drawnQuads, drawnConics, drawnCubics;
var curveT = 0;
var pt_labels = 2;
var collect_bounds = false;
var control_lines = 0;
var curve_t = false;
var debug_xy = 1;
var focus_enabled = false;
var focus_on_selection = false;
var step_limit = 0;
var draw_active = false;
var draw_add = false;
var draw_angle = 0;
var draw_coincidence = false;
var draw_deriviatives = 0;
var draw_hints = false;
var draw_id = false;
var draw_intersection = 0;
var draw_intersectT = false;
var draw_legend = true;
var draw_log = false;
var draw_mark = false;
var draw_midpoint = false;
var draw_op = 0;
var draw_sequence = false;
var draw_sort = 0;
var draw_top = false;
var draw_path = 3;
var draw_computed = 0;
var retina_scale = !!window.devicePixelRatio;
var activeCount = 0;
var addCount = 0;
var angleCount = 0;
var coinCount = 0;
var opCount = 0;
var sectCount = 0;
var sortCount = 0;
var topCount = 0;
var markCount = 0;
var activeMax = 0;
var addMax = 0;
var angleMax = 0;
var coinMax = 0;
var sectMax = 0;
var sectMax2 = 0;
var sortMax = 0;
var topMax = 0;
var markMax = 0;
var opMax = 0;
var stepMax = 0;
var lastIndex = 0;
var hasPath = false;
var hasComputedPath = false;
var angleBetween = false;
var afterIndex = 0;
var firstActiveSpan = -1;
var logStart = -1;
var logRange = 0;
var SPAN_ID = 0;
var SPAN_X1 = SPAN_ID + 1;
var SPAN_Y1 = SPAN_X1 + 1;
var SPAN_X2 = SPAN_Y1 + 1;
var SPAN_Y2 = SPAN_X2 + 1;
var SPAN_L_T = SPAN_Y2 + 1;
var SPAN_L_TX = SPAN_L_T + 1;
var SPAN_L_TY = SPAN_L_TX + 1;
var SPAN_L_TEND = SPAN_L_TY + 1;
var SPAN_L_OTHER = SPAN_L_TEND + 1;
var SPAN_L_OTHERT = SPAN_L_OTHER + 1;
var SPAN_L_OTHERI = SPAN_L_OTHERT + 1;
var SPAN_L_SUM = SPAN_L_OTHERI + 1;
var SPAN_L_VAL = SPAN_L_SUM + 1;
var SPAN_L_OPP = SPAN_L_VAL + 1;
var SPAN_X3 = SPAN_Y2 + 1;
var SPAN_Y3 = SPAN_X3 + 1;
var SPAN_Q_T = SPAN_Y3 + 1;
var SPAN_Q_TX = SPAN_Q_T + 1;
var SPAN_Q_TY = SPAN_Q_TX + 1;
var SPAN_Q_TEND = SPAN_Q_TY + 1;
var SPAN_Q_OTHER = SPAN_Q_TEND + 1;
var SPAN_Q_OTHERT = SPAN_Q_OTHER + 1;
var SPAN_Q_OTHERI = SPAN_Q_OTHERT + 1;
var SPAN_Q_SUM = SPAN_Q_OTHERI + 1;
var SPAN_Q_VAL = SPAN_Q_SUM + 1;
var SPAN_Q_OPP = SPAN_Q_VAL + 1;
var SPAN_K_W = SPAN_Y3 + 1;
var SPAN_K_T = SPAN_K_W + 1;
var SPAN_K_TX = SPAN_K_T + 1;
var SPAN_K_TY = SPAN_K_TX + 1;
var SPAN_K_TEND = SPAN_K_TY + 1;
var SPAN_K_OTHER = SPAN_K_TEND + 1;
var SPAN_K_OTHERT = SPAN_K_OTHER + 1;
var SPAN_K_OTHERI = SPAN_K_OTHERT + 1;
var SPAN_K_SUM = SPAN_K_OTHERI + 1;
var SPAN_K_VAL = SPAN_K_SUM + 1;
var SPAN_K_OPP = SPAN_K_VAL + 1;
var SPAN_X4 = SPAN_Y3 + 1;
var SPAN_Y4 = SPAN_X4 + 1;
var SPAN_C_T = SPAN_Y4 + 1;
var SPAN_C_TX = SPAN_C_T + 1;
var SPAN_C_TY = SPAN_C_TX + 1;
var SPAN_C_TEND = SPAN_C_TY + 1;
var SPAN_C_OTHER = SPAN_C_TEND + 1;
var SPAN_C_OTHERT = SPAN_C_OTHER + 1;
var SPAN_C_OTHERI = SPAN_C_OTHERT + 1;
var SPAN_C_SUM = SPAN_C_OTHERI + 1;
var SPAN_C_VAL = SPAN_C_SUM + 1;
var SPAN_C_OPP = SPAN_C_VAL + 1;
var ACTIVE_LINE_SPAN = 1;
var ACTIVE_QUAD_SPAN = ACTIVE_LINE_SPAN + 1;
var ACTIVE_CONIC_SPAN = ACTIVE_QUAD_SPAN + 1;
var ACTIVE_CUBIC_SPAN = ACTIVE_CONIC_SPAN + 1;
var ADD_MOVETO = ACTIVE_CUBIC_SPAN + 1;
var ADD_LINETO = ADD_MOVETO + 1;
var ADD_QUADTO = ADD_LINETO + 1;
var ADD_CONICTO = ADD_QUADTO + 1;
var ADD_CUBICTO = ADD_CONICTO + 1;
var ADD_CLOSE = ADD_CUBICTO + 1;
var ADD_FILL = ADD_CLOSE + 1;
var PATH_LINE = ADD_FILL + 1;
var PATH_QUAD = PATH_LINE + 1;
var PATH_CONIC = PATH_QUAD + 1;
var PATH_CUBIC = PATH_CONIC + 1;
var INTERSECT_LINE = PATH_CUBIC + 1;
var INTERSECT_LINE_2 = INTERSECT_LINE + 1;
var INTERSECT_LINE_NO = INTERSECT_LINE_2 + 1;
var INTERSECT_QUAD_LINE = INTERSECT_LINE_NO + 1;
var INTERSECT_QUAD_LINE_2 = INTERSECT_QUAD_LINE + 1;
var INTERSECT_QUAD_LINE_NO = INTERSECT_QUAD_LINE_2 + 1;
var INTERSECT_QUAD = INTERSECT_QUAD_LINE_NO + 1;
var INTERSECT_QUAD_2 = INTERSECT_QUAD + 1;
var INTERSECT_QUAD_NO = INTERSECT_QUAD_2 + 1;
var INTERSECT_CONIC_LINE = INTERSECT_QUAD_NO + 1;
var INTERSECT_CONIC_LINE_2 = INTERSECT_CONIC_LINE + 1;
var INTERSECT_CONIC_LINE_NO = INTERSECT_CONIC_LINE_2 + 1;
var INTERSECT_CONIC = INTERSECT_CONIC_LINE_NO + 1;
var INTERSECT_CONIC_2 = INTERSECT_CONIC + 1;
var INTERSECT_CONIC_NO = INTERSECT_CONIC_2 + 1;
var INTERSECT_SELF_CUBIC = INTERSECT_CONIC_NO + 1;
var INTERSECT_SELF_CUBIC_NO = INTERSECT_SELF_CUBIC + 1;
var INTERSECT_CUBIC_LINE = INTERSECT_SELF_CUBIC_NO + 1;
var INTERSECT_CUBIC_LINE_2 = INTERSECT_CUBIC_LINE + 1;
var INTERSECT_CUBIC_LINE_3 = INTERSECT_CUBIC_LINE_2 + 1;
var INTERSECT_CUBIC_LINE_NO = INTERSECT_CUBIC_LINE_3 + 1;
var INTERSECT_CUBIC_QUAD = INTERSECT_CUBIC_LINE_NO + 1;
var INTERSECT_CUBIC_QUAD_2 = INTERSECT_CUBIC_QUAD + 1;
var INTERSECT_CUBIC_QUAD_3 = INTERSECT_CUBIC_QUAD_2 + 1;
var INTERSECT_CUBIC_QUAD_4 = INTERSECT_CUBIC_QUAD_3 + 1;
var INTERSECT_CUBIC_QUAD_NO = INTERSECT_CUBIC_QUAD_4 + 1;
var INTERSECT_CUBIC = INTERSECT_CUBIC_QUAD_NO + 1;
var INTERSECT_CUBIC_2 = INTERSECT_CUBIC + 1;
var INTERSECT_CUBIC_3 = INTERSECT_CUBIC_2 + 1;
var INTERSECT_CUBIC_4 = INTERSECT_CUBIC_3 + 1;
// FIXME: add cubic 5- 9
var INTERSECT_CUBIC_NO = INTERSECT_CUBIC_4 + 1;
var SORT_UNARY = INTERSECT_CUBIC_NO + 1;
var SORT_BINARY = SORT_UNARY + 1;
var OP_DIFFERENCE = SORT_BINARY + 1;
var OP_INTERSECT = OP_DIFFERENCE + 1;
var OP_UNION = OP_INTERSECT + 1;
var OP_XOR = OP_UNION + 1;
var MARK_LINE = OP_XOR + 1;
var MARK_QUAD = MARK_LINE + 1;
var MARK_CONIC = MARK_QUAD + 1;
var MARK_CUBIC = MARK_CONIC + 1;
var MARK_DONE_LINE = MARK_CUBIC + 1;
var MARK_DONE_QUAD = MARK_DONE_LINE + 1;
var MARK_DONE_CONIC = MARK_DONE_QUAD + 1;
var MARK_DONE_CUBIC = MARK_DONE_CONIC + 1;
var MARK_UNSORTABLE_LINE = MARK_DONE_CUBIC + 1;
var MARK_UNSORTABLE_QUAD = MARK_UNSORTABLE_LINE + 1;
var MARK_UNSORTABLE_CONIC = MARK_UNSORTABLE_QUAD + 1;
var MARK_UNSORTABLE_CUBIC = MARK_UNSORTABLE_CONIC + 1;
var MARK_SIMPLE_LINE = MARK_UNSORTABLE_CUBIC + 1;
var MARK_SIMPLE_QUAD = MARK_SIMPLE_LINE + 1;
var MARK_SIMPLE_CONIC = MARK_SIMPLE_QUAD + 1;
var MARK_SIMPLE_CUBIC = MARK_SIMPLE_CONIC + 1;
var MARK_SIMPLE_DONE_LINE = MARK_SIMPLE_CUBIC + 1;
var MARK_SIMPLE_DONE_QUAD = MARK_SIMPLE_DONE_LINE + 1;
var MARK_SIMPLE_DONE_CONIC = MARK_SIMPLE_DONE_QUAD + 1;
var MARK_SIMPLE_DONE_CUBIC = MARK_SIMPLE_DONE_CONIC + 1;
var MARK_DONE_UNARY_LINE = MARK_SIMPLE_DONE_CUBIC + 1;
var MARK_DONE_UNARY_QUAD = MARK_DONE_UNARY_LINE + 1;
var MARK_DONE_UNARY_CONIC = MARK_DONE_UNARY_QUAD + 1;
var MARK_DONE_UNARY_CUBIC = MARK_DONE_UNARY_CONIC + 1;
var MARK_ANGLE_LAST = MARK_DONE_UNARY_CUBIC + 1;
var COMPUTED_SET_1 = MARK_ANGLE_LAST + 1;
var COMPUTED_SET_2 = COMPUTED_SET_1 + 1;
var ANGLE_AFTER = COMPUTED_SET_2 + 1;
var ANGLE_AFTERPART = ANGLE_AFTER + 1;
var ACTIVE_OP = ANGLE_AFTERPART + 1;
var COIN_MAIN_SPAN = ACTIVE_OP + 1;
var COIN_OPP_SPAN = COIN_MAIN_SPAN + 1;
var FRAG_TYPE_LAST = COIN_OPP_SPAN;
var REC_TYPE_UNKNOWN = -1;
var REC_TYPE_PATH = 0;
var REC_TYPE_PATH2 = 1;
var REC_TYPE_SECT = 2;
var REC_TYPE_ACTIVE = 3;
var REC_TYPE_ADD = 4;
var REC_TYPE_SORT = 5;
var REC_TYPE_OP = 6;
var REC_TYPE_MARK = 7;
var REC_TYPE_COMPUTED = 8;
var REC_TYPE_COIN = 9;
var REC_TYPE_ANGLE = 10;
var REC_TYPE_ACTIVE_OP = 11;
var REC_TYPE_AFTERPART = 12;
var REC_TYPE_TOP = 13;
var REC_TYPE_COINCIDENCE = 14;
var REC_TYPE_LAST = REC_TYPE_COINCIDENCE;
function strs_to_nums(strs) {
var result = [];
for (var idx = 1; idx < strs.length; ++idx) {
var str = strs[idx];
var num = parseFloat(str);
if (isNaN(num)) {
result.push(str);
} else {
result.push(num);
}
}
return result;
}
function filter_str_by(id, str, regex, array) {
if (regex.test(str)) {
var strs = regex.exec(str);
var result = strs_to_nums(strs);
array.push(id);
array.push(result);
return true;
}
return false;
}
function construct_regexp2(pattern) {
var escape = pattern.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
escape = escape.replace(/UNSORTABLE/g, "\\*\\*\\* UNSORTABLE \\*\\*\\*");
escape = escape.replace(/CUBIC_VAL/g, "\\(P_VAL P_VAL P_VAL P_VAL\\)");
escape = escape.replace(/CONIC_VAL/g, "\\(P_VAL P_VAL P_VAL W_VAL\\)");
escape = escape.replace(/QUAD_VAL/g, "\\(P_VAL P_VAL P_VAL\\)");
escape = escape.replace(/LINE_VAL/g, "\\(P_VAL P_VAL\\)");
escape = escape.replace(/FILL_TYPE/g, "SkPath::k[a-zA-Z]+_FillType");
escape = escape.replace(/PTR_VAL/g, "0x[0-9A-F]+");
escape = escape.replace(/PT_VAL/g, "\\(P_VAL\\)");
escape = escape.replace(/P_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?, ?(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?");
escape = escape.replace(/T_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)");
escape = escape.replace(/W_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?");
escape = escape.replace(/PATH/g, "pathB?");
escape = escape.replace(/IDX/g, "(-?\\d+)");
escape = escape.replace(/NUM/g, "(-?\\d+)");
escape = escape.replace(/OPT/g, "(\\?|-?\\d+)");
return new RegExp(escape, 'i');
}
function construct_regexp2c(pattern) {
var escape = pattern.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
escape = escape.replace(/UNSORTABLE/g, "\\*\\*\\* UNSORTABLE \\*\\*\\*");
escape = escape.replace(/CUBIC_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}\\}");
escape = escape.replace(/CONIC_VAL/g, "(?:\\$\\d = )?\\{\\{\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}\\}, W_VAL\\}");
escape = escape.replace(/QUAD_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}, \\{P_VAL\\}\\}\\}");
escape = escape.replace(/LINE_VAL/g, "(?:\\$\\d = )?\\{\\{\\{P_VAL\\}, \\{P_VAL\\}\\}\\}");
escape = escape.replace(/FILL_TYPE/g, "SkPath::k[a-zA-Z]+_FillType");
escape = escape.replace(/PTR_VAL/g, "0x[0-9A-F]+");
escape = escape.replace(/PT_VAL/g, "\\{\\{P_VAL\\}\\}");
escape = escape.replace(/P_VAL/g, "(?:f?[xX] = )?(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?, *(?: f?[yY] = )?(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?");
escape = escape.replace(/T_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)");
escape = escape.replace(/W_VAL/g, "(-?\\d+\\.?\\d*(?:e-?\\d+)?)[Ff]?");
escape = escape.replace(/OPER/g, "[a-z]+");
escape = escape.replace(/PATH/g, "pathB?");
escape = escape.replace(/T_F/g, "([TF])");
escape = escape.replace(/IDX/g, "(-?\\d+)");
escape = escape.replace(/NUM/g, "(-?\\d+)");
escape = escape.replace(/OPT/g, "(\\?|-?\\d+)");
return new RegExp(escape, 'i');
}
function match_regexp(str, lineNo, array, id, pattern) {
var regex = construct_regexp2(pattern);
if (filter_str_by(id, str, regex, array)) {
return true;
}
regex = construct_regexp2c(pattern);
return filter_str_by(id, str, regex, array);
}
function endsWith(str, suffix) {
return str.indexOf(suffix, str.length - suffix.length) !== -1;
}
function parse_all(test) {
var lines = test.match(/[^\r\n]+/g);
var records = []; // a rec can be the original paths, a set of intersections, a set of active spans, a sort, or a path add
var record = [];
var recType = REC_TYPE_UNKNOWN;
var lastLineNo;
var moveX, moveY;
for (var lineNo = 0; lineNo < lines.length; ++lineNo) {
var line = lines[lineNo];
if (line.length == 0) {
continue;
}
var opStart = "SkOpSegment::";
if (line.lastIndexOf(opStart, 0) === 0) {
line = line.substr(opStart.length);
}
var angleStart = "SkOpAngle::";
if (line.lastIndexOf(angleStart, 0) === 0) {
line = line.substr(angleStart.length);
}
var coinStart = "SkOpCoincidence::";
if (line.lastIndexOf(coinStart, 0) === 0) {
line = line.substr(coinStart.length);
}
var type = line.lastIndexOf("debugShowActiveSpans", 0) === 0 ? REC_TYPE_ACTIVE
: line.lastIndexOf("debugShowCoincidence", 0) === 0 ? REC_TYPE_COINCIDENCE
: line.lastIndexOf("((SkOpSegment*)", 0) === 0 ? REC_TYPE_PATH2
: line.lastIndexOf("debugShowTs", 0) === 0 ? REC_TYPE_COIN
: line.lastIndexOf("afterPart", 0) === 0 ? REC_TYPE_AFTERPART
: line.lastIndexOf("debugShow", 0) === 0 ? REC_TYPE_SECT
: line.lastIndexOf("activeOp", 0) === 0 ? REC_TYPE_ACTIVE_OP
: line.lastIndexOf("computed", 0) === 0 ? REC_TYPE_COMPUTED
: line.lastIndexOf("debugOne", 0) === 0 ? REC_TYPE_SORT
: line.lastIndexOf("dumpOne", 0) === 0 ? REC_TYPE_SORT
: line.lastIndexOf("findTop", 0) === 0 ? REC_TYPE_TOP
: line.lastIndexOf("pathB.", 0) === 0 ? REC_TYPE_ADD
: line.lastIndexOf("path.", 0) === 0 ? REC_TYPE_ADD
: line.lastIndexOf("after", 0) === 0 ? REC_TYPE_ANGLE
: line.lastIndexOf("mark", 0) === 0 ? REC_TYPE_MARK
: line.lastIndexOf(" {{", 0) === 0 ? REC_TYPE_COMPUTED
: line.lastIndexOf("seg=", 0) === 0 ? REC_TYPE_PATH
: line.lastIndexOf("op", 0) === 0 ? REC_TYPE_OP
: line.lastIndexOf("$", 0) === 0 ? REC_TYPE_PATH
: REC_TYPE_UNKNOWN;
if (recType != type || recType == REC_TYPE_ADD || recType == REC_TYPE_SECT
|| recType == REC_TYPE_ACTIVE_OP || recType == REC_TYPE_ANGLE) {
if (recType != REC_TYPE_UNKNOWN) {
records.push(recType);
records.push(lastLineNo);
records.push(record);
}
record = [];
recType = type;
lastLineNo = lineNo;
}
var found = false;
switch (recType) {
case REC_TYPE_ACTIVE:
found = match_regexp(line, lineNo, record, ACTIVE_LINE_SPAN, "debugShowActiveSpans" +
" id=IDX LINE_VAL t=T_VAL PT_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
) || match_regexp(line, lineNo, record, ACTIVE_QUAD_SPAN, "debugShowActiveSpans" +
" id=IDX QUAD_VAL t=T_VAL PT_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
) || match_regexp(line, lineNo, record, ACTIVE_CONIC_SPAN, "debugShowActiveSpans" +
" id=IDX CONIC_VAL t=T_VAL PT_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
) || match_regexp(line, lineNo, record, ACTIVE_CUBIC_SPAN, "debugShowActiveSpans" +
" id=IDX CUBIC_VAL t=T_VAL PT_VAL tEnd=T_VAL windSum=OPT windValue=IDX"
) || match_regexp(line, lineNo, record, ACTIVE_LINE_SPAN, "debugShowActiveSpans" +
" id=IDX LINE_VAL t=T_VAL PT_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
) || match_regexp(line, lineNo, record, ACTIVE_QUAD_SPAN, "debugShowActiveSpans" +
" id=IDX QUAD_VAL t=T_VAL PT_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
) || match_regexp(line, lineNo, record, ACTIVE_CONIC_SPAN, "debugShowActiveSpans" +
" id=IDX CONIC_VAL t=T_VAL PT_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
) || match_regexp(line, lineNo, record, ACTIVE_CUBIC_SPAN, "debugShowActiveSpans" +
" id=IDX CUBIC_VAL t=T_VAL PT_VAL tEnd=T_VAL windSum=OPT oppSum=OPT windValue=IDX oppValue=NUM"
);
break;
case REC_TYPE_ACTIVE_OP:
found = match_regexp(line, lineNo, record, ACTIVE_OP, "activeOp" +
" id=IDX t=T_VAL tEnd=T_VAL op=OPER miFrom=NUM miTo=NUM suFrom=NUM suTo=NUM result=IDX"
);
break;
case REC_TYPE_ADD:
if (match_regexp(line, lineNo, record, ADD_MOVETO, "PATH.moveTo(P_VAL);")) {
moveX = record[1][0];
moveY = record[1][1];
found = true;
} else if (match_regexp(line, lineNo, record, ADD_LINETO, "PATH.lineTo(P_VAL);")) {
record[1].unshift(moveY);
record[1].unshift(moveX);
moveX = record[1][2];
moveY = record[1][3];
found = true;
} else if (match_regexp(line, lineNo, record, ADD_QUADTO, "PATH.quadTo(P_VAL, P_VAL);")) {
record[1].unshift(moveY);
record[1].unshift(moveX);
moveX = record[1][4];
moveY = record[1][5];
found = true;
} else if (match_regexp(line, lineNo, record, ADD_CONICTO, "PATH.conicTo(P_VAL, P_VAL, T_VAL);")) {
record[1].unshift(moveY);
record[1].unshift(moveX);
moveX = record[1][4];
moveY = record[1][5];
found = true;
} else if (match_regexp(line, lineNo, record, ADD_CUBICTO, "PATH.cubicTo(P_VAL, P_VAL, P_VAL);")) {
record[1].unshift(moveY);
record[1].unshift(moveX);
moveX = record[1][6];
moveY = record[1][7];
found = true;
} else if (match_regexp(line, lineNo, record, ADD_FILL, "PATH.setFillType(FILL_TYPE);")) {
found = true;
} else {
found = match_regexp(line, lineNo, record, ADD_CLOSE, "PATH.close();");
}
break;
case REC_TYPE_AFTERPART:
found = match_regexp(line, lineNo, record, PATH_LINE, "afterPart LINE_VAL")
|| match_regexp(line, lineNo, record, PATH_QUAD, "afterPart QUAD_VAL")
|| match_regexp(line, lineNo, record, PATH_CONIC, "afterPart CONIC_VAL")
|| match_regexp(line, lineNo, record, PATH_CUBIC, "afterPart CUBIC_VAL")
break;
case REC_TYPE_ANGLE:
found = match_regexp(line, lineNo, record, ANGLE_AFTER, "after " +
"[IDX/IDX] NUM/NUM tStart=T_VAL tEnd=T_VAL < [IDX/IDX] NUM/NUM tStart=T_VAL tEnd=T_VAL < [IDX/IDX] NUM/NUM tStart=T_VAL tEnd=T_VAL T_F IDX");
break;
case REC_TYPE_COIN:
found = true;
break;
case REC_TYPE_COINCIDENCE:
found = match_regexp(line, lineNo, record, COIN_MAIN_SPAN, "debugShowCoincidence" +
" + id=IDX t=T_VAL tEnd=T_VAL"
) || match_regexp(line, lineNo, record, COIN_OPP_SPAN, "debugShowCoincidence" +
" - id=IDX t=T_VAL tEnd=T_VAL"
);
break;
case REC_TYPE_COMPUTED:
found = line == "computed quadratics given"
|| match_regexp(line, lineNo, record, COMPUTED_SET_1, "computed quadratics set 1"
) || match_regexp(line, lineNo, record, COMPUTED_SET_2, "computed quadratics set 2"
) || match_regexp(line, lineNo, record, PATH_QUAD, " QUAD_VAL,"
) || match_regexp(line, lineNo, record, PATH_CONIC, " CONIC_VAL,"
) || match_regexp(line, lineNo, record, PATH_CUBIC, " CUBIC_VAL,"
);
break;
case REC_TYPE_PATH:
found = match_regexp(line, lineNo, record, PATH_LINE, "seg=IDX LINE_VAL"
) || match_regexp(line, lineNo, record, PATH_QUAD, "seg=IDX QUAD_VAL"
) || match_regexp(line, lineNo, record, PATH_CONIC, "seg=IDX CONIC_VAL"
) || match_regexp(line, lineNo, record, PATH_CUBIC, "seg=IDX CUBIC_VAL"
);
break;
case REC_TYPE_PATH2:
found = match_regexp(line, lineNo, record, PATH_LINE, "((SkOpSegment*) PTR_VAL) [IDX] {LINE_VAL}"
) || match_regexp(line, lineNo, record, PATH_QUAD, "((SkOpSegment*) PTR_VAL) [IDX] {QUAD_VAL}"
) || match_regexp(line, lineNo, record, PATH_CONIC, "((SkOpSegment*) PTR_VAL) [IDX] {CONIC_VAL}"
) || match_regexp(line, lineNo, record, PATH_CUBIC, "((SkOpSegment*) PTR_VAL) [IDX] {CUBIC_VAL}"
);
break;
case REC_TYPE_SECT:
found = match_regexp(line, lineNo, record, INTERSECT_LINE, "debugShowLineIntersection" +
" wtTs[0]=T_VAL LINE_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_LINE_2, "debugShowLineIntersection" +
" wtTs[0]=T_VAL LINE_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_LINE_NO, "debugShowLineIntersection" +
" no intersect LINE_VAL LINE_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE, "debugShowQuadLineIntersection" +
" wtTs[0]=T_VAL QUAD_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE_2, "debugShowQuadLineIntersection" +
" wtTs[0]=T_VAL QUAD_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_QUAD_LINE_NO, "debugShowQuadLineIntersection" +
" no intersect QUAD_VAL LINE_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_QUAD, "debugShowQuadIntersection" +
" wtTs[0]=T_VAL QUAD_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_QUAD_2, "debugShowQuadIntersection" +
" wtTs[0]=T_VAL QUAD_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_QUAD_NO, "debugShowQuadIntersection" +
" no intersect QUAD_VAL QUAD_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE, "debugShowConicLineIntersection" +
" wtTs[0]=T_VAL CONIC_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE_2, "debugShowConicLineIntersection" +
" wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CONIC_LINE_NO, "debugShowConicLineIntersection" +
" no intersect CONIC_VAL LINE_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CONIC, "debugShowConicIntersection" +
" wtTs[0]=T_VAL CONIC_VAL PT_VAL wnTs[0]=T_VAL CONIC_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CONIC_2, "debugShowConicIntersection" +
" wtTs[0]=T_VAL CONIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL CONIC_VAL wnTs[1]=T_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CONIC_NO, "debugShowConicIntersection" +
" no intersect CONIC_VAL CONIC_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE, "debugShowCubicLineIntersection" +
" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_2, "debugShowCubicLineIntersection" +
" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_3, "debugShowCubicLineIntersection" +
" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wnTs[0]=T_VAL LINE_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_LINE_NO, "debugShowCubicLineIntersection" +
" no intersect CUBIC_VAL LINE_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD, "debugShowCubicQuadIntersection" +
" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_2, "debugShowCubicQuadIntersection" +
" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_3, "debugShowCubicQuadIntersection" +
" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_4, "debugShowCubicQuadIntersection" +
" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL wtTs[3]=T_VAL PT_VAL wnTs[0]=T_VAL QUAD_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL wnTs[3]=T_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_QUAD_NO, "debugShowCubicQuadIntersection" +
" no intersect CUBIC_VAL QUAD_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CUBIC, "debugShowCubicIntersection" +
" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_2, "debugShowCubicIntersection" +
" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL wnTs[1]=T_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_3, "debugShowCubicIntersection" +
" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_4, "debugShowCubicIntersection" +
" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL PT_VAL wtTs[2]=T_VAL PT_VAL wtTs[3]=T_VAL PT_VAL wnTs[0]=T_VAL CUBIC_VAL wnTs[1]=T_VAL wnTs[2]=T_VAL wnTs[3]=T_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_CUBIC_NO, "debugShowCubicIntersection" +
" no intersect CUBIC_VAL CUBIC_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_SELF_CUBIC, "debugShowCubicIntersection" +
" wtTs[0]=T_VAL CUBIC_VAL PT_VAL wtTs[1]=T_VAL"
) || match_regexp(line, lineNo, record, INTERSECT_SELF_CUBIC_NO, "debugShowCubicIntersection" +
" no self intersect CUBIC_VAL"
);
break;
case REC_TYPE_SORT:
var hasDone = / done/.test(line);
var hasUnorderable = / unorderable/.test(line);
var hasSmall = / small/.test(line);
var hasTiny = / tiny/.test(line);
var hasOperand = / operand/.test(line);
var hasStop = / stop/.test(line);
line.replace(/[ a-z]+$/, "");
found = match_regexp(line, lineNo, record, SORT_UNARY, "debugOne" +
" [IDX/IDX] next=IDX/IDX sect=IDX/IDX s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT"
) || match_regexp(line, lineNo, record, SORT_BINARY, "debugOne" +
" [IDX/IDX] next=IDX/IDX sect=IDX/IDX s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT oppVal=IDX oppSum=OPT"
) || match_regexp(line, lineNo, record, SORT_UNARY, "dumpOne" +
" [IDX/IDX] next=IDX/IDX sect=NUM/NUM s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT"
) || match_regexp(line, lineNo, record, SORT_BINARY, "dumpOne" +
" [IDX/IDX] next=IDX/IDX sect=NUM/NUM s=T_VAL [IDX] e=T_VAL [IDX] sgn=NUM windVal=IDX windSum=OPT oppVal=IDX oppSum=OPT"
);
if (found) {
record[1].push(hasDone);
record[1].push(hasUnorderable);
record[1].push(hasSmall);
record[1].push(hasTiny);
record[1].push(hasOperand);
record[1].push(hasStop);
}
break;
case REC_TYPE_TOP:
found = match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" +
" id=IDX s=T_VAL e=T_VAL cw=NUM swap=NUM inflections=NUM monotonic=NUM"
) || match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" +
" id=IDX s=T_VAL e=T_VAL (-) cw=NUM swap=NUM inflections=NUM monotonic=NUM"
) || match_regexp(line, lineNo, record, ACTIVE_OP, "findTop" +
" id=IDX s=T_VAL e=T_VAL (+) cw=NUM swap=NUM inflections=NUM monotonic=NUM"
);
break;
case REC_TYPE_MARK:
found = match_regexp(line, lineNo, record, MARK_LINE, "markWinding" +
" id=IDX LINE_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX"
) || match_regexp(line, lineNo, record, MARK_QUAD, "markWinding" +
" id=IDX QUAD_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX"
) || match_regexp(line, lineNo, record, MARK_CONIC, "markWinding" +
" id=IDX CONIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX"
) || match_regexp(line, lineNo, record, MARK_CUBIC, "markWinding" +
" id=IDX CUBIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX"
) || match_regexp(line, lineNo, record, MARK_DONE_LINE, "markDone" +
" id=IDX LINE_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=OPT newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX oppValue=OPT"
) || match_regexp(line, lineNo, record, MARK_DONE_QUAD, "markDone" +
" id=IDX QUAD_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=OPT newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX oppValue=OPT"
) || match_regexp(line, lineNo, record, MARK_DONE_CONIC, "markDone" +
" id=IDX CONIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=OPT newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX oppValue=OPT"
) || match_regexp(line, lineNo, record, MARK_DONE_CUBIC, "markDone" +
" id=IDX CUBIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=OPT newOppSum=OPT oppSum=OPT windSum=OPT windValue=IDX oppValue=OPT"
) || match_regexp(line, lineNo, record, MARK_SIMPLE_LINE, "markWinding" +
" id=IDX LINE_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM windSum=OPT windValue=IDX"
) || match_regexp(line, lineNo, record, MARK_SIMPLE_QUAD, "markWinding" +
" id=IDX QUAD_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM windSum=OPT windValue=IDX"
) || match_regexp(line, lineNo, record, MARK_SIMPLE_CONIC, "markWinding" +
" id=IDX CONIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM windSum=OPT windValue=IDX"
) || match_regexp(line, lineNo, record, MARK_SIMPLE_CUBIC, "markWinding" +
" id=IDX CUBIC_VAL t=T_VAL [IDX] PT_VAL tEnd=T_VAL newWindSum=NUM windSum=OPT windValue=IDX"
) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" +
" last segment=IDX span=IDX"
) || match_regexp(line, lineNo, record, MARK_ANGLE_LAST, "markAngle" +
" last segment=IDX span=IDX windSum=OPT");
break;
case REC_TYPE_OP:
if (line.lastIndexOf("oppSign oppSign=", 0) === 0
|| line.lastIndexOf("operator<", 0) === 0) {
found = true;
break;
}
found = match_regexp(line, lineNo, record, OP_DIFFERENCE, "op diff"
) || match_regexp(line, lineNo, record, OP_INTERSECT, "op intersect"
) || match_regexp(line, lineNo, record, OP_INTERSECT, "op sect"
) || match_regexp(line, lineNo, record, OP_UNION, "op union"
) || match_regexp(line, lineNo, record, OP_XOR, "op xor"
);
break;
case REC_TYPE_UNKNOWN:
found = true;
break;
}
if (!found) {
console.log(line + " [" + lineNo + "] of type " + type + " not found");
}
}
if (recType != REC_TYPE_UNKNOWN) {
records.push(recType);
records.push(lastLineNo);
records.push(record);
}
if (records.length >= 1) {
tests[testIndex] = records;
testLines[testIndex] = lines;
}
}
function init(test) {
var canvas = document.getElementById('canvas');
if (!canvas.getContext) return;
ctx = canvas.getContext('2d');
var resScale = retina_scale && window.devicePixelRatio ? window.devicePixelRatio : 1;
var unscaledWidth = window.innerWidth - 20;
var unscaledHeight = window.innerHeight - 20;
screenWidth = unscaledWidth;
screenHeight = unscaledHeight;
canvas.width = unscaledWidth * resScale;
canvas.height = unscaledHeight * resScale;
canvas.style.width = unscaledWidth + 'px';
canvas.style.height = unscaledHeight + 'px';
if (resScale != 1) {
ctx.scale(resScale, resScale);
}
xmin = Infinity;
xmax = -Infinity;
ymin = Infinity;
ymax = -Infinity;
hasPath = hasComputedPath = false;
firstActiveSpan = -1;
for (var tIndex = 0; tIndex < test.length; tIndex += 3) {
var recType = test[tIndex];
if (!typeof recType == 'number' || recType < REC_TYPE_UNKNOWN || recType > REC_TYPE_LAST) {
console.log("unknown rec type: " + recType);
throw "stop execution";
}
var records = test[tIndex + 2];
for (var recordIndex = 0; recordIndex < records.length; recordIndex += 2) {
var fragType = records[recordIndex];
if (!typeof fragType == 'number' || fragType < 1 || fragType > FRAG_TYPE_LAST) {
console.log("unknown in range frag type: " + fragType);
throw "stop execution";
}
var frags = records[recordIndex + 1];
var first = 0;
var last = -1;
var first2 = 0;
var last2 = 0;
switch (recType) {
case REC_TYPE_COMPUTED:
if (fragType == COMPUTED_SET_1 || fragType == COMPUTED_SET_2) {
break;
}
hasComputedPath = true;
case REC_TYPE_PATH:
first = 1;
switch (fragType) {
case PATH_LINE:
last = 5;
break;
case PATH_CONIC:
case PATH_QUAD:
last = 7;
break;
case PATH_CUBIC:
last = 9;
break;
default:
console.log("unknown " + (recType == REC_TYPE_PATH ? "REC_TYPE_PATH"
: "REC_TYPE_COMPUTED") + " frag type:" + fragType);
throw "stop execution";
}
if (recType == REC_TYPE_PATH) {
hasPath = true;
}
break;
case REC_TYPE_PATH2:
first = 1;
switch (fragType) {
case PATH_LINE:
last = 5;
break;
case PATH_CONIC:
case PATH_QUAD:
last = 7;
break;
case PATH_CUBIC:
last = 9;
break;
default:
console.log("unknown " + (recType == REC_TYPE_PATH2 ? "REC_TYPE_PATH2"
: "REC_TYPE_COMPUTED") + " frag type:" + fragType);
throw "stop execution";
}
if (recType == REC_TYPE_PATH2) {
hasPath = true;
}
break;
case REC_TYPE_ACTIVE:
if (firstActiveSpan < 0) {
firstActiveSpan = tIndex;
}
first = 1;
switch (fragType) {
case ACTIVE_LINE_SPAN:
last = 5;
break;
case ACTIVE_CONIC_SPAN:
case ACTIVE_QUAD_SPAN:
last = 7;
break;
case ACTIVE_CUBIC_SPAN:
last = 9;
break;
default:
console.log("unknown REC_TYPE_ACTIVE frag type: " + fragType);
throw "stop execution";
}
break;
case REC_TYPE_ADD:
switch (fragType) {
case ADD_MOVETO:
break;
case ADD_LINETO:
last = 4;
break;
case ADD_CONICTO:
case ADD_QUADTO:
last = 6;
break;
case ADD_CUBICTO:
last = 8;
break;
case ADD_CLOSE:
case ADD_FILL:
break;
default:
console.log("unknown REC_TYPE_ADD frag type: " + fragType);
throw "stop execution";
}
break;
case REC_TYPE_AFTERPART:
switch (fragType) {
case PATH_LINE:
last = 4;
break;
case PATH_CONIC:
case PATH_QUAD:
last = 6;
break;
case PATH_CUBIC:
last = 8;
break;
default:
console.log("unknown REC_TYPE_ACTIVEPART frag type: " + fragType);
throw "stop execution";
}
break;