summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-06-25 19:45:33 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2023-06-25 23:05:34 +0200
commit99b1459dbbe5faa47b5fc9b4ed767932d46a02cb (patch)
treebf2324ac801b3200bf90e3bbce8171ae695ab084
parenta013911b8661daff2cdd58f0bf233ee7116f3029 (diff)
tdf#155735: use 4x4 matrices in tests
Change-Id: I7258443036eb89e7a67fce2a683f3212972a7395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153565 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--basegfx/source/color/bcolormodifier.cxx1
-rwxr-xr-xbasegfx/test/BColorModifierTest.cxx11
2 files changed, 12 insertions, 0 deletions
diff --git a/basegfx/source/color/bcolormodifier.cxx b/basegfx/source/color/bcolormodifier.cxx
index 52f34a69f205..1ed19a4003eb 100644
--- a/basegfx/source/color/bcolormodifier.cxx
+++ b/basegfx/source/color/bcolormodifier.cxx
@@ -183,6 +183,7 @@ namespace basegfx
aColorMatrix.set(0, 0, aSourceColor.getRed());
aColorMatrix.set(1, 0, aSourceColor.getGreen());
aColorMatrix.set(2, 0, aSourceColor.getBlue());
+ // TODO: add support for alpha
aColorMatrix = maMatrix * aColorMatrix;
return ::basegfx::BColor(aColorMatrix.get(0, 0), aColorMatrix.get(1, 0), aColorMatrix.get(2, 0));
diff --git a/basegfx/test/BColorModifierTest.cxx b/basegfx/test/BColorModifierTest.cxx
index 5a4b941e1c44..5ada0a33ddf9 100755
--- a/basegfx/test/BColorModifierTest.cxx
+++ b/basegfx/test/BColorModifierTest.cxx
@@ -285,6 +285,10 @@ public:
aMatrix.set(2, 1, 0.0);
aMatrix.set(2, 2, 0.0);
aMatrix.set(2, 3, 0.0);
+ aMatrix.set(3, 0, 0.0);
+ aMatrix.set(3, 1, 0.0);
+ aMatrix.set(3, 2, 0.0);
+ aMatrix.set(3, 3, 1.0);
const basegfx::BColorModifierSharedPtr aBColorModifier
= std::make_shared<basegfx::BColorModifier_matrix>(aMatrix);
@@ -321,12 +325,19 @@ public:
aMatrix.set(0, 0, 1.0);
aMatrix.set(0, 1, 0.0);
aMatrix.set(0, 2, 0.0);
+ aMatrix.set(0, 3, 0.0);
aMatrix.set(1, 0, 0.0);
aMatrix.set(1, 1, 1.0);
aMatrix.set(1, 2, 0.0);
+ aMatrix.set(1, 3, 0.0);
aMatrix.set(2, 0, 0.0);
aMatrix.set(2, 1, 0.0);
aMatrix.set(2, 2, 1.0);
+ aMatrix.set(2, 3, 0.0);
+ aMatrix.set(3, 0, 0.0);
+ aMatrix.set(3, 1, 0.0);
+ aMatrix.set(3, 2, 0.0);
+ aMatrix.set(3, 3, 1.0);
const basegfx::BColorModifierSharedPtr aBColorModifier
= std::make_shared<basegfx::BColorModifier_matrix>(aMatrix);