aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2018-01-09 11:21:58 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-09 22:19:58 +0000
commit515bda681177e2bb1c988e3167a95e3d4132bd7f (patch)
tree2071a0a3d5bc00fc531489ba7ba94b420d742f0c
parentdf2713c447755a8b0ec7801d797d5ee9650b4bc2 (diff)
support gray8 destinations on CPU
- fill in a couple switches to allow software to rasterize gray8 - add a gray8 config to DM so we can test it - enable this config on some bots Today we draw gray8 using SkRasterPipeline, loading it as {g,g,g,1} and storing using the same fixed luma math as SkLumaColorFilter. One day it'd be nice to use the color space's luma vector if present. Can we support this on GPU? Change-Id: I4ee661c8bd5f33f5db2433ffb6e1bc2483af8397 Reviewed-on: https://skia-review.googlesource.com/92681 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
-rw-r--r--dm/DM.cpp1
-rw-r--r--infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json9
-rw-r--r--infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json9
-rw-r--r--infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json9
-rw-r--r--infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-shard_00_10-Coverage.json9
-rw-r--r--infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json9
-rw-r--r--infra/bots/recipes/test.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86-Debug-All.json9
-rw-r--r--infra/bots/recipes/test.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Debug-All.json9
-rw-r--r--infra/bots/recipes/test.expected/failed_dm.json9
-rw-r--r--infra/bots/recipes/test.expected/trybot.json9
-rw-r--r--infra/bots/recipes/test.py5
-rw-r--r--src/core/SkBitmapDevice.cpp3
-rw-r--r--src/image/SkSurface_Raster.cpp6
13 files changed, 96 insertions, 0 deletions
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;