Add 1010102 support to Ganesh
Adds gl1010102, gles1010102, vk1010102, and mtl1010102
configs to DM.
This uses the same saveLayer approach as CPU, switching
to 8888 so that we have enough alpha precision.
Change-Id: I9f5b63747ec01031c8db97dadfc42f77e4863ccb
Reviewed-on: https://skia-review.googlesource.com/110500
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index ab91061..35b72a9 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -932,6 +932,7 @@
skiatest::Reporter* reporter,
const char* prefix,
bool f16Support,
+ bool supports1010102,
std::function<sk_sp<SkSurface>(const SkImageInfo&)> surfaceMaker) {
auto srgbColorSpace = SkColorSpace::MakeSRGB();
@@ -960,6 +961,7 @@
{ kRGBA_F16_SkColorType, oddColorSpace, false, "F16-odd" },
{ kRGB_565_SkColorType, srgbColorSpace, false, "565-srgb" },
{ kAlpha_8_SkColorType, srgbColorSpace, false, "A8-srgb" },
+ { kRGBA_1010102_SkColorType, nullptr, true, "1010102-nullptr" },
};
for (auto& testConfig : testConfigs) {
@@ -970,7 +972,8 @@
// For some GPU contexts (eg ANGLE), we don't have f16 support, so we should fail to create
// any surface of that type:
bool shouldWork = testConfig.fShouldWork &&
- (f16Support || kRGBA_F16_SkColorType != testConfig.fColorType);
+ (f16Support || kRGBA_F16_SkColorType != testConfig.fColorType) &&
+ (supports1010102 || kRGBA_1010102_SkColorType != testConfig.fColorType);
auto surface(surfaceMaker(info));
REPORTER_ASSERT(reporter, SkToBool(surface) == shouldWork, fullTestName.c_str());
@@ -990,7 +993,8 @@
return SkSurface::MakeRaster(info);
};
- test_surface_creation_and_snapshot_with_color_space(reporter, "raster", true, surfaceMaker);
+ test_surface_creation_and_snapshot_with_color_space(reporter, "raster", true, true,
+ surfaceMaker);
}
#if SK_SUPPORT_GPU
@@ -998,11 +1002,13 @@
GrContext* context = ctxInfo.grContext();
bool f16Support = context->caps()->isConfigRenderable(kRGBA_half_GrPixelConfig);
+ bool supports1010102 = context->caps()->isConfigRenderable(kRGBA_1010102_GrPixelConfig);
auto surfaceMaker = [context](const SkImageInfo& info) {
return SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info);
};
- test_surface_creation_and_snapshot_with_color_space(reporter, "gpu", f16Support, surfaceMaker);
+ test_surface_creation_and_snapshot_with_color_space(reporter, "gpu", f16Support,
+ supports1010102, surfaceMaker);
std::vector<GrBackendTexture> backendTextures;
auto wrappedSurfaceMaker = [ context, &backendTextures ](const SkImageInfo& info) {
@@ -1028,7 +1034,7 @@
};
test_surface_creation_and_snapshot_with_color_space(reporter, "wrapped", f16Support,
- wrappedSurfaceMaker);
+ supports1010102, wrappedSurfaceMaker);
context->flush();