diff --git a/src/Magnum/DebugTools/Test/ForceRendererGLTest.cpp b/src/Magnum/DebugTools/Test/ForceRendererGLTest.cpp index d13220025..0b92e34ce 100644 --- a/src/Magnum/DebugTools/Test/ForceRendererGLTest.cpp +++ b/src/Magnum/DebugTools/Test/ForceRendererGLTest.cpp @@ -23,6 +23,7 @@ DEALINGS IN THE SOFTWARE. */ +#include #include #include @@ -43,6 +44,10 @@ #include "configure.h" +#ifdef CORRADE_TARGET_ANDROID +#include "Magnum/GL/Context.h" +#endif + namespace Magnum { namespace DebugTools { namespace Test { namespace { struct ForceRendererGLTest: GL::OpenGLTester { @@ -107,10 +112,20 @@ void ForceRendererGLTest::render2D() { !(_manager.loadState("TgaImporter") & PluginManager::LoadState::Loaded)) CORRADE_SKIP("AnyImageImporter / TgaImageImporter plugins not found."); + /* ARM Mali G71 (Huawei P10) has some rounding differences causing the + the arrowhead to be on a different place (but the rest is okay and the + 3D case matches exactly), however to avoid false negatives elsewhere I'm + making it conditional. */ + Containers::Optional comparator{Containers::InPlaceInit, _manager}; + #ifdef CORRADE_TARGET_ANDROID + if(GL::Context::current().detectedDriver() & GL::Context::DetectedDriver::ArmMali) + comparator.emplace(_manager, 79.0f, 0.22f); + #endif + CORRADE_COMPARE_WITH( framebuffer.read({{}, {64, 64}}, {PixelFormat::RGBA8Unorm}), Utility::Directory::join(DEBUGTOOLS_TEST_DIR, "ForceRenderer2D.tga"), - CompareImageToFile{_manager}); + *comparator); } void ForceRendererGLTest::render3D() { diff --git a/src/Magnum/DebugTools/Test/ObjectRendererGLTest.cpp b/src/Magnum/DebugTools/Test/ObjectRendererGLTest.cpp index f83824071..8cc9ac9c9 100644 --- a/src/Magnum/DebugTools/Test/ObjectRendererGLTest.cpp +++ b/src/Magnum/DebugTools/Test/ObjectRendererGLTest.cpp @@ -23,6 +23,7 @@ DEALINGS IN THE SOFTWARE. */ +#include #include #include @@ -43,6 +44,10 @@ #include "configure.h" +#ifdef CORRADE_TARGET_ANDROID +#include "Magnum/GL/Context.h" +#endif + namespace Magnum { namespace DebugTools { namespace Test { namespace { struct ObjectRendererGLTest: GL::OpenGLTester { @@ -153,11 +158,21 @@ void ObjectRendererGLTest::render3D() { !(_manager.loadState("TgaImporter") & PluginManager::LoadState::Loaded)) CORRADE_SKIP("AnyImageImporter / TgaImporter plugins not found."); + /* Intel Windows drivers misplace one pixel here. Nothing serious. + ARM Mali G71 (Huawei P10) has some rounding differences causing the + the bottom blue line to be on a different place (but the rest is + okay and the 2D case matches exactly), however to avoid false negatives + elsewhere I'm making it conditional. */ + Containers::Optional comparator{Containers::InPlaceInit, _manager, 71.6f, 0.018f}; + #ifdef CORRADE_TARGET_ANDROID + if(GL::Context::current().detectedDriver() & GL::Context::DetectedDriver::ArmMali) + comparator.emplace(_manager, 127.6f, 0.54f); + #endif + CORRADE_COMPARE_WITH( framebuffer.read({{}, {64, 64}}, {PixelFormat::RGBA8Unorm}), Utility::Directory::join(DEBUGTOOLS_TEST_DIR, "ObjectRenderer3D.tga"), - /* Intel Windows drivers misplace one pixel here. Nothing serious. */ - (CompareImageToFile{_manager, 71.6f, 0.018f})); + *comparator); } }}}}