Kaydet (Commit) 69d0eba7 authored tarafından Luboš Luňák's avatar Luboš Luňák

fix vcl_svm_test with OpenGL

The bitmaps have different CRC, because OpenGL uses different algorithm
and data format.

Change-Id: Ic4d2e6215cfc6b971b470367002936f4a81e9fbe
Reviewed-on: https://gerrit.libreoffice.org/70777
Tested-by: Jenkins
Reviewed-by: 's avatarLuboš Luňák <l.lunak@collabora.com>
üst 1e3869ea
......@@ -17,6 +17,11 @@ $(eval $(call gb_CppunitTest_use_externals,vcl_svm_test,\
boost_headers \
libxml2 \
))
ifeq ($(DISABLE_GUI),)
$(eval $(call gb_CppunitTest_use_externals,vcl_svm_test,\
epoxy \
))
endif
$(eval $(call gb_CppunitTest_set_include,vcl_svm_test,\
......
......@@ -15,6 +15,11 @@
#include <vcl/bitmapaccess.hxx>
#include <bitmapwriteaccess.hxx>
#include <config_features.h>
#if HAVE_FEATURE_OPENGL
#include <vcl/opengl/OpenGLHelper.hxx>
#endif
using namespace css;
class SvmTest : public test::BootstrapFixture, public XmlTestTools
......@@ -762,14 +767,27 @@ void SvmTest::checkBitmaps(const GDIMetaFile& rMetaFile)
{
xmlDocPtr pDoc = dumpMeta(rMetaFile);
assertXPathAttrs(pDoc, "/metafile/bmp[1]", {{"x", "1"}, {"y", "2"}, {"crc", "b8dee5da"}});
OUString crc1 = "b8dee5da";
OUString crc2 = "281fc589";
OUString crc3 = "5e01ddcc";
#if HAVE_FEATURE_OPENGL
if (OpenGLHelper::isVCLOpenGLEnabled())
{
// OpenGL uses a different scaling algorithm and also a different RGB order.
crc1 = "5e01ddcc";
crc2 = "281fc589";
crc3 = "b8dee5da";
}
#endif
assertXPathAttrs(pDoc, "/metafile/bmp[1]", {{"x", "1"}, {"y", "2"}, {"crc", crc1}});
assertXPathAttrs(pDoc, "/metafile/bmpscale[1]", {
{"x", "1"}, {"y", "2"}, {"width", "3"}, {"height", "4"}, {"crc", "281fc589"}
{"x", "1"}, {"y", "2"}, {"width", "3"}, {"height", "4"}, {"crc", crc2}
});
assertXPathAttrs(pDoc, "/metafile/bmpscalepart[1]", {
{"destx", "1"}, {"desty", "2"}, {"destwidth", "3"}, {"destheight", "4"},
{"srcx", "2"}, {"srcy", "1"}, {"srcwidth", "4"}, {"srcheight", "3"},
{"crc", "5e01ddcc"}
{"crc", crc3}
});
}
......@@ -805,17 +823,29 @@ void SvmTest::checkBitmapExs(const GDIMetaFile& rMetaFile)
{
xmlDocPtr pDoc = dumpMeta(rMetaFile);
OUString crc1 = "b8dee5da";
OUString crc2 = "281fc589";
OUString crc3 = "5e01ddcc";
#if HAVE_FEATURE_OPENGL
if (OpenGLHelper::isVCLOpenGLEnabled())
{
crc1 = "5e01ddcc";
crc2 = "281fc589";
crc3 = "b8dee5da";
}
#endif
assertXPathAttrs(pDoc, "/metafile/bmpex[1]", {
{"x", "1"}, {"y", "2"}, {"crc", "b8dee5da"}, {"transparenttype", "bitmap"}
{"x", "1"}, {"y", "2"}, {"crc", crc1}, {"transparenttype", "bitmap"}
});
assertXPathAttrs(pDoc, "/metafile/bmpexscale[1]", {
{"x", "1"}, {"y", "2"}, {"width", "3"}, {"height", "4"},
{"crc", "281fc589"}, {"transparenttype", "bitmap"}
{"crc", crc2}, {"transparenttype", "bitmap"}
});
assertXPathAttrs(pDoc, "/metafile/bmpexscalepart[1]", {
{"destx", "1"}, {"desty", "2"}, {"destwidth", "3"}, {"destheight", "4"},
{"srcx", "2"}, {"srcy", "1"}, {"srcwidth", "4"}, {"srcheight", "3"},
{"crc", "5e01ddcc"}, {"transparenttype", "bitmap"}
{"crc", crc3}, {"transparenttype", "bitmap"}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment