From 6eb4e36a93ea695e7adb771ea9ac3326680a8e98 Mon Sep 17 00:00:00 2001 From: mtklein Date: Wed, 6 Jan 2016 14:20:29 -0800 Subject: [PATCH] DM: add a pixel check to serialize If we're running through serialize and then drawing into some raster target (e.g. serialize-8888 like we run on the bots), make sure the serialized version is identical to what we'd get if we just drew into the rest of the pipeline (i.e. 8888). Start by blacklisting all current failures. This at least prevents further regression. BUG=skia:4095 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1561993003 Review URL: https://codereview.chromium.org/1561993003 --- dm/DMSrcSink.cpp | 18 + tools/dm_flags.json | 932 +++++++++++++++++++++++++++++++++++++++++++++++++++- tools/dm_flags.py | 24 +- 3 files changed, 963 insertions(+), 11 deletions(-) diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp index fa600ff..82962ff 100644 --- a/dm/DMSrcSink.cpp +++ b/dm/DMSrcSink.cpp @@ -1084,6 +1084,15 @@ Error ViaRemote::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkStr Error ViaSerialization::draw( const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const { + // Draw the Src directly as a reference. + SkBitmap reference; + if (bitmap) { + Error err = fSink->draw(src, &reference, nullptr, log); + if (!err.isEmpty()) { + return err; + } + } + // Record our Src into a picture. auto size = src.size(); SkPictureRecorder recorder; @@ -1102,6 +1111,15 @@ Error ViaSerialization::draw( return draw_to_canvas(fSink, bitmap, stream, log, size, [&](SkCanvas* canvas) { canvas->drawPicture(deserialized); + // Check against the reference if we have one. + if (bitmap) { + if (reference.getSize() != bitmap->getSize()) { + return "Serialized and direct have different dimensions."; + } + if (0 != memcmp(reference.getPixels(), bitmap->getPixels(), reference.getSize())) { + return "Serialized and direct have different pixels."; + } + } return ""; }); } diff --git a/tools/dm_flags.json b/tools/dm_flags.json index 5731b05..5246585 100644 --- a/tools/dm_flags.json +++ b/tools/dm_flags.json @@ -188,7 +188,83 @@ "msaa16", "gm", "_", - "tilemodesProcess" + "tilemodesProcess", + "serialize-8888", + "gm", + "_", + "not_native32_bitmap_config", + "serialize-8888", + "gm", + "_", + "bleed_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image_shader", + "serialize-8888", + "gm", + "_", + "blend", + "serialize-8888", + "gm", + "_", + "c_gms", + "serialize-8888", + "gm", + "_", + "colortype", + "serialize-8888", + "gm", + "_", + "colortype_xfermodes", + "serialize-8888", + "gm", + "_", + "colorwheelnative", + "serialize-8888", + "gm", + "_", + "drawfilter", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_0.75_0", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_1_-0.25", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds", + "serialize-8888", + "gm", + "_", + "fontmgr_match", + "serialize-8888", + "gm", + "_", + "fontmgr_iter", + "serialize-8888", + "gm", + "_", + "lightingshader", + "serialize-8888", + "gm", + "_", + "localmatriximagefilter", + "serialize-8888", + "gm", + "_", + "path_stroke_with_zero_length", + "serialize-8888", + "gm", + "_", + "textblobgeometrychange" ], "Test-Android-GCC-AndroidOne-GPU-Mali400MP2-Arm7-Release": [ "--config", @@ -351,6 +427,82 @@ "image", "decode", "inc14.png", + "serialize-8888", + "gm", + "_", + "not_native32_bitmap_config", + "serialize-8888", + "gm", + "_", + "bleed_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image_shader", + "serialize-8888", + "gm", + "_", + "blend", + "serialize-8888", + "gm", + "_", + "c_gms", + "serialize-8888", + "gm", + "_", + "colortype", + "serialize-8888", + "gm", + "_", + "colortype_xfermodes", + "serialize-8888", + "gm", + "_", + "colorwheelnative", + "serialize-8888", + "gm", + "_", + "drawfilter", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_0.75_0", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_1_-0.25", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds", + "serialize-8888", + "gm", + "_", + "fontmgr_match", + "serialize-8888", + "gm", + "_", + "fontmgr_iter", + "serialize-8888", + "gm", + "_", + "lightingshader", + "serialize-8888", + "gm", + "_", + "localmatriximagefilter", + "serialize-8888", + "gm", + "_", + "path_stroke_with_zero_length", + "serialize-8888", + "gm", + "_", + "textblobgeometrychange", "--match", "~WritePixels" ], @@ -518,6 +670,82 @@ "image", "decode", "inc14.png", + "serialize-8888", + "gm", + "_", + "not_native32_bitmap_config", + "serialize-8888", + "gm", + "_", + "bleed_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image_shader", + "serialize-8888", + "gm", + "_", + "blend", + "serialize-8888", + "gm", + "_", + "c_gms", + "serialize-8888", + "gm", + "_", + "colortype", + "serialize-8888", + "gm", + "_", + "colortype_xfermodes", + "serialize-8888", + "gm", + "_", + "colorwheelnative", + "serialize-8888", + "gm", + "_", + "drawfilter", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_0.75_0", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_1_-0.25", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds", + "serialize-8888", + "gm", + "_", + "fontmgr_match", + "serialize-8888", + "gm", + "_", + "fontmgr_iter", + "serialize-8888", + "gm", + "_", + "lightingshader", + "serialize-8888", + "gm", + "_", + "localmatriximagefilter", + "serialize-8888", + "gm", + "_", + "path_stroke_with_zero_length", + "serialize-8888", + "gm", + "_", + "textblobgeometrychange", "--match", "~WritePixels" ], @@ -683,6 +911,82 @@ "image", "decode", "inc14.png", + "serialize-8888", + "gm", + "_", + "not_native32_bitmap_config", + "serialize-8888", + "gm", + "_", + "bleed_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image_shader", + "serialize-8888", + "gm", + "_", + "blend", + "serialize-8888", + "gm", + "_", + "c_gms", + "serialize-8888", + "gm", + "_", + "colortype", + "serialize-8888", + "gm", + "_", + "colortype_xfermodes", + "serialize-8888", + "gm", + "_", + "colorwheelnative", + "serialize-8888", + "gm", + "_", + "drawfilter", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_0.75_0", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_1_-0.25", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds", + "serialize-8888", + "gm", + "_", + "fontmgr_match", + "serialize-8888", + "gm", + "_", + "fontmgr_iter", + "serialize-8888", + "gm", + "_", + "lightingshader", + "serialize-8888", + "gm", + "_", + "localmatriximagefilter", + "serialize-8888", + "gm", + "_", + "path_stroke_with_zero_length", + "serialize-8888", + "gm", + "_", + "textblobgeometrychange", "--match", "~imagefiltersclipped", "~imagefilterscropexpand", @@ -849,7 +1153,83 @@ "_", "image", "decode", - "inc14.png" + "inc14.png", + "serialize-8888", + "gm", + "_", + "not_native32_bitmap_config", + "serialize-8888", + "gm", + "_", + "bleed_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image_shader", + "serialize-8888", + "gm", + "_", + "blend", + "serialize-8888", + "gm", + "_", + "c_gms", + "serialize-8888", + "gm", + "_", + "colortype", + "serialize-8888", + "gm", + "_", + "colortype_xfermodes", + "serialize-8888", + "gm", + "_", + "colorwheelnative", + "serialize-8888", + "gm", + "_", + "drawfilter", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_0.75_0", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_1_-0.25", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds", + "serialize-8888", + "gm", + "_", + "fontmgr_match", + "serialize-8888", + "gm", + "_", + "fontmgr_iter", + "serialize-8888", + "gm", + "_", + "lightingshader", + "serialize-8888", + "gm", + "_", + "localmatriximagefilter", + "serialize-8888", + "gm", + "_", + "path_stroke_with_zero_length", + "serialize-8888", + "gm", + "_", + "textblobgeometrychange" ], "Test-Android-GCC-Nexus9-GPU-TegraK1-Arm64-Debug": [ "--config", @@ -1012,7 +1392,83 @@ "_", "image", "decode", - "inc14.png" + "inc14.png", + "serialize-8888", + "gm", + "_", + "not_native32_bitmap_config", + "serialize-8888", + "gm", + "_", + "bleed_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image_shader", + "serialize-8888", + "gm", + "_", + "blend", + "serialize-8888", + "gm", + "_", + "c_gms", + "serialize-8888", + "gm", + "_", + "colortype", + "serialize-8888", + "gm", + "_", + "colortype_xfermodes", + "serialize-8888", + "gm", + "_", + "colorwheelnative", + "serialize-8888", + "gm", + "_", + "drawfilter", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_0.75_0", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_1_-0.25", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds", + "serialize-8888", + "gm", + "_", + "fontmgr_match", + "serialize-8888", + "gm", + "_", + "fontmgr_iter", + "serialize-8888", + "gm", + "_", + "lightingshader", + "serialize-8888", + "gm", + "_", + "localmatriximagefilter", + "serialize-8888", + "gm", + "_", + "path_stroke_with_zero_length", + "serialize-8888", + "gm", + "_", + "textblobgeometrychange" ], "Test-Android-GCC-NexusPlayer-CPU-SSSE3-x86-Release": [ "--config", @@ -1184,6 +1640,82 @@ "image", "_", "interlaced3.png", + "serialize-8888", + "gm", + "_", + "not_native32_bitmap_config", + "serialize-8888", + "gm", + "_", + "bleed_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image_shader", + "serialize-8888", + "gm", + "_", + "blend", + "serialize-8888", + "gm", + "_", + "c_gms", + "serialize-8888", + "gm", + "_", + "colortype", + "serialize-8888", + "gm", + "_", + "colortype_xfermodes", + "serialize-8888", + "gm", + "_", + "colorwheelnative", + "serialize-8888", + "gm", + "_", + "drawfilter", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_0.75_0", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_1_-0.25", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds", + "serialize-8888", + "gm", + "_", + "fontmgr_match", + "serialize-8888", + "gm", + "_", + "fontmgr_iter", + "serialize-8888", + "gm", + "_", + "lightingshader", + "serialize-8888", + "gm", + "_", + "localmatriximagefilter", + "serialize-8888", + "gm", + "_", + "path_stroke_with_zero_length", + "serialize-8888", + "gm", + "_", + "textblobgeometrychange", "--match", "~ResourceCache" ], @@ -1363,17 +1895,93 @@ "decode", "inc14.png", "_", - "image", + "image", + "_", + "interlaced1.png", + "_", + "image", + "_", + "interlaced2.png", + "_", + "image", + "_", + "interlaced3.png", + "serialize-8888", + "gm", + "_", + "not_native32_bitmap_config", + "serialize-8888", + "gm", + "_", + "bleed_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image_shader", + "serialize-8888", + "gm", + "_", + "blend", + "serialize-8888", + "gm", + "_", + "c_gms", + "serialize-8888", + "gm", + "_", + "colortype", + "serialize-8888", + "gm", + "_", + "colortype_xfermodes", + "serialize-8888", + "gm", + "_", + "colorwheelnative", + "serialize-8888", + "gm", + "_", + "drawfilter", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_0.75_0", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_1_-0.25", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds", + "serialize-8888", + "gm", "_", - "interlaced1.png", + "fontmgr_match", + "serialize-8888", + "gm", "_", - "image", + "fontmgr_iter", + "serialize-8888", + "gm", "_", - "interlaced2.png", + "lightingshader", + "serialize-8888", + "gm", "_", - "image", + "localmatriximagefilter", + "serialize-8888", + "gm", "_", - "interlaced3.png" + "path_stroke_with_zero_length", + "serialize-8888", + "gm", + "_", + "textblobgeometrychange" ], "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN": [ "--matrix", @@ -1560,7 +2168,83 @@ "_", "image", "_", - "interlaced3.png" + "interlaced3.png", + "serialize-8888", + "gm", + "_", + "not_native32_bitmap_config", + "serialize-8888", + "gm", + "_", + "bleed_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image_shader", + "serialize-8888", + "gm", + "_", + "blend", + "serialize-8888", + "gm", + "_", + "c_gms", + "serialize-8888", + "gm", + "_", + "colortype", + "serialize-8888", + "gm", + "_", + "colortype_xfermodes", + "serialize-8888", + "gm", + "_", + "colorwheelnative", + "serialize-8888", + "gm", + "_", + "drawfilter", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_0.75_0", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_1_-0.25", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds", + "serialize-8888", + "gm", + "_", + "fontmgr_match", + "serialize-8888", + "gm", + "_", + "fontmgr_iter", + "serialize-8888", + "gm", + "_", + "lightingshader", + "serialize-8888", + "gm", + "_", + "localmatriximagefilter", + "serialize-8888", + "gm", + "_", + "path_stroke_with_zero_length", + "serialize-8888", + "gm", + "_", + "textblobgeometrychange" ], "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Valgrind": [ "--matrix", @@ -1768,6 +2452,82 @@ "image", "_", "interlaced3.png", + "serialize-8888", + "gm", + "_", + "not_native32_bitmap_config", + "serialize-8888", + "gm", + "_", + "bleed_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image_shader", + "serialize-8888", + "gm", + "_", + "blend", + "serialize-8888", + "gm", + "_", + "c_gms", + "serialize-8888", + "gm", + "_", + "colortype", + "serialize-8888", + "gm", + "_", + "colortype_xfermodes", + "serialize-8888", + "gm", + "_", + "colorwheelnative", + "serialize-8888", + "gm", + "_", + "drawfilter", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_0.75_0", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_1_-0.25", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds", + "serialize-8888", + "gm", + "_", + "fontmgr_match", + "serialize-8888", + "gm", + "_", + "fontmgr_iter", + "serialize-8888", + "gm", + "_", + "lightingshader", + "serialize-8888", + "gm", + "_", + "localmatriximagefilter", + "serialize-8888", + "gm", + "_", + "path_stroke_with_zero_length", + "serialize-8888", + "gm", + "_", + "textblobgeometrychange", "--match", "~Threaded" ], @@ -1974,6 +2734,82 @@ "image", "_", "interlaced3.png", + "serialize-8888", + "gm", + "_", + "not_native32_bitmap_config", + "serialize-8888", + "gm", + "_", + "bleed_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image_shader", + "serialize-8888", + "gm", + "_", + "blend", + "serialize-8888", + "gm", + "_", + "c_gms", + "serialize-8888", + "gm", + "_", + "colortype", + "serialize-8888", + "gm", + "_", + "colortype_xfermodes", + "serialize-8888", + "gm", + "_", + "colorwheelnative", + "serialize-8888", + "gm", + "_", + "drawfilter", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_0.75_0", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_1_-0.25", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds", + "serialize-8888", + "gm", + "_", + "fontmgr_match", + "serialize-8888", + "gm", + "_", + "fontmgr_iter", + "serialize-8888", + "gm", + "_", + "lightingshader", + "serialize-8888", + "gm", + "_", + "localmatriximagefilter", + "serialize-8888", + "gm", + "_", + "path_stroke_with_zero_length", + "serialize-8888", + "gm", + "_", + "textblobgeometrychange", "--match", "~Threaded" ], @@ -2172,6 +3008,82 @@ "image", "_", "interlaced3.png", + "serialize-8888", + "gm", + "_", + "not_native32_bitmap_config", + "serialize-8888", + "gm", + "_", + "bleed_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image", + "serialize-8888", + "gm", + "_", + "bleed_alpha_image_shader", + "serialize-8888", + "gm", + "_", + "blend", + "serialize-8888", + "gm", + "_", + "c_gms", + "serialize-8888", + "gm", + "_", + "colortype", + "serialize-8888", + "gm", + "_", + "colortype_xfermodes", + "serialize-8888", + "gm", + "_", + "colorwheelnative", + "serialize-8888", + "gm", + "_", + "drawfilter", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_0.75_0", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds_1_-0.25", + "serialize-8888", + "gm", + "_", + "fontmgr_bounds", + "serialize-8888", + "gm", + "_", + "fontmgr_match", + "serialize-8888", + "gm", + "_", + "fontmgr_iter", + "serialize-8888", + "gm", + "_", + "lightingshader", + "serialize-8888", + "gm", + "_", + "localmatriximagefilter", + "serialize-8888", + "gm", + "_", + "path_stroke_with_zero_length", + "serialize-8888", + "gm", + "_", + "textblobgeometrychange", "--match", "~GLPrograms" ] diff --git a/tools/dm_flags.py b/tools/dm_flags.py index 928d3fe..da7f537 100755 --- a/tools/dm_flags.py +++ b/tools/dm_flags.py @@ -168,6 +168,28 @@ def get_args(bot): blacklist.extend('_ image _ interlaced2.png'.split(' ')) blacklist.extend('_ image _ interlaced3.png'.split(' ')) + # skia:4095 + for test in ['not_native32_bitmap_config', + 'bleed_image', + 'bleed_alpha_image', + 'bleed_alpha_image_shader', + 'blend', + 'c_gms', + 'colortype', + 'colortype_xfermodes', + 'colorwheelnative', + 'drawfilter', + 'fontmgr_bounds_0.75_0', + 'fontmgr_bounds_1_-0.25', + 'fontmgr_bounds', + 'fontmgr_match', + 'fontmgr_iter', + 'lightingshader', + 'localmatriximagefilter', + 'path_stroke_with_zero_length', + 'textblobgeometrychange']: + blacklist.extend(['serialize-8888', 'gm', '_', test]) + if blacklist: args.append('--blacklist') args.extend(blacklist) @@ -178,7 +200,7 @@ def get_args(bot): if 'GalaxyS3' in bot: # skia:1699 match.append('~WritePixels') - + if 'AndroidOne' in bot: # skia:4711 match.append('~WritePixels') -- 2.7.4