summaryrefslogtreecommitdiff
path: root/vcl/qa/cppunit
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-04-14 21:27:47 +0200
committerLuboš Luňák <l.lunak@collabora.com>2019-04-16 13:45:46 +0200
commit69d0eba7816ea0bfe3be15aba16324d0357ee845 (patch)
tree82dbd642764a3b737597788c5ea1797a3fcf56e0 /vcl/qa/cppunit
parent1e3869ea1ce71922280ad9fc4e95e52fed722571 (diff)
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@collabora.com>
Diffstat (limited to 'vcl/qa/cppunit')
-rw-r--r--vcl/qa/cppunit/svm/svmtest.cxx42
1 files changed, 36 insertions, 6 deletions
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"}
});
}