support 16161616 in fm

Everything was pretty much already plumbed through using
SkRasterPipeline, with a few key connections made here.

This support is mostly useful for differentially debugging my CLs
stacked on top of it.

Change-Id: I9c2f2ea6cd8890c057890409f21c7698857c599a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303651
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
This commit is contained in:
Mike Klein 2020-07-17 13:52:41 -05:00 committed by Skia Commit-Bot
parent c1cde36a9b
commit d58e01b6fc
4 changed files with 31 additions and 30 deletions

View File

@ -45,8 +45,7 @@ bool SkSurfaceValidateRasterInfo(const SkImageInfo& info, size_t rowBytes) {
info.colorType() == kR16G16_unorm_SkColorType ||
info.colorType() == kR16G16_float_SkColorType ||
info.colorType() == kA16_unorm_SkColorType ||
info.colorType() == kA16_float_SkColorType ||
info.colorType() == kR16G16B16A16_unorm_SkColorType) {
info.colorType() == kA16_float_SkColorType) {
return false;
}

View File

@ -72,7 +72,7 @@ static const TestCase gTests[] = {
{ kR16G16_unorm_SkColorType,kOpaque_SkAlphaType, kRG_SkColorChannelFlags, false, false},
{ kR16G16_float_SkColorType,kOpaque_SkAlphaType, kRG_SkColorChannelFlags, false, false},
{ kR16G16B16A16_unorm_SkColorType,
kPremul_SkAlphaType, kRGBA_SkColorChannelFlags, false, false},
kPremul_SkAlphaType, kRGBA_SkColorChannelFlags, false, true},
};
static void raster_tests(skiatest::Reporter* reporter, const TestCase& test) {

View File

@ -24,17 +24,18 @@ HashAndEncode::HashAndEncode(const SkBitmap& bitmap) : fSize(bitmap.info().dimen
switch (bitmap.colorType()) {
case kUnknown_SkColorType: return;
case kAlpha_8_SkColorType: srcFmt = skcms_PixelFormat_A_8; break;
case kRGB_565_SkColorType: srcFmt = skcms_PixelFormat_BGR_565; break;
case kARGB_4444_SkColorType: srcFmt = skcms_PixelFormat_ABGR_4444; break;
case kRGBA_8888_SkColorType: srcFmt = skcms_PixelFormat_RGBA_8888; break;
case kBGRA_8888_SkColorType: srcFmt = skcms_PixelFormat_BGRA_8888; break;
case kRGBA_1010102_SkColorType: srcFmt = skcms_PixelFormat_RGBA_1010102; break;
case kBGRA_1010102_SkColorType: srcFmt = skcms_PixelFormat_BGRA_1010102; break;
case kGray_8_SkColorType: srcFmt = skcms_PixelFormat_G_8; break;
case kRGBA_F16Norm_SkColorType: srcFmt = skcms_PixelFormat_RGBA_hhhh; break;
case kRGBA_F16_SkColorType: srcFmt = skcms_PixelFormat_RGBA_hhhh; break;
case kRGBA_F32_SkColorType: srcFmt = skcms_PixelFormat_RGBA_ffff; break;
case kAlpha_8_SkColorType: srcFmt = skcms_PixelFormat_A_8; break;
case kRGB_565_SkColorType: srcFmt = skcms_PixelFormat_BGR_565; break;
case kARGB_4444_SkColorType: srcFmt = skcms_PixelFormat_ABGR_4444; break;
case kRGBA_8888_SkColorType: srcFmt = skcms_PixelFormat_RGBA_8888; break;
case kBGRA_8888_SkColorType: srcFmt = skcms_PixelFormat_BGRA_8888; break;
case kRGBA_1010102_SkColorType: srcFmt = skcms_PixelFormat_RGBA_1010102; break;
case kBGRA_1010102_SkColorType: srcFmt = skcms_PixelFormat_BGRA_1010102; break;
case kGray_8_SkColorType: srcFmt = skcms_PixelFormat_G_8; break;
case kRGBA_F16Norm_SkColorType: srcFmt = skcms_PixelFormat_RGBA_hhhh; break;
case kRGBA_F16_SkColorType: srcFmt = skcms_PixelFormat_RGBA_hhhh; break;
case kRGBA_F32_SkColorType: srcFmt = skcms_PixelFormat_RGBA_ffff; break;
case kR16G16B16A16_unorm_SkColorType: srcFmt = skcms_PixelFormat_RGBA_16161616LE; break;
case kRGB_888x_SkColorType: srcFmt = skcms_PixelFormat_RGBA_8888;
srcAlpha = skcms_AlphaFormat_Opaque; break;
@ -42,12 +43,12 @@ HashAndEncode::HashAndEncode(const SkBitmap& bitmap) : fSize(bitmap.info().dimen
srcAlpha = skcms_AlphaFormat_Opaque; break;
case kBGR_101010x_SkColorType: srcFmt = skcms_PixelFormat_BGRA_1010102;
srcAlpha = skcms_AlphaFormat_Opaque; break;
case kR8G8_unorm_SkColorType: return;
case kR16G16_unorm_SkColorType: return;
case kR16G16_float_SkColorType: return;
case kA16_unorm_SkColorType: return;
case kA16_float_SkColorType: return;
case kR16G16B16A16_unorm_SkColorType: return;
}
skcms_ICCProfile srcProfile = *skcms_sRGB_profile();

View File

@ -514,21 +514,22 @@ int main(int argc, char** argv) {
{ "mock" , GrContextFactory::kMock_ContextType },
};
const FlagOption<SkColorType> kColorTypes[] = {
{ "a8", kAlpha_8_SkColorType },
{ "g8", kGray_8_SkColorType },
{ "565", kRGB_565_SkColorType },
{ "4444", kARGB_4444_SkColorType },
{ "8888", kN32_SkColorType },
{ "888x", kRGB_888x_SkColorType },
{ "1010102", kRGBA_1010102_SkColorType },
{ "101010x", kRGB_101010x_SkColorType },
{ "bgra1010102", kBGRA_1010102_SkColorType },
{ "bgr101010x", kBGR_101010x_SkColorType },
{ "f16norm", kRGBA_F16Norm_SkColorType },
{ "f16", kRGBA_F16_SkColorType },
{ "f32", kRGBA_F32_SkColorType },
{ "rgba", kRGBA_8888_SkColorType },
{ "bgra", kBGRA_8888_SkColorType },
{ "a8", kAlpha_8_SkColorType },
{ "g8", kGray_8_SkColorType },
{ "565", kRGB_565_SkColorType },
{ "4444", kARGB_4444_SkColorType },
{ "8888", kN32_SkColorType },
{ "888x", kRGB_888x_SkColorType },
{ "1010102", kRGBA_1010102_SkColorType },
{ "101010x", kRGB_101010x_SkColorType },
{ "bgra1010102", kBGRA_1010102_SkColorType },
{ "bgr101010x", kBGR_101010x_SkColorType },
{ "f16norm", kRGBA_F16Norm_SkColorType },
{ "f16", kRGBA_F16_SkColorType },
{ "f32", kRGBA_F32_SkColorType },
{ "rgba", kRGBA_8888_SkColorType },
{ "bgra", kBGRA_8888_SkColorType },
{ "16161616", kR16G16B16A16_unorm_SkColorType },
};
const FlagOption<SkAlphaType> kAlphaTypes[] = {
{ "premul", kPremul_SkAlphaType },