Title: [158019] branches/safari-537.73-branch

Diff

Modified: branches/safari-537.73-branch/LayoutTests/ChangeLog (158018 => 158019)


--- branches/safari-537.73-branch/LayoutTests/ChangeLog	2013-10-25 17:35:20 UTC (rev 158018)
+++ branches/safari-537.73-branch/LayoutTests/ChangeLog	2013-10-25 17:44:12 UTC (rev 158019)
@@ -1,3 +1,21 @@
+2013-10-25  Lucas Forschler  <[email protected]>
+
+        Merge r154856
+
+    2013-08-29  Tim Horton  <[email protected]>
+
+            SVG clipping, masking, and gradients-on-text do not respect the device scale factor
+            https://bugs.webkit.org/show_bug.cgi?id=120377
+            <rdar://problem/14777944>
+
+            Reviewed by Simon Fraser.
+
+            Add a test that ensures that when deviceScaleFactor=2, masks, clipping,
+            gradients, and patterns are rendered @2x.
+
+            * svg/custom/masking-clipping-hidpi-expected.svg: Added.
+            * svg/custom/masking-clipping-hidpi.svg: Added.
+
 2013-10-24  Lucas Forschler  <[email protected]>
 
         Merge r154681

Copied: branches/safari-537.73-branch/LayoutTests/svg/custom/masking-clipping-hidpi-expected.svg (from rev 154856, trunk/LayoutTests/svg/custom/masking-clipping-hidpi-expected.svg) (0 => 158019)


--- branches/safari-537.73-branch/LayoutTests/svg/custom/masking-clipping-hidpi-expected.svg	                        (rev 0)
+++ branches/safari-537.73-branch/LayoutTests/svg/custom/masking-clipping-hidpi-expected.svg	2013-10-25 17:44:12 UTC (rev 158019)
@@ -0,0 +1,27 @@
+<svg xmlns="http://www.w3.org/2000/svg" _onload_="startTest()">
+    <script>
+    function startTest() {
+        if (!window.testRunner)
+            return;
+
+        testRunner.waitUntilDone();
+        testRunner.setBackingScaleFactor(2, finishTest);
+    }
+
+    function finishTest() {
+        setTimeout(function () { testRunner.notifyDone(); }, 0);
+    }
+    </script>
+    <style>
+        text {
+            -webkit-font-smoothing: antialiased;
+        }
+    </style>
+
+    <text x='0' y='12'>This text should be sharp.</text>
+    <text x='0' y='36'>This text and the circles should also be sharp.</text>
+
+    <circle cx="25" cy="85" r="20"/>
+    <circle cx="25" cy="135" r="20"/>
+    <circle cx="25" cy="187" r="20"/>
+</svg>

Copied: branches/safari-537.73-branch/LayoutTests/svg/custom/masking-clipping-hidpi.svg (from rev 154856, trunk/LayoutTests/svg/custom/masking-clipping-hidpi.svg) (0 => 158019)


