allow all CPU surfaces
These should work fine through SkVMBlitter, and I'm not really sure why we didn't add them to SkRasterPipeline. Bug: chromium:1113777 Change-Id: Id89f82e6a53bd49d88a9562309acf0ab53ea5ec5 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309472 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
parent
864562faf4
commit
d4328567af
@ -41,14 +41,6 @@ bool SkSurfaceValidateRasterInfo(const SkImageInfo& info, size_t rowBytes) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.colorType() == kR8G8_unorm_SkColorType ||
|
|
||||||
info.colorType() == kR16G16_unorm_SkColorType ||
|
|
||||||
info.colorType() == kR16G16_float_SkColorType ||
|
|
||||||
info.colorType() == kA16_unorm_SkColorType ||
|
|
||||||
info.colorType() == kA16_float_SkColorType) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (kIgnoreRowBytesValue == rowBytes) {
|
if (kIgnoreRowBytesValue == rowBytes) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -50,29 +50,27 @@ struct TestCase {
|
|||||||
SkAlphaType fAlphaType;
|
SkAlphaType fAlphaType;
|
||||||
SkColorChannelFlag fChannels;
|
SkColorChannelFlag fChannels;
|
||||||
bool fGpuCanMakeSurfaces;
|
bool fGpuCanMakeSurfaces;
|
||||||
bool fCpuCanMakeSurfaces;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const TestCase gTests[] = {
|
static const TestCase gTests[] = {
|
||||||
{ kAlpha_8_SkColorType, kPremul_SkAlphaType, kAlpha_SkColorChannelFlag, true, true },
|
{ kAlpha_8_SkColorType, kPremul_SkAlphaType, kAlpha_SkColorChannelFlag, true },
|
||||||
{ kA16_unorm_SkColorType, kPremul_SkAlphaType, kAlpha_SkColorChannelFlag, false, false},
|
{ kA16_unorm_SkColorType, kPremul_SkAlphaType, kAlpha_SkColorChannelFlag, false},
|
||||||
{ kA16_float_SkColorType, kPremul_SkAlphaType, kAlpha_SkColorChannelFlag, false, false},
|
{ kA16_float_SkColorType, kPremul_SkAlphaType, kAlpha_SkColorChannelFlag, false},
|
||||||
{ kRGB_565_SkColorType, kOpaque_SkAlphaType, kRGB_SkColorChannelFlags, true, true },
|
{ kRGB_565_SkColorType, kOpaque_SkAlphaType, kRGB_SkColorChannelFlags, true },
|
||||||
{ kARGB_4444_SkColorType, kPremul_SkAlphaType, kRGBA_SkColorChannelFlags, true, true },
|
{ kARGB_4444_SkColorType, kPremul_SkAlphaType, kRGBA_SkColorChannelFlags, true },
|
||||||
{ kRGBA_8888_SkColorType, kPremul_SkAlphaType, kRGBA_SkColorChannelFlags, true, true },
|
{ kRGBA_8888_SkColorType, kPremul_SkAlphaType, kRGBA_SkColorChannelFlags, true },
|
||||||
{ kRGB_888x_SkColorType, kOpaque_SkAlphaType, kRGB_SkColorChannelFlags, true, true },
|
{ kRGB_888x_SkColorType, kOpaque_SkAlphaType, kRGB_SkColorChannelFlags, true },
|
||||||
{ kBGRA_8888_SkColorType, kPremul_SkAlphaType, kRGBA_SkColorChannelFlags, true, true },
|
{ kBGRA_8888_SkColorType, kPremul_SkAlphaType, kRGBA_SkColorChannelFlags, true },
|
||||||
{ kRGBA_1010102_SkColorType,kPremul_SkAlphaType, kRGBA_SkColorChannelFlags, true, true },
|
{ kRGBA_1010102_SkColorType, kPremul_SkAlphaType, kRGBA_SkColorChannelFlags, true },
|
||||||
{ kRGB_101010x_SkColorType, kOpaque_SkAlphaType, kRGB_SkColorChannelFlags, true, true },
|
{ kRGB_101010x_SkColorType, kOpaque_SkAlphaType, kRGB_SkColorChannelFlags, true },
|
||||||
{ kGray_8_SkColorType, kOpaque_SkAlphaType, kGray_SkColorChannelFlag, true, true },
|
{ kGray_8_SkColorType, kOpaque_SkAlphaType, kGray_SkColorChannelFlag, true },
|
||||||
{ kRGBA_F16Norm_SkColorType,kPremul_SkAlphaType, kRGBA_SkColorChannelFlags, true, true },
|
{ kRGBA_F16Norm_SkColorType, kPremul_SkAlphaType, kRGBA_SkColorChannelFlags, true },
|
||||||
{ kRGBA_F16_SkColorType, kPremul_SkAlphaType, kRGBA_SkColorChannelFlags, true, true },
|
{ kRGBA_F16_SkColorType, kPremul_SkAlphaType, kRGBA_SkColorChannelFlags, true },
|
||||||
{ kRGBA_F32_SkColorType, kPremul_SkAlphaType, kRGBA_SkColorChannelFlags, true, true },
|
{ kRGBA_F32_SkColorType, kPremul_SkAlphaType, kRGBA_SkColorChannelFlags, true },
|
||||||
{ kR8G8_unorm_SkColorType, kOpaque_SkAlphaType, kRG_SkColorChannelFlags, true, false},
|
{ kR8G8_unorm_SkColorType, kOpaque_SkAlphaType, kRG_SkColorChannelFlags, true },
|
||||||
{ kR16G16_unorm_SkColorType,kOpaque_SkAlphaType, kRG_SkColorChannelFlags, false, false},
|
{ kR16G16_unorm_SkColorType, kOpaque_SkAlphaType, kRG_SkColorChannelFlags, false},
|
||||||
{ kR16G16_float_SkColorType,kOpaque_SkAlphaType, kRG_SkColorChannelFlags, false, false},
|
{ kR16G16_float_SkColorType, kOpaque_SkAlphaType, kRG_SkColorChannelFlags, false},
|
||||||
{ kR16G16B16A16_unorm_SkColorType,
|
{ kR16G16B16A16_unorm_SkColorType, kPremul_SkAlphaType, kRGBA_SkColorChannelFlags, false},
|
||||||
kPremul_SkAlphaType, kRGBA_SkColorChannelFlags, false, true},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void raster_tests(skiatest::Reporter* reporter, const TestCase& test) {
|
static void raster_tests(skiatest::Reporter* reporter, const TestCase& test) {
|
||||||
@ -84,10 +82,10 @@ static void raster_tests(skiatest::Reporter* reporter, const TestCase& test) {
|
|||||||
uint32_t actualChannels = SkColorTypeChannelFlags(test.fColorType);
|
uint32_t actualChannels = SkColorTypeChannelFlags(test.fColorType);
|
||||||
REPORTER_ASSERT(reporter, test.fChannels == actualChannels);
|
REPORTER_ASSERT(reporter, test.fChannels == actualChannels);
|
||||||
|
|
||||||
// Not all colorTypes can be drawn to
|
// all colorTypes can be drawn to
|
||||||
{
|
{
|
||||||
auto s = SkSurface::MakeRaster(nativeII);
|
auto s = SkSurface::MakeRaster(nativeII);
|
||||||
REPORTER_ASSERT(reporter, SkToBool(s) == test.fCpuCanMakeSurfaces);
|
REPORTER_ASSERT(reporter, SkToBool(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
// opaque formats should make transparent black become opaque
|
// opaque formats should make transparent black become opaque
|
||||||
|
Loading…
Reference in New Issue
Block a user