Index: Source/platform/transforms/TransformationMatrix.cpp |
diff --git a/Source/platform/transforms/TransformationMatrix.cpp b/Source/platform/transforms/TransformationMatrix.cpp |
index ba4713bc4ee7020daab6c6d4f5a2c11e059dc7e7..4403d3e7ec91180ff8865f15023b1a11d25ce89b 100644 |
--- a/Source/platform/transforms/TransformationMatrix.cpp |
+++ b/Source/platform/transforms/TransformationMatrix.cpp |
@@ -28,6 +28,7 @@ |
#include "config.h" |
#include "platform/transforms/TransformationMatrix.h" |
+#include "platform/geometry/FloatBox.h" |
#include "platform/geometry/FloatQuad.h" |
#include "platform/geometry/FloatRect.h" |
#include "platform/geometry/IntRect.h" |
@@ -646,6 +647,28 @@ LayoutRect TransformationMatrix::clampedBoundsOfProjectedQuad(const FloatQuad& q |
return LayoutRect(LayoutUnit::clamp(left), LayoutUnit::clamp(top), LayoutUnit::clamp(right - left), LayoutUnit::clamp(bottom - top)); |
} |
+void TransformationMatrix::transformBox(FloatBox& box) const |
+{ |
+ FloatBox bounds; |
+ bool firstPoint = true; |
+ for (size_t i = 0; i < 2; ++i) { |
+ for (size_t j = 0; j < 2; ++j) { |
+ for (size_t k = 0; k < 2; ++k) { |
+ FloatPoint3D point(box.x(), box.y(), box.z()); |
+ point += FloatPoint3D(i * box.width(), j * box.height(), k * box.depth()); |
+ point = mapPoint(point); |
+ if (firstPoint) { |
+ bounds.setOrigin(point); |
+ firstPoint = false; |
+ } else { |
+ bounds.expandTo(point); |
+ } |
+ } |
+ } |
+ } |
+ box = bounds; |
+} |
+ |
FloatPoint TransformationMatrix::mapPoint(const FloatPoint& p) const |
{ |
if (isIdentityOrTranslation()) |