12022-03-09 Nikolas Zimmermann <nzimmermann@igalia.com>
2
3 Extract transform-origin handling out of RenderStyle::applyTransform()
4 https://bugs.webkit.org/show_bug.cgi?id=237590
5
6 Reviewed by NOBODY (OOPS!).
7
8 RenderStyle::applyTransform() implements the algorithm given in
9 CSS Transforms Module Level 2 (https://www.w3.org/TR/css-transforms-2/#ctm)
10 that yields the "current transformation matrix". It is used e.g. in
11 RenderLayer::updateTransform() to compute the layer transformation
12 matrix, that's used for rendering.
13
14 LBSE wants to re-use the same algorithm, interchanging the individual
15 CSS transform properties / the CSS transform property with an external
16 AffineTransform, representing the SVG 2D transform.
17
18 Therefore Split RenderStyle::applyTransform() into three methods:
19 applyTransformOrigin / applyCSSTransform / unapplyTransformOrigin.
20
21 LBSE can call applyTransformOrigin(), multiply the TransformationMatrix
22 with the given SVG 2D AffineTransform and call unapplyTransformOrigin().
23 The rest of the codebase remaings unchanged, since applyTransform() is kept as-is.
24
25 Covered by existing tests, no change in behaviour.
26
27 * platform/graphics/transforms/TransformationMatrix.cpp:
28 (WebCore::TransformationMatrix::multiplyAffineTransform):
29 * platform/graphics/transforms/TransformationMatrix.h:
30 * rendering/style/RenderStyle.cpp:
31 (WebCore::RenderStyle::applyTransformOrigin const):
32 (WebCore::RenderStyle::unapplyTransformOrigin):
33 (WebCore::RenderStyle::applyTransform const):
34 (WebCore::RenderStyle::applyCSSTransform const):
35 * rendering/style/RenderStyle.h:
36