@@ -269,64 +269,4 @@ void main() {
269269 expectArgumentError (() => canvas.drawRawAtlas (image, Float32List (0 ), Float32List (4 ), null , null , rect, paint));
270270 expectArgumentError (() => canvas.drawRawAtlas (image, Float32List (4 ), Float32List (4 ), Int32List (2 ), BlendMode .src, rect, paint));
271271 });
272-
273- test ('Vertex buffer size reflected in picture size for drawVertices' , () async {
274- final PictureRecorder recorder = PictureRecorder ();
275- final Canvas canvas = Canvas (recorder);
276-
277- const int uint16max = 65535 ;
278-
279- final Int32List colors = Int32List (uint16max);
280- final Float32List coords = Float32List (uint16max * 2 );
281- final Uint16List indices = Uint16List (uint16max);
282- final Float32List positions = Float32List (uint16max * 2 );
283- colors[0 ] = const Color (0xFFFF0000 ).value;
284- colors[1 ] = const Color (0xFF00FF00 ).value;
285- colors[2 ] = const Color (0xFF0000FF ).value;
286- colors[3 ] = const Color (0xFF00FFFF ).value;
287- indices[1 ] = indices[3 ] = 1 ;
288- indices[2 ] = indices[5 ] = 3 ;
289- indices[4 ] = 2 ;
290- positions[2 ] = positions[4 ] = positions[5 ] = positions[7 ] = 250.0 ;
291-
292- final Vertices vertices = Vertices .raw (
293- VertexMode .triangles,
294- positions,
295- textureCoordinates: coords,
296- colors: colors,
297- indices: indices,
298- );
299- canvas.drawVertices (vertices, BlendMode .src, Paint ());
300- final Picture picture = recorder.endRecording ();
301-
302-
303- const int minimumExpected = uint16max * 4 ;
304- expect (picture.approximateBytesUsed, greaterThan (minimumExpected));
305-
306- final PictureRecorder recorder2 = PictureRecorder ();
307- final Canvas canvas2 = Canvas (recorder2);
308- canvas2.drawPicture (picture);
309- final Picture picture2 = recorder2.endRecording ();
310-
311- expect (picture2.approximateBytesUsed, greaterThan (minimumExpected));
312- });
313-
314- test ('Path reflected in picture size for drawPath, clipPath, and drawShadow' , () async {
315- final PictureRecorder recorder = PictureRecorder ();
316- final Canvas canvas = Canvas (recorder);
317- final Path path = Path ();
318- for (int i = 0 ; i < 10000 ; i++ ) {
319- path.lineTo (5 , 9 );
320- path.lineTo (i.toDouble (), i.toDouble ());
321- }
322- path.close ();
323- canvas.drawPath (path, Paint ());
324- canvas.drawShadow (path, const Color (0xFF000000 ), 5.0 , false );
325- canvas.clipPath (path);
326- final Picture picture = recorder.endRecording ();
327-
328- // Slightly fuzzy here to allow for platform specific differences
329- // Measurement on macOS: 541078
330- expect (picture.approximateBytesUsed, greaterThan (530000 ));
331- });
332272}
0 commit comments