[Libreoffice-commits] core.git: vcl/CppunitTest_vcl_svm_test.mk vcl/qa
Luboš Luňák (via logerrit)
logerrit at kemper.freedesktop.org
Tue Apr 16 11:46:32 UTC 2019
vcl/CppunitTest_vcl_svm_test.mk | 5 ++++
vcl/qa/cppunit/svm/svmtest.cxx | 42 ++++++++++++++++++++++++++++++++++------
2 files changed, 41 insertions(+), 6 deletions(-)
New commits:
commit 69d0eba7816ea0bfe3be15aba16324d0357ee845
Author: Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Sun Apr 14 21:27:47 2019 +0200
Commit: Luboš Luňák <l.lunak at collabora.com>
CommitDate: Tue Apr 16 13:45:46 2019 +0200
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: Luboš Luňák <l.lunak at collabora.com>
diff --git a/vcl/CppunitTest_vcl_svm_test.mk b/vcl/CppunitTest_vcl_svm_test.mk
index 8d93f27a0b1b..92b4dbaafd14 100644
--- a/vcl/CppunitTest_vcl_svm_test.mk
+++ b/vcl/CppunitTest_vcl_svm_test.mk
@@ -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,\
diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx
index d2762a53db34..37a6d36ab67d 100644
--- a/vcl/qa/cppunit/svm/svmtest.cxx
+++ b/vcl/qa/cppunit/svm/svmtest.cxx
@@ -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"}
});
}
More information about the Libreoffice-commits
mailing list