Commit 2b95a9a6 authored by krit@webkit.org's avatar krit@webkit.org
Browse files

2010-02-08 Dirk Schulze <krit@webkit.org>

        Reviewed by Nikolas Zimmermann.

        Add back an AffineTransform class for use by SVG
        https://bugs.webkit.org/show_bug.cgi?id=33750

        This adds back AffineTransform. This saves additional 4% memory consumption
        on the 50k rects stress test: https://bugs.webkit.org/attachment.cgi?id=46721
        It also makes it possible to optimize the calculations internally of
        AffineTransform to the needs of 2D transformations (the second benefit for SVG,
        which uses transformations relative often at the moment.
        Everything that is 2D related (like images, patterns, gradients, fonts), uses
        AffineTransform now.

        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSSVGMatrixCustom.cpp:
        (WebCore::JSSVGMatrix::multiply):
        (WebCore::JSSVGMatrix::inverse):
        (WebCore::JSSVGMatrix::rotateFromVector):
        * bindings/js/JSSVGPODTypeWrapper.h:
        * bindings/scripts/CodeGenerato...
parent df118374
2010-02-08 Dirk Schulze <krit@webkit.org>
Reviewed by Nikolas Zimmermann.
Add back an AffineTransform class for use by SVG
https://bugs.webkit.org/show_bug.cgi?id=33750
Some negative zero problems fixed, but new one were added on other places. A seperate
patch should fix it all at once.
use-on-disallowed-foreign-object-3 and 4 had wrong results. The old SVG code
with TransformationMatrix used translateRight, that was wrong at this place and is
fixed now.
* platform/mac/svg/W3C-SVG-1.1/animate-elem-80-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-01-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-02-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-03-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-04-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-07-b-expected.txt:
* platform/mac/svg/custom/use-on-disallowed-foreign-object-3-expected.txt:
* platform/mac/svg/custom/use-on-disallowed-foreign-object-4-expected.txt:
* svg/dom/SVGMatrix-interface-expected.txt:
* svg/dom/SVGMatrix-interface.xhtml:
2010-02-08 Nikolas Zimmermann <nzimmermann@rim.com>
Not reviewed. Fix last problematic SVG testcase, update coords-trans-01-b.svg win results, marking the end of the baseline regeneration for all platforms.
......
......@@ -67,7 +67,7 @@ layer at (0,0) size 480x360
RenderPath {line} at (15,219) size 90x2 [stroke={[type=SOLID] [color=#C0C0C0]}] [data="M-45.00,0.00 L45.00,0.00"]
RenderPath {line} at (59,175) size 2x90 [stroke={[type=SOLID] [color=#C0C0C0]}] [data="M0.00,-45.00 L0.00,45.00"]
RenderPath {line} at (0,0) size 0x0 [stroke={[type=SOLID] [color=#C0C0C0] [stroke width=15.00] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [data=""]
RenderPath {line} at (0,0) size 0x0 [transform={m=((0.00,1.00)(-1.00,0.00)) t=(80.00,-0.00)}] [stroke={[type=SOLID] [color=#C0C0C0] [stroke width=15.00] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [data=""]
RenderPath {line} at (0,0) size 0x0 [transform={m=((0.00,1.00)(-1.00,0.00)) t=(80.00,0.00)}] [stroke={[type=SOLID] [color=#C0C0C0] [stroke width=15.00] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [data=""]
RenderPath {line} at (0,0) size 0x0 [transform={m=((-1.00,0.00)(-0.00,-1.00)) t=(80.00,80.00)}] [stroke={[type=SOLID] [color=#C0C0C0] [stroke width=15.00] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [data=""]
RenderPath {line} at (0,0) size 0x0 [transform={m=((-0.00,-1.00)(1.00,-0.00)) t=(0.00,80.00)}] [stroke={[type=SOLID] [color=#C0C0C0] [stroke width=15.00] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [data=""]
RenderPath {line} at (55,215) size 50x10 [stroke={[type=SOLID] [color=#C85050] [stroke width=10.00] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [data="M40.00,40.00 L80.00,40.00"]
......
......@@ -11,7 +11,7 @@ layer at (0,0) size 480x360
RenderSVGText {text} at (30,130) size 105x22 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,-17) size 105x22
chunk 1 text run 1 at (30.00,130.00) startOffset 0 endOffset 13 width 105.00: "Placed Glyphs"
RenderSVGContainer {g} at (164,81) size 212x162 [transform={m=((1.00,0.00)(0.00,-1.00)) t=(165.00,140.00)}]
RenderSVGContainer {g} at (164,81) size 212x162 [transform={m=((1.00,0.00)(-0.00,-1.00)) t=(165.00,140.00)}]
RenderPath {line} at (165,139) size 210x2 [stroke={[type=SOLID] [color=#888888]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00 L210.00,0.00"]
RenderSVGContainer {g} at (164,81) size 212x162 [transform={m=((0.03,0.00)(0.00,0.03)) t=(0.00,0.00)}]
RenderPath {line} at (164,81) size 2x162 [stroke={[type=SOLID] [color=#888888] [stroke width=50.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-3500.00 L0.00,2000.00"]
......
......@@ -11,7 +11,7 @@ layer at (0,0) size 480x360
RenderSVGText {text} at (7,130) size 130x22 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,-17) size 130x22
chunk 1 text run 1 at (7.00,130.00) startOffset 0 endOffset 15 width 130.00: "SVG over Glyphs"
RenderSVGContainer {g} at (168,85) size 205x72 [transform={m=((1.00,0.00)(0.00,-1.00)) t=(165.00,140.00)}]
RenderSVGContainer {g} at (168,85) size 205x72 [transform={m=((1.00,0.00)(-0.00,-1.00)) t=(165.00,140.00)}]
RenderSVGContainer {g} at (168,85) size 205x72 [transform={m=((0.03,0.00)(0.00,0.03)) t=(0.00,0.00)}]
RenderPath {path} at (168,96) size 37x45 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M1250.00,-30.00 C1188.67,-30.00,1135.33,48.67,1090.00,206.00 C1072.67,266.00,1051.00,371.00,1025.00,521.00 C957.00,511.67,868.00,495.00,758.00,471.00 L492.00,416.00 C458.67,328.67,401.67,201.00,321.00,33.00 C299.67,-4.33,270.67,-23.00,234.00,-23.00 C207.33,-23.00,183.67,-13.33,163.00,6.00 C142.33,25.33,131.67,49.33,131.00,78.00 C131.00,110.00,181.33,231.67,282.00,443.00 C270.67,460.33,265.00,480.33,265.00,503.00 C265.00,557.00,297.67,591.67,363.00,607.00 C439.00,749.67,535.00,913.67,651.00,1099.00 C809.00,1351.67,907.33,1478.00,946.00,1478.00 C998.67,1478.00,1034.67,1441.33,1054.00,1368.00 L1117.00,1032.00 L1266.00,337.00 L1323.00,179.00 C1342.33,125.00,1352.00,89.00,1352.00,71.00 C1352.00,42.33,1341.67,18.33,1321.00,-1.00 C1300.33,-20.33,1276.67,-30.00,1250.00,-30.00 Z M897.00,1113.00 L611.00,652.00 C691.67,672.67,814.00,697.67,978.00,727.00 L897.00,1113.00 Z"]
RenderPath {path} at (208,109) size 31x48 [transform={m=((1.00,0.00)(0.00,1.00)) t=(1498.00,0.00)}] [fill={[type=SOLID] [color=#FFFFFF]}] [data="M1011.00,892.00 L665.00,144.00 C579.67,-38.00,514.33,-190.33,469.00,-313.00 L403.00,-507.00 C385.67,-555.00,355.67,-579.00,313.00,-579.00 C285.00,-579.00,261.00,-570.00,241.00,-552.00 C221.00,-534.00,210.67,-511.00,210.00,-483.00 C210.00,-416.33,282.00,-223.33,426.00,96.00 L68.00,785.00 L23.00,858.00 C5.00,888.67,-4.00,914.33,-4.00,935.00 C-4.00,962.33,6.33,986.33,27.00,1007.00 C47.67,1027.67,71.33,1038.00,98.00,1038.00 C128.67,1038.00,152.33,1026.33,169.00,1003.00 C282.33,845.67,404.00,621.67,534.00,331.00 L682.00,676.00 C735.33,795.33,786.67,898.00,836.00,984.00 C857.33,1021.33,885.33,1040.00,920.00,1040.00 C947.33,1040.00,971.33,1030.33,992.00,1011.00 C1012.67,991.67,1023.33,968.67,1024.00,942.00 C1024.00,927.33,1019.67,910.67,1011.00,892.00 Z"]
......@@ -29,7 +29,7 @@ layer at (0,0) size 480x360
RenderSVGText {text} at (0,0) size 210x83 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,-66) size 210x83
chunk 1 text run 1 at (0.00,0.00) startOffset 0 endOffset 5 width 209.71: "Ay\x{D6}@\x{E7}"
RenderSVGContainer {g} at (168,155) size 205x72 [transform={m=((1.00,0.00)(0.00,-1.00)) t=(165.00,210.00)}]
RenderSVGContainer {g} at (168,155) size 205x72 [transform={m=((1.00,0.00)(-0.00,-1.00)) t=(165.00,210.00)}]
RenderSVGContainer {g} at (168,155) size 205x72 [transform={m=((0.03,0.00)(0.00,0.03)) t=(0.00,0.00)}]
RenderPath {path} at (168,166) size 37x45 [fill={[type=SOLID] [color=#000000]}] [data="M1250.00,-30.00 C1188.67,-30.00,1135.33,48.67,1090.00,206.00 C1072.67,266.00,1051.00,371.00,1025.00,521.00 C957.00,511.67,868.00,495.00,758.00,471.00 L492.00,416.00 C458.67,328.67,401.67,201.00,321.00,33.00 C299.67,-4.33,270.67,-23.00,234.00,-23.00 C207.33,-23.00,183.67,-13.33,163.00,6.00 C142.33,25.33,131.67,49.33,131.00,78.00 C131.00,110.00,181.33,231.67,282.00,443.00 C270.67,460.33,265.00,480.33,265.00,503.00 C265.00,557.00,297.67,591.67,363.00,607.00 C439.00,749.67,535.00,913.67,651.00,1099.00 C809.00,1351.67,907.33,1478.00,946.00,1478.00 C998.67,1478.00,1034.67,1441.33,1054.00,1368.00 L1117.00,1032.00 L1266.00,337.00 L1323.00,179.00 C1342.33,125.00,1352.00,89.00,1352.00,71.00 C1352.00,42.33,1341.67,18.33,1321.00,-1.00 C1300.33,-20.33,1276.67,-30.00,1250.00,-30.00 Z M897.00,1113.00 L611.00,652.00 C691.67,672.67,814.00,697.67,978.00,727.00 L897.00,1113.00 Z"]
RenderPath {path} at (208,179) size 31x48 [transform={m=((1.00,0.00)(0.00,1.00)) t=(1498.00,0.00)}] [fill={[type=SOLID] [color=#000000]}] [data="M1011.00,892.00 L665.00,144.00 C579.67,-38.00,514.33,-190.33,469.00,-313.00 L403.00,-507.00 C385.67,-555.00,355.67,-579.00,313.00,-579.00 C285.00,-579.00,261.00,-570.00,241.00,-552.00 C221.00,-534.00,210.67,-511.00,210.00,-483.00 C210.00,-416.33,282.00,-223.33,426.00,96.00 L68.00,785.00 L23.00,858.00 C5.00,888.67,-4.00,914.33,-4.00,935.00 C-4.00,962.33,6.33,986.33,27.00,1007.00 C47.67,1027.67,71.33,1038.00,98.00,1038.00 C128.67,1038.00,152.33,1026.33,169.00,1003.00 C282.33,845.67,404.00,621.67,534.00,331.00 L682.00,676.00 C735.33,795.33,786.67,898.00,836.00,984.00 C857.33,1021.33,885.33,1040.00,920.00,1040.00 C947.33,1040.00,971.33,1030.33,992.00,1011.00 C1012.67,991.67,1023.33,968.67,1024.00,942.00 C1024.00,927.33,1019.67,910.67,1011.00,892.00 Z"]
......
......@@ -11,7 +11,7 @@ layer at (0,0) size 480x360
RenderSVGText {text} at (31,130) size 105x22 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,-17) size 105x22
chunk 1 text run 1 at (31.00,130.00) startOffset 0 endOffset 13 width 105.00: "Placed Glyphs"
RenderSVGContainer {g} at (164,81) size 212x162 [transform={m=((1.00,0.00)(0.00,-1.00)) t=(165.00,140.00)}]
RenderSVGContainer {g} at (164,81) size 212x162 [transform={m=((1.00,0.00)(-0.00,-1.00)) t=(165.00,140.00)}]
RenderPath {line} at (165,139) size 210x2 [stroke={[type=SOLID] [color=#888888]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00 L210.00,0.00"]
RenderSVGContainer {g} at (164,81) size 212x162 [transform={m=((0.03,0.00)(0.00,0.03)) t=(0.00,0.00)}]
RenderPath {line} at (164,81) size 2x162 [stroke={[type=SOLID] [color=#888888] [stroke width=50.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-3500.00 L0.00,2000.00"]
......
......@@ -11,7 +11,7 @@ layer at (0,0) size 480x360
RenderSVGText {text} at (31,130) size 105x22 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,-17) size 105x22
chunk 1 text run 1 at (31.00,130.00) startOffset 0 endOffset 13 width 105.00: "Placed Glyphs"
RenderSVGContainer {g} at (164,81) size 212x162 [transform={m=((1.00,0.00)(0.00,-1.00)) t=(165.00,140.00)}]
RenderSVGContainer {g} at (164,81) size 212x162 [transform={m=((1.00,0.00)(-0.00,-1.00)) t=(165.00,140.00)}]
RenderPath {line} at (165,139) size 210x2 [stroke={[type=SOLID] [color=#888888]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00 L210.00,0.00"]
RenderSVGContainer {g} at (164,81) size 212x162 [transform={m=((0.03,0.00)(0.00,0.03)) t=(0.00,0.00)}]
RenderPath {line} at (164,81) size 2x162 [stroke={[type=SOLID] [color=#888888] [stroke width=50.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-3500.00 L0.00,2000.00"]
......
......@@ -12,7 +12,7 @@ layer at (0,0) size 480x360
RenderSVGText {text} at (30,130) size 105x22 contains 1 chunk(s)
RenderSVGInlineText {#text} at (0,-17) size 105x22
chunk 1 text run 1 at (30.00,130.00) startOffset 0 endOffset 13 width 105.00: "Placed Glyphs"
RenderSVGContainer {g} at (164,81) size 212x162 [transform={m=((1.00,0.00)(0.00,-1.00)) t=(165.00,140.00)}]
RenderSVGContainer {g} at (164,81) size 212x162 [transform={m=((1.00,0.00)(-0.00,-1.00)) t=(165.00,140.00)}]
RenderPath {line} at (165,139) size 210x2 [stroke={[type=SOLID] [color=#888888]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00 L210.00,0.00"]
RenderSVGContainer {g} at (164,81) size 212x162 [transform={m=((0.03,0.00)(0.00,0.03)) t=(0.00,0.00)}]
RenderPath {line} at (164,81) size 2x162 [stroke={[type=SOLID] [color=#888888] [stroke width=50.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-3500.00 L0.00,2000.00"]
......
......@@ -10,4 +10,4 @@ layer at (0,0) size 800x600
RenderSVGContainer {g} at (0,0) size 0x0
RenderSVGContainer {use} at (0,0) size 0x0 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(250.00,-50.00)}]
RenderSVGContainer {g} at (0,0) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(10.00,10.00)}]
RenderSVGContainer {g} at (462,119) size 1x1 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(260.00,-40.00)}]
RenderSVGContainer {g} at (451,115) size 2x2 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(250.00,-35.86)}]
......@@ -14,6 +14,6 @@ layer at (0,0) size 800x600
RenderSVGContainer {g} at (0,0) size 0x0
RenderSVGContainer {use} at (0,0) size 0x0 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(250.00,-50.00)}]
RenderSVGContainer {g} at (0,0) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(10.00,10.00)}]
RenderSVGContainer {g} at (462,119) size 1x1 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(260.00,-40.00)}]
RenderSVGContainer {g} at (462,119) size 1x1
RenderSVGContainer {g} at (462,119) size 1x1
RenderSVGContainer {g} at (451,115) size 2x2 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(250.00,-35.86)}]
RenderSVGContainer {g} at (451,115) size 2x2
RenderSVGContainer {g} at (451,115) size 2x2
......@@ -80,7 +80,7 @@ PASS parseFloat(m.f) is 0
Test flipX()
PASS m4.a is -5
PASS m4.b is 0
PASS Math.abs(m4.b) is 0
PASS m4.c is 0
PASS m4.d is 5
PASS m4.e is 100
......@@ -97,7 +97,7 @@ PASS parseFloat(m3.f) is 50
Test flipY()
PASS m4.a is 5
PASS m4.b is 0
PASS m4.c is 0
PASS Math.abs(m4.c) is 0
PASS m4.d is -5
PASS m4.e is 100
PASS m4.f is 50
......
......@@ -115,7 +115,7 @@ debug("");
debug("Test flipX()");
m4 = m3.flipX();
shouldBe('m4.a', '-5');
shouldBe('m4.b', '0');
shouldBe('Math.abs(m4.b)', '0');
shouldBe('m4.c', '0');
shouldBe('m4.d', '5');
shouldBe('m4.e', '100');
......@@ -135,7 +135,7 @@ debug("Test flipY()");
m4 = m3.flipY();
shouldBe('m4.a', '5');
shouldBe('m4.b', '0');
shouldBe('m4.c', '0');
shouldBe('Math.abs(m4.c)', '0');
shouldBe('m4.d', '-5');
shouldBe('m4.e', '100');
shouldBe('m4.f', '50');
......
2010-02-08 Dirk Schulze <krit@webkit.org>
Reviewed by Nikolas Zimmermann.
Add back an AffineTransform class for use by SVG
https://bugs.webkit.org/show_bug.cgi?id=33750
This adds back AffineTransform. This saves additional 4% memory consumption
on the 50k rects stress test: https://bugs.webkit.org/attachment.cgi?id=46721
It also makes it possible to optimize the calculations internally of
AffineTransform to the needs of 2D transformations (the second benefit for SVG,
which uses transformations relative often at the moment.
Everything that is 2D related (like images, patterns, gradients, fonts), uses
AffineTransform now.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSSVGMatrixCustom.cpp:
(WebCore::JSSVGMatrix::multiply):
(WebCore::JSSVGMatrix::inverse):
(WebCore::JSSVGMatrix::rotateFromVector):
* bindings/js/JSSVGPODTypeWrapper.h:
* bindings/scripts/CodeGeneratorJS.pm:
* bindings/scripts/CodeGeneratorObjC.pm:
* bindings/scripts/CodeGeneratorV8.pm:
* bindings/v8/V8Index.h:
* bindings/v8/custom/V8SVGMatrixCustom.cpp:
(WebCore::V8SVGMatrix::multiplyCallback):
(WebCore::V8SVGMatrix::inverseCallback):
(WebCore::V8SVGMatrix::rotateFromVectorCallback):
* html/HTMLCanvasElement.cpp: Changed to AffineTransform now
(WebCore::HTMLCanvasElement::baseTransform):
* html/HTMLCanvasElement.h:
* platform/graphics/FloatPoint.cpp:
(WebCore::FloatPoint::matrixTransform):
* platform/graphics/FloatPoint.h:
* platform/graphics/GeneratedImage.cpp:
(WebCore::GeneratedImage::drawPattern):
* platform/graphics/GeneratedImage.h:
* platform/graphics/Gradient.cpp:
(WebCore::Gradient::setGradientSpaceTransform):
(WebCore::Gradient::setPlatformGradientSpaceTransform):
* platform/graphics/Gradient.h:
(WebCore::Gradient::gradientSpaceTransform):
* platform/graphics/GraphicsContext.h:
* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled):
* platform/graphics/Image.h:
* platform/graphics/ImageBuffer.h:
(WebCore::ImageBuffer::baseTransform):
* platform/graphics/Path.h:
* platform/graphics/Pattern.cpp:
(WebCore::Pattern::setPatternSpaceTransform):
* platform/graphics/Pattern.h:
(WebCore::Pattern::create):
(WebCore::Pattern::tileImage):
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::Font::drawGlyphs):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::setPlatformFill):
(WebCore::setPlatformStroke):
(WebCore::GraphicsContext::getCTM):
* platform/graphics/cairo/ImageCairo.cpp:
(WebCore::Image::drawPattern):
* platform/graphics/cairo/PathCairo.cpp:
* platform/graphics/cairo/PatternCairo.cpp:
(WebCore::Pattern::createPlatformPattern):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::getCTM):
* platform/graphics/cg/GraphicsContextPlatformPrivateCG.h:
(WebCore::GraphicsContextPlatformPrivate::concatCTM):
* platform/graphics/cg/ImageCG.cpp:
(WebCore::Image::drawPattern):
* platform/graphics/cg/PathCG.cpp:
* platform/graphics/cg/PatternCG.cpp:
(WebCore::Pattern::createPlatformPattern):
* platform/graphics/haiku/GraphicsContextHaiku.cpp:
(WebCore::GraphicsContext::getCTM):
* platform/graphics/haiku/ImageHaiku.cpp:
(WebCore::Image::drawPattern):
* platform/graphics/haiku/PathHaiku.cpp:
* platform/graphics/qt/FontQt.cpp:
(WebCore::Font::drawComplexText):
* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::GraphicsContext::getCTM):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
* platform/graphics/qt/ImageQt.cpp:
(WebCore::Image::drawPattern):
* platform/graphics/qt/PathQt.cpp:
* platform/graphics/qt/PatternQt.cpp:
(WebCore::Pattern::createPlatformPattern):
* platform/graphics/skia/GradientSkia.cpp:
(WebCore::Gradient::setPlatformGradientSpaceTransform):
* platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::GraphicsContext::getCTM):
* platform/graphics/skia/ImageSkia.cpp:
(WebCore::Image::drawPattern):
* platform/graphics/skia/PathSkia.cpp:
* platform/graphics/skia/PatternSkia.cpp:
(WebCore::Pattern::platformPattern):
* platform/graphics/skia/SkiaFontWin.cpp:
(WebCore::windowsCanHandleTextDrawing):
* platform/graphics/transforms/AffineTransform.cpp:
(WebCore::AffineTransform::makeIdentity): needed by some parts of WebCore
(WebCore::AffineTransform::scale): Didn't scale the complete matrix
(WebCore::AffineTransform::translate): Didn't respect other transformations
(WebCore::AffineTransform::shear): direct calculation, no extra multiply of matrices
(WebCore::AffineTransform::map):
(WebCore::AffineTransform::mapPoint):
(WebCore::AffineTransform::mapRect):
* platform/graphics/transforms/AffineTransform.h:
(WebCore::AffineTransform::isIdentityOrTranslation):
* platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::toAffineTransform):
* platform/graphics/transforms/TransformationMatrix.h:
* platform/graphics/win/FontCGWin.cpp:
(WebCore::drawGDIGlyphs):
* platform/graphics/win/GraphicsContextCGWin.cpp:
* platform/graphics/win/GraphicsContextCairoWin.cpp:
* platform/graphics/win/GraphicsContextWin.cpp:
(WebCore::GraphicsContextPlatformPrivate::concatCTM):
* platform/graphics/wince/FontWince.cpp:
* platform/graphics/wince/GraphicsContextWince.cpp:
(WebCore::GraphicsContextPlatformPrivate::concatCTM):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::getCTM):
(WebCore::GraphicsContext::drawBitmapPattern):
* platform/graphics/wince/ImageBufferWince.cpp:
(WebCore::):
(WebCore::BufferedImage::drawPattern):
* platform/graphics/wince/PathWince.cpp:
(WebCore::Path::transform):
* platform/graphics/wince/PlatformPathWince.cpp:
(WebCore::drawPolygons):
(WebCore::PathPolygon::transform):
(WebCore::PlatformPathElement::transform):
(WebCore::PlatformPath::strokePath):
(WebCore::PlatformPath::fillPath):
(WebCore::PlatformPath::transform):
* platform/graphics/wince/PlatformPathWince.h:
(WebCore::):
* platform/graphics/wx/GraphicsContextWx.cpp:
(WebCore::GraphicsContext::getCTM):
* platform/graphics/wx/ImageWx.cpp:
(WebCore::BitmapImage::drawPattern):
(WebCore::Image::drawPattern):
* platform/graphics/wx/PathWx.cpp:
* platform/gtk/RenderThemeGtk.cpp:
(WebCore::paintMozillaGtkWidget):
* plugins/win/PluginViewWin.cpp:
(WebCore::PluginView::paintWindowedPluginIntoContext):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::localTransform):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelScaleData::RenderBoxModelScaleData):
(WebCore::RenderBoxModelScaleData::transform):
(WebCore::RenderBoxModelScaleData::setTransform):
(WebCore::RenderBoxModelScaleObserver::shouldPaintBackgroundAtLowQuality):
(WebCore::RenderBoxModelObject::paintBoxShadow):
* rendering/RenderForeignObject.cpp:
(WebCore::RenderForeignObject::translationForAttributes):
(WebCore::RenderForeignObject::localToParentTransform):
* rendering/RenderForeignObject.h:
(WebCore::RenderForeignObject::localTransform):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayer):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::localTransform):
(WebCore::RenderObject::localToParentTransform):
(WebCore::RenderObject::absoluteTransform):
* rendering/RenderObject.h:
* rendering/RenderPath.cpp:
(WebCore::RenderPath::localToParentTransform):
(WebCore::RenderPath::localTransform):
* rendering/RenderPath.h:
* rendering/RenderSVGHiddenContainer.h:
(WebCore::RenderSVGHiddenContainer::absoluteTransform):
* rendering/RenderSVGImage.h:
(WebCore::RenderSVGImage::localToParentTransform):
(WebCore::RenderSVGImage::localTransform):
* rendering/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::localToBorderBoxTransform):
(WebCore::RenderSVGRoot::localToRepaintContainerTransform):
(WebCore::RenderSVGRoot::localToParentTransform):
(WebCore::RenderSVGRoot::absoluteTransform):
(WebCore::RenderSVGRoot::localTransform):
* rendering/RenderSVGRoot.h:
* rendering/RenderSVGText.h:
(WebCore::RenderSVGText::localToParentTransform):
(WebCore::RenderSVGText::localTransform):
* rendering/RenderSVGTransformableContainer.cpp:
(WebCore::RenderSVGTransformableContainer::localToParentTransform):
(WebCore::RenderSVGTransformableContainer::localTransform):
(WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
* rendering/RenderSVGTransformableContainer.h:
* rendering/RenderSVGViewportContainer.cpp:
(WebCore::RenderSVGViewportContainer::markerBoundaries):
(WebCore::RenderSVGViewportContainer::markerContentTransformation):
(WebCore::RenderSVGViewportContainer::viewportTransform):
(WebCore::RenderSVGViewportContainer::localToParentTransform):
(WebCore::RenderSVGViewportContainer::absoluteTransform):
* rendering/RenderSVGViewportContainer.h:
* rendering/SVGCharacterLayoutInfo.cpp:
(WebCore::SVGChar::characterTransform):
* rendering/SVGCharacterLayoutInfo.h:
(WebCore::SVGTextChunkWalker::operator()):
* rendering/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::calculateGlyphBoundaries):
(WebCore::SVGInlineTextBoxClosestCharacterToPositionWalker::chunkPortionCallback):
(WebCore::SVGInlineTextBoxSelectionRectWalker::chunkPortionCallback):
(WebCore::SVGInlineTextBox::paintCharacters):
(WebCore::SVGInlineTextBox::paintDecoration):
* rendering/SVGMarkerLayoutInfo.h:
(WebCore::MarkerLayout::MarkerLayout):
* rendering/SVGRenderSupport.cpp:
(WebCore::applyTransformToPaintInfo):
* rendering/SVGRenderSupport.h:
* rendering/SVGRenderTreeAsText.cpp:
(WebCore::operator<<):
* rendering/SVGRenderTreeAsText.h:
* rendering/SVGRootInlineBox.cpp:
(WebCore::SVGRootInlineBoxPaintWalker::chunkPortionCallback):
(WebCore::applyTextLengthCorrectionToTextChunk):
(WebCore::SVGRootInlineBox::buildLayoutInformation):
* rendering/TransformState.cpp:
(WebCore::TransformState::applyTransform):
* rendering/TransformState.h:
* svg/GradientAttributes.h:
(WebCore::GradientAttributes::gradientTransform):
(WebCore::GradientAttributes::setGradientTransform):
* svg/PatternAttributes.h:
(WebCore::PatternAttributes::patternTransform):
(WebCore::PatternAttributes::setPatternTransform):
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::resetToBaseValue):
(WebCore::SVGAnimateMotionElement::calculateAnimatedValue):
(WebCore::SVGAnimateMotionElement::applyResultsToTarget):
* svg/SVGAnimateMotionElement.h:
* svg/SVGAnimateTransformElement.cpp:
* svg/SVGAnimateTransformElement.h:
* svg/SVGElement.h:
(WebCore::SVGElement::supplementalTransform):
* svg/SVGFitToViewBox.cpp:
(WebCore::SVGFitToViewBox::viewBoxToViewTransform):
* svg/SVGFitToViewBox.h:
* svg/SVGLocatable.cpp:
(WebCore::SVGLocatable::getCTM):
(WebCore::SVGLocatable::getScreenCTM):
(WebCore::SVGLocatable::getTransformToElement):
* svg/SVGLocatable.h:
* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::viewBoxToViewTransform):
* svg/SVGMarkerElement.h:
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::drawMaskerContent):
* svg/SVGMatrix.idl:
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::buildPattern):
* svg/SVGPreserveAspectRatio.cpp:
(WebCore::SVGPreserveAspectRatio::getCTM):
* svg/SVGPreserveAspectRatio.h:
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::viewport):
(WebCore::SVGSVGElement::createSVGMatrix):
(WebCore::SVGSVGElement::createSVGTransformFromMatrix):
(WebCore::SVGSVGElement::getCTM):
(WebCore::SVGSVGElement::getScreenCTM):
(WebCore::SVGSVGElement::viewBoxToViewTransform):
* svg/SVGSVGElement.h:
* svg/SVGStyledLocatableElement.cpp:
(WebCore::SVGStyledLocatableElement::getCTM):
(WebCore::SVGStyledLocatableElement::getScreenCTM):
* svg/SVGStyledLocatableElement.h:
* svg/SVGStyledTransformableElement.cpp:
(WebCore::SVGStyledTransformableElement::getCTM):
(WebCore::SVGStyledTransformableElement::getScreenCTM):
(WebCore::SVGStyledTransformableElement::animatedLocalTransform):
(WebCore::SVGStyledTransformableElement::supplementalTransform):
* svg/SVGStyledTransformableElement.h:
(WebCore::SVGStyledTransformableElement::isStyledTransformable):
(WebCore::SVGStyledTransformableElement::toPathData):
* svg/SVGTextContentElement.cpp:
(WebCore::SVGInlineTextBoxQueryWalker::chunkPortionCallback):
* svg/SVGTextElement.cpp:
(WebCore::SVGTextElement::getScreenCTM):
(WebCore::SVGTextElement::getCTM):
(WebCore::SVGTextElement::animatedLocalTransform):
(WebCore::SVGTextElement::supplementalTransform):
* svg/SVGTextElement.h:
* svg/SVGTextPathElement.cpp:
* svg/SVGTransform.cpp:
(SVGTransform::SVGTransform):
(SVGTransform::matrix):
(SVGTransform::setMatrix):
* svg/SVGTransform.h:
* svg/SVGTransformDistance.cpp:
(WebCore::SVGTransformDistance::SVGTransformDistance):
(WebCore::SVGTransformDistance::scaledDistance):
(WebCore::SVGTransformDistance::isZero):
* svg/SVGTransformDistance.h:
* svg/SVGTransformList.cpp:
(SVGTransformList::createSVGTransformFromMatrix):
(SVGTransformList::concatenate):
(SVGTransformList::valueAsString):
* svg/SVGTransformList.h:
* svg/SVGTransformable.cpp:
(WebCore::SVGTransformable::getCTM):
(WebCore::SVGTransformable::getScreenCTM):
(WebCore::SVGTransformable::parseTransformValue):
* svg/SVGTransformable.h:
(WebCore::SVGTransformable::):
* svg/graphics/SVGPaintServerGradient.cpp:
(WebCore::SVGPaintServerGradient::gradientTransform):
(WebCore::SVGPaintServerGradient::setGradientTransform):
(WebCore::clipToTextMask):
(WebCore::SVGPaintServerGradient::setup):
* svg/graphics/SVGPaintServerGradient.h:
* svg/graphics/SVGPaintServerPattern.cpp:
(WebCore::SVGPaintServerPattern::patternTransform):
(WebCore::SVGPaintServerPattern::setPatternTransform):
(WebCore::SVGPaintServerPattern::setup):
* svg/graphics/SVGPaintServerPattern.h:
* svg/graphics/SVGResourceClipper.cpp:
(WebCore::SVGResourceClipper::applyClip):
* svg/graphics/SVGResourceMarker.cpp:
(WebCore::SVGResourceMarker::markerTransformation):
(WebCore::SVGResourceMarker::draw):
* svg/graphics/SVGResourceMarker.h:
* svg/graphics/filters/SVGFEImage.cpp:
* svg/graphics/filters/SVGFETile.cpp:
(WebCore::FETile::apply):
2010-02-08 Stephen White <senorblanco@chromium.org>
Reviewed by Dimitri Glazkov.
......
......@@ -1314,7 +1314,7 @@
84A81F410FC7E02700955300 /* SourceGraphic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84A81F3F0FC7E02700955300 /* SourceGraphic.cpp */; };
84A81F420FC7E02700955300 /* SourceGraphic.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A81F400FC7E02700955300 /* SourceGraphic.h */; };
84D0C4041115F1D40018AA34 /* AffineTransform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84D0C4031115F1D40018AA34 /* AffineTransform.cpp */; };
84D0C4061115F1EA0018AA34 /* AffineTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D0C4051115F1EA0018AA34 /* AffineTransform.h */; };
84D0C4061115F1EA0018AA34 /* AffineTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D0C4051115F1EA0018AA34 /* AffineTransform.h */; settings = {ATTRIBUTES = (Private, ); }; };
85004D940ACEEAEF00C438F6 /* DOMSVGDefsElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 85004D880ACEEAEF00C438F6 /* DOMSVGDefsElement.h */; };
85004D950ACEEAEF00C438F6 /* DOMSVGDefsElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85004D890ACEEAEF00C438F6 /* DOMSVGDefsElement.mm */; };
85004D960ACEEAEF00C438F6 /* DOMSVGDescElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 85004D8A0ACEEAEF00C438F6 /* DOMSVGDescElement.h */; };
......@@ -23,7 +23,7 @@
#if ENABLE(SVG)
#include "JSSVGMatrix.h"
#include "TransformationMatrix.h"
#include "AffineTransform.h"
#include "SVGException.h"
#include <runtime/Error.h>
......@@ -41,19 +41,19 @@ JSValue JSSVGMatrix::multiply(ExecState* exec, const ArgList& args)
JSSVGMatrix* matrixObj = static_cast<JSSVGMatrix*>(asObject(args.at(0)));
TransformationMatrix m1(*impl());
TransformationMatrix m2(*(matrixObj->impl()));
AffineTransform m1(*impl());
AffineTransform m2(*(matrixObj->impl()));
SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);
return toJS(exec, globalObject(), JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(m1.multLeft(m2)).get(), context);
return toJS(exec, globalObject(), JSSVGStaticPODTypeWrapper<AffineTransform>::create(m1.multLeft(m2)).get(), context);
}
JSValue JSSVGMatrix::inverse(ExecState* exec, const ArgList&)
{
TransformationMatrix imp(*impl());
AffineTransform imp(*impl());
SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);
JSValue result = toJS(exec, globalObject(), JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.inverse()).get(), context);
JSValue result = toJS(exec, globalObject(), JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp.inverse()).get(), context);
if (!imp.isInvertible())
setDOMException(exec, SVGException::SVG_MATRIX_NOT_INVERTABLE);
......@@ -63,13 +63,13 @@ JSValue JSSVGMatrix::inverse(ExecState* exec, const ArgList&)
JSValue JSSVGMatrix::rotateFromVector(ExecState* exec, const ArgList& args)
{
TransformationMatrix imp(*impl());
AffineTransform imp(*impl());
float x = args.at(0).toFloat(exec);
float y = args.at(1).toFloat(exec);
SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);
JSValue result = toJS(exec, globalObject(), JSSVGStaticPODTypeWrapper<TransformationMatrix>::create(imp.rotateFromVector(x, y)).get(), context);
JSValue result = toJS(exec, globalObject(), JSSVGStaticPODTypeWrapper<AffineTransform>::create(imp.rotateFromVector(x, y)).get(), context);
if (x == 0.0 || y == 0.0)
setDOMException(exec, SVGException::SVG_INVALID_VALUE_ERR);
......
......@@ -46,13 +46,13 @@ public:
};
// This file contains JS wrapper objects for SVG datatypes, that are passed around by value
// in WebCore/svg (aka. 'POD types'). For instance SVGMatrix is mapped to TransformationMatrix, and
// in WebCore/svg (aka. 'POD types'). For instance SVGMatrix is mapped to AffineTransform, and
// passed around as const reference. SVG DOM demands these objects to be "live", changes to any
// of the writable attributes of SVGMatrix need to be reflected in the object which exposed the
// SVGMatrix object (i.e. 'someElement.transform.matrix.a = 50.0', in that case 'SVGTransform').
// The SVGTransform class stores its "TransformationMatrix m_matrix" object on the stack. If it would
// The SVGTransform class stores its "AffineTransform m_matrix" object on the stack. If it would
// be stored as pointer we could just build an auto-generated JSSVG* wrapper object around it
// and all changes to that object would automatically affect the TransformationMatrix* object stored
// and all changes to that object would automatically affect the AffineTransform* object stored
// in the SVGTransform object. For the sake of efficiency and memory we don't pass around any
// primitive values as pointers, so a custom JS wrapper object is needed for all SVG types, that
// are internally represented by POD types (SVGRect <-> FloatRect, SVGPoint <-> FloatPoint, ...).
......
......@@ -1836,7 +1836,7 @@ my %nativeType = (
"NodeFilter" => "RefPtr<NodeFilter>",
"SVGAngle" => "SVGAngle",
"SVGLength" => "SVGLength",
"SVGMatrix" => "TransformationMatrix",
"SVGMatrix" => "AffineTransform",
"SVGNumber" => "float",
"SVGPaintType" => "SVGPaint::SVGPaintType",
"SVGPreserveAspectRatio" => "SVGPreserveAspectRatio",
......
......@@ -578,7 +578,7 @@ sub AddIncludesForType
}
if ($type eq "SVGMatrix") {
$implIncludes{"TransformationMatrix.h"} = 1;
$implIncludes{"AffineTransform.h"} = 1;
$implIncludes{"DOMSVGMatrixInternal.h"} = 1;
$implIncludes{"SVGException.h"} = 1;
return;
......@@ -1426,8 +1426,8 @@ sub GenerateImplementation
}
# FIXME! We need [Custom] support for ObjC, to move these hacks into DOMSVGLength/MatrixCustom.mm
my $svgMatrixRotateFromVector = ($podType and $podType eq "TransformationMatrix" and $functionName eq "rotateFromVector");
my $svgMatrixInverse = ($podType and $podType eq "TransformationMatrix" and $functionName eq "inverse");
my $svgMatrixRotateFromVector = ($podType and $podType eq "AffineTransform" and $functionName eq "rotateFromVector");
my $svgMatrixInverse = ($podType and $podType eq "AffineTransform" and $functionName eq "inverse");
my $svgLengthConvertToSpecifiedUnits = ($podType and $podType eq "SVGLength" and $functionName eq "convertToSpecifiedUnits");
push(@parameterNames, "ec") if $raisesExceptions and !($svgMatrixRotateFromVector || $svgMatrixInverse);
......
......@@ -2105,7 +2105,7 @@ sub GetNativeTypeForConversions
my $type = shift;
return "FloatRect" if $type eq "SVGRect";
return "FloatPoint" if $type eq "SVGPoint";
return "TransformationMatrix" if $type eq "SVGMatrix";
return "AffineTransform" if $type eq "SVGMatrix";
return "float" if $type eq "SVGNumber";
return $type;
}
......@@ -2359,7 +2359,7 @@ sub GetNativeType
return "Range::CompareHow" if $type eq "CompareHow";
return "FloatRect" if $type eq "SVGRect";
return "FloatPoint" if $type eq "SVGPoint";
return "TransformationMatrix" if $type eq "SVGMatrix";
return "AffineTransform" if $type eq "SVGMatrix";