diff --git a/dm/DM.cpp b/dm/DM.cpp index 4728933f2c..ee9a7f5678 100644 --- a/dm/DM.cpp +++ b/dm/DM.cpp @@ -894,6 +894,7 @@ static Sink* create_sink(const GrContextOptions& grCtxOptions, const SkCommandLi auto srgbColorSpace = SkColorSpace::MakeSRGB(); auto srgbLinearColorSpace = SkColorSpace::MakeSRGBLinear(); + SINK("g8", RasterSink, kGray_8_SkColorType); SINK("565", RasterSink, kRGB_565_SkColorType); SINK("8888", RasterSink, kN32_SkColorType); SINK("srgb", RasterSink, kN32_SkColorType, srgbColorSpace); diff --git a/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json b/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json index 8a032f71db..345527cdad 100644 --- a/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json +++ b/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json @@ -165,6 +165,7 @@ "8888", "srgb", "pdf", + "g8", "565", "f16", "sp-8888", @@ -197,6 +198,14 @@ "colorImage", "_", "_", + "g8", + "image", + "_", + "_", + "g8", + "colorImage", + "_", + "_", "serialize-8888", "gm", "_", diff --git a/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json b/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json index ff0a718297..6f673f1abe 100644 --- a/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json +++ b/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json @@ -164,6 +164,7 @@ "8888", "srgb", "pdf", + "g8", "565", "f16", "sp-8888", @@ -191,6 +192,14 @@ "colorImage", "_", "_", + "g8", + "image", + "_", + "_", + "g8", + "colorImage", + "_", + "_", "serialize-8888", "gm", "_", diff --git a/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json b/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json index d99413def9..8410e0e313 100644 --- a/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json +++ b/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json @@ -236,6 +236,7 @@ "8888", "srgb", "pdf", + "g8", "565", "f16", "sp-8888", @@ -263,6 +264,14 @@ "colorImage", "_", "_", + "g8", + "image", + "_", + "_", + "g8", + "colorImage", + "_", + "_", "serialize-8888", "gm", "_", diff --git a/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-shard_00_10-Coverage.json b/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-shard_00_10-Coverage.json index cf4ed0aa25..bce495b933 100644 --- a/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-shard_00_10-Coverage.json +++ b/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-shard_00_10-Coverage.json @@ -170,6 +170,7 @@ "8888", "srgb", "pdf", + "g8", "565", "f16", "sp-8888", @@ -197,6 +198,14 @@ "colorImage", "_", "_", + "g8", + "image", + "_", + "_", + "g8", + "colorImage", + "_", + "_", "serialize-8888", "gm", "_", diff --git a/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json b/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json index 559e8374a5..ca76df809a 100644 --- a/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json +++ b/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json @@ -165,6 +165,7 @@ "8888", "srgb", "pdf", + "g8", "565", "f16", "sp-8888", @@ -192,6 +193,14 @@ "colorImage", "_", "_", + "g8", + "image", + "_", + "_", + "g8", + "colorImage", + "_", + "_", "serialize-8888", "gm", "_", diff --git a/infra/bots/recipes/test.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86-Debug-All.json b/infra/bots/recipes/test.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86-Debug-All.json index df767c26c5..69191ba1b5 100644 --- a/infra/bots/recipes/test.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86-Debug-All.json +++ b/infra/bots/recipes/test.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86-Debug-All.json @@ -234,6 +234,7 @@ "8888", "srgb", "pdf", + "g8", "565", "f16", "sp-8888", @@ -261,6 +262,14 @@ "colorImage", "_", "_", + "g8", + "image", + "_", + "_", + "g8", + "colorImage", + "_", + "_", "serialize-8888", "gm", "_", diff --git a/infra/bots/recipes/test.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Debug-All.json b/infra/bots/recipes/test.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Debug-All.json index 4bb24649de..360a9a297d 100644 --- a/infra/bots/recipes/test.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Debug-All.json +++ b/infra/bots/recipes/test.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Debug-All.json @@ -232,6 +232,7 @@ "8888", "srgb", "pdf", + "g8", "565", "f16", "sp-8888", @@ -259,6 +260,14 @@ "colorImage", "_", "_", + "g8", + "image", + "_", + "_", + "g8", + "colorImage", + "_", + "_", "serialize-8888", "gm", "_", diff --git a/infra/bots/recipes/test.expected/failed_dm.json b/infra/bots/recipes/test.expected/failed_dm.json index c220fd660b..a1c44c9c87 100644 --- a/infra/bots/recipes/test.expected/failed_dm.json +++ b/infra/bots/recipes/test.expected/failed_dm.json @@ -232,6 +232,7 @@ "8888", "srgb", "pdf", + "g8", "565", "f16", "sp-8888", @@ -259,6 +260,14 @@ "colorImage", "_", "_", + "g8", + "image", + "_", + "_", + "g8", + "colorImage", + "_", + "_", "serialize-8888", "gm", "_", diff --git a/infra/bots/recipes/test.expected/trybot.json b/infra/bots/recipes/test.expected/trybot.json index 92c0d66bf2..0b190277d9 100644 --- a/infra/bots/recipes/test.expected/trybot.json +++ b/infra/bots/recipes/test.expected/trybot.json @@ -233,6 +233,7 @@ "8888", "srgb", "pdf", + "g8", "565", "f16", "sp-8888", @@ -260,6 +261,14 @@ "colorImage", "_", "_", + "g8", + "image", + "_", + "_", + "g8", + "colorImage", + "_", + "_", "_", "image", "gen_platf", diff --git a/infra/bots/recipes/test.py b/infra/bots/recipes/test.py index bdfbae925c..bfa5228ffe 100644 --- a/infra/bots/recipes/test.py +++ b/infra/bots/recipes/test.py @@ -94,6 +94,7 @@ def dm_flags(api, bot): configs.remove('pdf') if '-GCE-' in bot: + configs.extend(['g8']) configs.extend(['565']) configs.extend(['f16']) configs.extend(['sp-8888', '2ndpic-8888']) # Test niche uses of SkPicture. @@ -267,6 +268,10 @@ def dm_flags(api, bot): blacklist('gbr-8888 image _ _') blacklist('gbr-8888 colorImage _ _') + # --src image --config g8 means "decode into Gray8", which isn't supported. + blacklist('g8 image _ _') + blacklist('g8 colorImage _ _') + if 'Valgrind' in bot: # These take 18+ hours to run. blacklist('pdf gm _ fontmgr_iter') diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp index b3ab7fc03c..1cf644a13b 100644 --- a/src/core/SkBitmapDevice.cpp +++ b/src/core/SkBitmapDevice.cpp @@ -44,6 +44,9 @@ static bool valid_for_bitmap_device(const SkImageInfo& info, switch (info.colorType()) { case kAlpha_8_SkColorType: break; + case kGray_8_SkColorType: + canonicalAlphaType = kOpaque_SkAlphaType; + break; case kRGB_565_SkColorType: canonicalAlphaType = kOpaque_SkAlphaType; break; diff --git a/src/image/SkSurface_Raster.cpp b/src/image/SkSurface_Raster.cpp index e9d14fea7d..3611b30828 100644 --- a/src/image/SkSurface_Raster.cpp +++ b/src/image/SkSurface_Raster.cpp @@ -50,6 +50,12 @@ bool SkSurfaceValidateRasterInfo(const SkImageInfo& info, size_t rowBytes) { } shift = 0; break; + case kGray_8_SkColorType: + if (info.colorSpace()) { + return false; + } + shift = 0; + break; case kRGB_565_SkColorType: if (info.colorSpace()) { return false;