@@ -42,9 +42,13 @@ if(argv._.length === 0) {
42
42
// Build list of mocks to compare
43
43
var allMockList = [ ] ;
44
44
var mathjax3 ;
45
+ var virtualWebgl = false ;
45
46
argv . _ . forEach ( function ( pattern ) {
46
47
if ( pattern === 'mathjax3' ) {
47
48
mathjax3 = true ;
49
+ } else if ( pattern === 'virtual-webgl' ) {
50
+ virtualWebgl = true ;
51
+ allMockList = getMockList ( '' ) ;
48
52
} else {
49
53
var mockList = getMockList ( pattern ) ;
50
54
@@ -66,6 +70,12 @@ allMockList = allMockList.filter(function(a) {
66
70
) ;
67
71
} ) ;
68
72
73
+ if ( virtualWebgl ) {
74
+ allMockList = allMockList . filter ( function ( a ) {
75
+ return a . slice ( 0 , 2 ) === 'gl' || a . slice ( 0 , 6 ) === 'mapbox' ;
76
+ } ) ;
77
+ }
78
+
69
79
if ( mathjax3 ) {
70
80
allMockList = [
71
81
'legend_mathjax_title_and_items' ,
@@ -91,6 +101,7 @@ var fail = function(mockName) {
91
101
failed . push ( mockName ) ;
92
102
}
93
103
} ;
104
+
94
105
for ( var i = 0 ; i < allMockList . length ; i ++ ) {
95
106
var mockName = allMockList [ i ] ;
96
107
@@ -102,6 +113,18 @@ for(var i = 0; i < allMockList.length; i++) {
102
113
continue ;
103
114
}
104
115
116
+ // the following mocks than only have regl-line2d lines (no morkers),
117
+ // do not render at first draw when using virtual webgl. TODO: find a fix
118
+ if ( virtualWebgl && [
119
+ 'gl2d_connect_gaps' ,
120
+ 'gl2d_line_select' ,
121
+ 'gl2d_lines_almost_horizontal_vertical' ,
122
+ 'gl2d_scattergl_simple_line_reversed_ranges' ,
123
+ 'gl2d_subplots_anchor'
124
+ ] . indexOf ( mockName ) !== - 1 ) {
125
+ continue ;
126
+ }
127
+
105
128
var isMapbox = mockName . substr ( 0 , 7 ) === 'mapbox_' ;
106
129
var isOtherFlaky = [
107
130
// list flaky mocks other than mapbox:
@@ -151,15 +174,28 @@ for(var i = 0; i < allMockList.length; i++) {
151
174
152
175
var shouldBePixelPerfect = ! ( isMapbox || isOtherFlaky ) ;
153
176
177
+ var threshold = shouldBePixelPerfect ? 0 : [
178
+ // more flaky
179
+ 'mapbox_angles' ,
180
+ 'mapbox_layers' ,
181
+ 'mapbox_custom-style' ,
182
+ 'mapbox_geojson-attributes'
183
+ ] . indexOf ( mockName ) !== - 1 ? 1 : 0.15 ;
184
+
185
+ if ( virtualWebgl ) {
186
+ threshold = Math . max ( 0.4 , threshold ) ;
187
+ if ( [
188
+ 'gl3d_ibm-plot' ,
189
+ 'gl3d_isosurface_2surfaces-checker_spaceframe' ,
190
+ 'gl3d_opacity-scaling-spikes' ,
191
+ 'gl3d_cone-wind' ,
192
+ 'gl3d_isosurface_math' ,
193
+ 'gl3d_scatter3d-blank-text'
194
+ ] . indexOf ( mockName ) !== - 1 ) threshold = 0.7 ;
195
+ }
196
+
154
197
var numDiffPixels = pixelmatch ( img0 . data , img1 . data , diff . data , width , height , {
155
- threshold : shouldBePixelPerfect ? 0 :
156
- [
157
- // more flaky
158
- 'mapbox_angles' ,
159
- 'mapbox_layers' ,
160
- 'mapbox_custom-style' ,
161
- 'mapbox_geojson-attributes'
162
- ] . indexOf ( mockName ) !== - 1 ? 1 : 0.15
198
+ threshold : threshold
163
199
} ) ;
164
200
165
201
if ( numDiffPixels ) {
0 commit comments