--- branches/safari-537.73-branch/LayoutTests/svg/custom/masking-clipping-hidpi.svg	                        (rev 0)
+++ branches/safari-537.73-branch/LayoutTests/svg/custom/masking-clipping-hidpi.svg	2013-10-25 17:44:12 UTC (rev 158019)
@@ -0,0 +1,52 @@
+<svg xmlns="http://www.w3.org/2000/svg" _onload_="startTest()">
+    <script>
+    function startTest() {
+        if (!window.testRunner)
+            return;
+
+        testRunner.waitUntilDone();
+        testRunner.setBackingScaleFactor(2, finishTest);
+    }
+
+    function finishTest() {
+        setTimeout(function () { testRunner.notifyDone(); }, 0);
+    }
+    </script>
+    <style>
+        text {
+            -webkit-font-smoothing: antialiased;
+        }
+    </style>
+
+    <defs>
+        <mask id="textMask">
+            <rect width='100%' height='100%' fill='white'/>
+            <text width='100%' height='100%' x='0' y='12'>This text should be sharp.</text>
+        </mask>
+    </defs>
+    <rect width='200' height='100' fill='black'/>
+    <rect width='200' height='100' fill='white' mask="url(#textMask)"/>
+
+    <defs>
+        <linearGradient id="blackGradient" x1="0%" y1="0%" x2="100%" y2="0%">
+            <stop offset="0%" style="stop-color:rgb(0,0,0);"/>
+            <stop offset="100%" style="stop-color:rgb(0,0,0);"/>
+        </linearGradient>
+    </defs>
+    <text x='0' y='36' fill="url(#blackGradient)">This text and the circles should also be sharp.</text>
+
+    <defs>
+        <clipPath id="circleClipPath" clipPathUnits="objectBoundingBox">
+            <circle cx="0.25" cy="0.25" r="0.20"/>
+            <circle cx="0.25" cy="0.75" r="0.20"/>
+        </clipPath>
+    </defs>
+    <rect x="0" y="60" width="100" height="100" clip-path="url(#circleClipPath)"/>
+
+    <defs>
+        <pattern id="Pattern" width="1" height="1">
+            <circle cx="25" cy="25" r="20" fill="url(#blackGradient)"/>
+        </pattern>
+    </defs>
+    <rect fill="url(#Pattern)" x="0" y="162" width="200" height="200"/>
+</svg>

Modified: branches/safari-537.73-branch/Source/WebCore/ChangeLog (158018 => 158019)


--- branches/safari-537.73-branch/Source/WebCore/ChangeLog	2013-10-25 17:35:20 UTC (rev 158018)
+++ branches/safari-537.73-branch/Source/WebCore/ChangeLog	2013-10-25 17:44:12 UTC (rev 158019)
@@ -1,3 +1,23 @@
+2013-10-25  Lucas Forschler  <[email protected]>
+
+        Merge r154856
+
+    2013-08-29  Tim Horton  <[email protected]>
+
+            SVG clipping, masking, and gradients-on-text do not respect the device scale factor
+            https://bugs.webkit.org/show_bug.cgi?id=120377
+            <rdar://problem/14777944>
+
+            Reviewed by Simon Fraser.
+
+            Tests: svg/custom/masking-clipping-hidpi.svg
+
+            calculateTransformationToOutermostCoordinateSystem should include the page's
+            device scale factor in its transform.
+
+            * rendering/svg/SVGRenderingContext.cpp:
+            (WebCore::SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem):
+
 2013-10-24  Lucas Forschler  <[email protected]>
 
         Merge r154694

Modified: branches/safari-537.73-branch/Source/WebCore/rendering/svg/SVGRenderingContext.cpp (158018 => 158019)


--- branches/safari-537.73-branch/Source/WebCore/rendering/svg/SVGRenderingContext.cpp	2013-10-25 17:35:20 UTC (rev 158018)
+++ branches/safari-537.73-branch/Source/WebCore/rendering/svg/SVGRenderingContext.cpp	2013-10-25 17:44:12 UTC (rev 158019)
@@ -30,6 +30,7 @@
 #include "BasicShapes.h"
 #include "Frame.h"
 #include "FrameView.h"
+#include "Page.h"
 #include "RenderLayer.h"
 #include "RenderSVGImage.h"
 #include "RenderSVGResource.h"
@@ -199,6 +200,10 @@
     ASSERT(renderer);
     absoluteTransform = currentContentTransformation();
 
+    float deviceScaleFactor = 1;
+    if (Page* page = renderer->document()->page())
+        deviceScaleFactor = page->deviceScaleFactor();
+
     // Walk up the render tree, accumulating SVG transforms.
     while (renderer) {
         absoluteTransform = renderer->localToParentTransform() * absoluteTransform;
@@ -219,6 +224,8 @@
 
         layer = layer->parent();
     }
+
+    absoluteTransform.scale(deviceScaleFactor);
 }
 
 bool SVGRenderingContext::createImageBuffer(const FloatRect& targetRect, const AffineTransform& absoluteTransform, OwnPtr<ImageBuffer>& imageBuffer, ColorSpace colorSpace, RenderingMode renderingMode)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to