add kRGBA_F16Norm_SkColorType
For now this is distinct from kRGBA_F16_SkColorType but treated the
same. Next steps are to see if we can keep it clamped to [0,1].
Switched a few switches away from default to exhaustive.
Took away any explicit SW clamps for now except the one we definitely
want in append_gamut_clamp_if_normalized().
Skip F16Norm in the DDL test because we can't yet distinguish it from
F16.
Change-Id: I021a864fe078e4fa4e2b399982e6c38350e10d74
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196371
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
diff --git a/include/private/SkImageInfoPriv.h b/include/private/SkImageInfoPriv.h
index 1f064bd..2841504 100644
--- a/include/private/SkImageInfoPriv.h
+++ b/include/private/SkImageInfoPriv.h
@@ -25,18 +25,19 @@
static inline uint32_t SkColorTypeComponentFlags(SkColorType ct) {
switch (ct) {
- case kUnknown_SkColorType: return 0;
- case kAlpha_8_SkColorType: return kAlpha_SkColorTypeComponentFlag;
- case kRGB_565_SkColorType: return kRGB_SkColorTypeComponentFlags;
- case kARGB_4444_SkColorType: return kRGBA_SkColorTypeComponentFlags;
- case kRGBA_8888_SkColorType: return kRGBA_SkColorTypeComponentFlags;
- case kRGB_888x_SkColorType: return kRGB_SkColorTypeComponentFlags;
- case kBGRA_8888_SkColorType: return kRGBA_SkColorTypeComponentFlags;
- case kRGBA_1010102_SkColorType: return kRGBA_SkColorTypeComponentFlags;
- case kRGB_101010x_SkColorType: return kRGB_SkColorTypeComponentFlags;
- case kGray_8_SkColorType: return kGray_SkColorTypeComponentFlag;
- case kRGBA_F16_SkColorType: return kRGBA_SkColorTypeComponentFlags;
- case kRGBA_F32_SkColorType: return kRGBA_SkColorTypeComponentFlags;
+ case kUnknown_SkColorType: return 0;
+ case kAlpha_8_SkColorType: return kAlpha_SkColorTypeComponentFlag;
+ case kRGB_565_SkColorType: return kRGB_SkColorTypeComponentFlags;
+ case kARGB_4444_SkColorType: return kRGBA_SkColorTypeComponentFlags;
+ case kRGBA_8888_SkColorType: return kRGBA_SkColorTypeComponentFlags;
+ case kRGB_888x_SkColorType: return kRGB_SkColorTypeComponentFlags;
+ case kBGRA_8888_SkColorType: return kRGBA_SkColorTypeComponentFlags;
+ case kRGBA_1010102_SkColorType: return kRGBA_SkColorTypeComponentFlags;
+ case kRGB_101010x_SkColorType: return kRGB_SkColorTypeComponentFlags;
+ case kGray_8_SkColorType: return kGray_SkColorTypeComponentFlag;
+ case kRGBA_F16Norm_SkColorType: return kRGBA_SkColorTypeComponentFlags;
+ case kRGBA_F16_SkColorType: return kRGBA_SkColorTypeComponentFlags;
+ case kRGBA_F32_SkColorType: return kRGBA_SkColorTypeComponentFlags;
}
return 0;
}
@@ -58,18 +59,19 @@
static int SkColorTypeShiftPerPixel(SkColorType ct) {
switch (ct) {
- case kUnknown_SkColorType: return 0;
- case kAlpha_8_SkColorType: return 0;
- case kRGB_565_SkColorType: return 1;
- case kARGB_4444_SkColorType: return 1;
- case kRGBA_8888_SkColorType: return 2;
- case kRGB_888x_SkColorType: return 2;
- case kBGRA_8888_SkColorType: return 2;
- case kRGBA_1010102_SkColorType: return 2;
- case kRGB_101010x_SkColorType: return 2;
- case kGray_8_SkColorType: return 0;
- case kRGBA_F16_SkColorType: return 3;
- case kRGBA_F32_SkColorType: return 4;
+ case kUnknown_SkColorType: return 0;
+ case kAlpha_8_SkColorType: return 0;
+ case kRGB_565_SkColorType: return 1;
+ case kARGB_4444_SkColorType: return 1;
+ case kRGBA_8888_SkColorType: return 2;
+ case kRGB_888x_SkColorType: return 2;
+ case kBGRA_8888_SkColorType: return 2;
+ case kRGBA_1010102_SkColorType: return 2;
+ case kRGB_101010x_SkColorType: return 2;
+ case kGray_8_SkColorType: return 0;
+ case kRGBA_F16Norm_SkColorType: return 3;
+ case kRGBA_F16_SkColorType: return 3;
+ case kRGBA_F32_SkColorType: return 4;
}
return 0;
}