diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-02-01 14:42:19 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2022-02-03 10:28:50 +0100 |
commit | 5d3c8da8c320a950d94e0809c165dac8482f8837 (patch) | |
tree | a8b658f209f9c36efb6384d50fb2457df611e496 /vcl/inc/skia | |
parent | 2b95b55983689d5476e89c27177351e2d6785047 (diff) |
handle graphics test specially in backends too if needed
The backend test unittest already needs some special handling (such
as not smooth-scaling in Skia backend when in HiDPI mode), but
graphics test were failing because the name of the unit test was
used for detecting whether to do special handling.
Change-Id: Ieb23915f1eeafc13c921de06475cb761dc4c485f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129292
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/inc/skia')
-rw-r--r-- | vcl/inc/skia/utils.hxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vcl/inc/skia/utils.hxx b/vcl/inc/skia/utils.hxx index d2d4c81c3f94..355718e8bfa1 100644 --- a/vcl/inc/skia/utils.hxx +++ b/vcl/inc/skia/utils.hxx @@ -27,6 +27,8 @@ #include <vcl/bitmap.hxx> #include <vcl/salgtype.hxx> +#include <test/GraphicsRenderTests.hxx> + #include <premac.h> #include <SkRegion.h> #include <SkSurface.h> @@ -133,10 +135,14 @@ inline bool isUnitTestRunning(const char* name = nullptr) if (name == nullptr) { static const char* const testname = getenv("LO_TESTNAME"); - return testname != nullptr; + if (testname != nullptr) + return true; + return !vcl::test::activeGraphicsRenderTest().isEmpty(); } const char* const testname = getenv("LO_TESTNAME"); - return testname != nullptr && std::string_view(name) == testname; + if (testname != nullptr && std::string_view(name) == testname) + return true; + return vcl::test::activeGraphicsRenderTest().equalsAscii(name); } // Scaling done on the GPU is fast, but bicubic done in raster mode can be slow |