Diff
Modified: trunk/LayoutTests/ChangeLog (96154 => 96155)
--- trunk/LayoutTests/ChangeLog 2011-09-27 21:04:04 UTC (rev 96154)
+++ trunk/LayoutTests/ChangeLog 2011-09-27 21:06:17 UTC (rev 96155)
@@ -1,3 +1,33 @@
+2011-09-27 Tim Horton <timothy_hor...@apple.com>
+
+ REGRESSION(65665): Pattern size being clamped to SVG size can prevent transformed elements from being fully covered by userSpaceOnUse patterns
+ https://bugs.webkit.org/show_bug.cgi?id=67700
+ <rdar://problem/10125102>
+
+ Reviewed by Darin Adler.
+
+ pattern-excessive-malloc is so excessive that it runs into the floating point precision barrier
+ when determining the scale to draw the pattern at; drop the size two orders of magnitude, which is
+ still very excessive but easier to draw with.
+
+ Add a test (transformed-pattern-clamp-svg-root.svg) that ensures that patterns on transformed
+ elements are displayed correctly, instead of being clamped to the size of the <svg> element.
+
+ Add a test (oversized-pattern-scale.svg) that ensures that oversized patterns are correctly drawn
+ into the pattern tile scaled down and then are scaled back up when drawn to the screen.
+
+ * platform/mac/svg/custom/js-late-gradient-and-object-creation-expected.png:
+ * platform/mac/svg/custom/pattern-excessive-malloc-expected.txt:
+ * platform/qt/svg/custom/pattern-excessive-malloc-expected.txt:
+ * svg/custom/pattern-excessive-malloc-expected.txt:
+ * svg/custom/pattern-excessive-malloc.svg:
+ * svg/custom/oversized-pattern-scale-expected.png: Added.
+ * svg/custom/oversized-pattern-scale-expected.txt: Added.
+ * svg/custom/oversized-pattern-scale.svg: Added.
+ * svg/custom/transformed-pattern-clamp-svg-root.svg: Added.
+ * svg/custom/transformed-pattern-clamp-svg-root-expected.png: Added.
+ * svg/custom/transformed-pattern-clamp-svg-root-expected.txt: Added.
+
2011-09-27 Dan Bernstein <m...@apple.com>
<rdar://problem/10098679> Assertion failure in RenderLayer::paintPaginatedChildLayer()
Modified: trunk/LayoutTests/platform/mac/svg/custom/js-late-gradient-and-object-creation-expected.png
(Binary files differ)
Modified: trunk/LayoutTests/platform/mac/svg/custom/pattern-excessive-malloc-expected.txt (96154 => 96155)
--- trunk/LayoutTests/platform/mac/svg/custom/pattern-excessive-malloc-expected.txt 2011-09-27 21:04:04 UTC (rev 96154)
+++ trunk/LayoutTests/platform/mac/svg/custom/pattern-excessive-malloc-expected.txt 2011-09-27 21:06:17 UTC (rev 96155)
@@ -4,5 +4,5 @@
RenderSVGRoot {svg} at (10,300) size 100x100
RenderSVGHiddenContainer {defs} at (0,0) size 0x0
RenderSVGResourcePattern {pattern} [id="pattern"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
- RenderSVGPath {rect} at (0,0) size 800x600 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=99999997952.00] [height=99999997952.00]
+ RenderSVGPath {rect} at (0,0) size 800x600 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=1000000000.00] [height=1000000000.00]
RenderSVGPath {rect} at (10,300) size 100x100 [fill={[type=PATTERN] [id="pattern"]}] [x=10.00] [y=300.00] [width=100.00] [height=100.00]
Modified: trunk/LayoutTests/platform/qt/svg/custom/pattern-excessive-malloc-expected.txt (96154 => 96155)
--- trunk/LayoutTests/platform/qt/svg/custom/pattern-excessive-malloc-expected.txt 2011-09-27 21:04:04 UTC (rev 96154)
+++ trunk/LayoutTests/platform/qt/svg/custom/pattern-excessive-malloc-expected.txt 2011-09-27 21:06:17 UTC (rev 96155)
@@ -4,5 +4,5 @@
RenderSVGRoot {svg} at (10,300) size 100x100
RenderSVGHiddenContainer {defs} at (0,0) size 0x0
RenderSVGResourcePattern {pattern} [id="pattern"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
- RenderSVGPath {rect} at (0,0) size 800x600 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=99999997952.00] [height=99999997952.00]
+ RenderSVGPath {rect} at (0,0) size 800x600 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=1000000000.00] [height=1000000000.00]
RenderSVGPath {rect} at (10,300) size 100x100 [fill={[type=PATTERN] [id="pattern"]}] [x=10.00] [y=300.00] [width=100.00] [height=100.00]
Added: trunk/LayoutTests/svg/custom/oversized-pattern-scale-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/svg/custom/oversized-pattern-scale-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/svg/custom/oversized-pattern-scale-expected.txt (0 => 96155)
--- trunk/LayoutTests/svg/custom/oversized-pattern-scale-expected.txt (rev 0)
+++ trunk/LayoutTests/svg/custom/oversized-pattern-scale-expected.txt 2011-09-27 21:06:17 UTC (rev 96155)
@@ -0,0 +1,8 @@
+layer at (0,0) size 8192x585
+ RenderView at (0,0) size 800x585
+layer at (0,0) size 8192x585
+ RenderSVGRoot {svg} at (0,0) size 8192x100
+ RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+ RenderSVGResourcePattern {pattern} [id="pattern"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
+ RenderSVGPath {rect} at (0,0) size 4096x585 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=4096.00] [height=8192.00]
+ RenderSVGPath {rect} at (0,0) size 8192x100 [fill={[type=PATTERN] [id="pattern"]}] [x=0.00] [y=0.00] [width=8192.00] [height=100.00]
Added: trunk/LayoutTests/svg/custom/oversized-pattern-scale.svg (0 => 96155)
--- trunk/LayoutTests/svg/custom/oversized-pattern-scale.svg (rev 0)
+++ trunk/LayoutTests/svg/custom/oversized-pattern-scale.svg 2011-09-27 21:06:17 UTC (rev 96155)
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="8192">
+<title>The black square should be 4096 pixels wide.</title>
+<defs>
+<pattern id="pattern" width="8192" height="8192" patternUnits="userSpaceOnUse">
+<rect x="0" y="0" width="4096" height="8192" fill="black" style="stroke:none" />
+</pattern>
+</defs>
+<rect width="8192" height="100" x="0" y="0" fill="url(#pattern)" />
+</svg>
+
Modified: trunk/LayoutTests/svg/custom/pattern-excessive-malloc-expected.txt (96154 => 96155)
--- trunk/LayoutTests/svg/custom/pattern-excessive-malloc-expected.txt 2011-09-27 21:04:04 UTC (rev 96154)
+++ trunk/LayoutTests/svg/custom/pattern-excessive-malloc-expected.txt 2011-09-27 21:06:17 UTC (rev 96155)
@@ -4,5 +4,5 @@
RenderSVGRoot {svg} at (10,300) size 100x100
RenderSVGHiddenContainer {defs} at (0,0) size 0x0
RenderSVGResourcePattern {pattern} [id="pattern"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
- RenderSVGPath {rect} at (0,0) size 800x600 [fill={[type=SOLID] [color=#FF0000]}] [data="" L99999997952.00,0.00 L99999997952.00,99999997952.00 L0.00,99999997952.00 Z"]
- RenderSVGPath {rect} at (10,300) size 100x100 [fill={[type=PATTERN] [id="pattern"]}] [data="" L110.00,300.00 L110.00,400.00 L10.00,400.00 Z"]
+ RenderSVGPath {rect} at (0,0) size 800x600 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=1000000000.00] [height=1000000000.00]
+ RenderSVGPath {rect} at (10,300) size 100x100 [fill={[type=PATTERN] [id="pattern"]}] [x=10.00] [y=300.00] [width=100.00] [height=100.00]
Modified: trunk/LayoutTests/svg/custom/pattern-excessive-malloc.svg (96154 => 96155)
--- trunk/LayoutTests/svg/custom/pattern-excessive-malloc.svg 2011-09-27 21:04:04 UTC (rev 96154)
+++ trunk/LayoutTests/svg/custom/pattern-excessive-malloc.svg 2011-09-27 21:06:17 UTC (rev 96155)
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
-<pattern id="pattern" width="100000000000" height="100000000000" patternUnits="userSpaceOnUse">
-<rect x="0" y="0" width="100000000000" height="100000000000" fill="red" style="stroke:none" />
+<pattern id="pattern" width="1000000000" height="1000000000" patternUnits="userSpaceOnUse">
+<rect x="0" y="0" width="1000000000" height="1000000000" fill="red" style="stroke:none" />
</pattern>
</defs>
<rect width="100" height="100" x="10" y="300" fill="url(#pattern)" />
Added: trunk/LayoutTests/svg/custom/transformed-pattern-clamp-svg-root-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/svg/custom/transformed-pattern-clamp-svg-root-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/svg/custom/transformed-pattern-clamp-svg-root-expected.txt (0 => 96155)
--- trunk/LayoutTests/svg/custom/transformed-pattern-clamp-svg-root-expected.txt (rev 0)
+++ trunk/LayoutTests/svg/custom/transformed-pattern-clamp-svg-root-expected.txt 2011-09-27 21:06:17 UTC (rev 96155)
@@ -0,0 +1,11 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 200x200
+ RenderSVGRoot {svg} at (0,0) size 200x200
+ RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+ RenderSVGResourceLinearGradient {linearGradient} [id="gradient"] [gradientUnits=objectBoundingBox] [start=(0,0)] [end=(0,1)]
+ RenderSVGGradientStop {stop} [offset=0.00] [color=#FFFFFF]
+ RenderSVGGradientStop {stop} [offset=1.00] [color=#000000]
+ RenderSVGResourcePattern {pattern} [id="shot"] [patternUnits=userSpaceOnUse] [patternContentUnits=userSpaceOnUse]
+ RenderSVGPath {rect} at (0,0) size 200x200 [fill={[type=LINEAR-GRADIENT] [id="gradient"]}] [x=0.00] [y=0.00] [width=400.00] [height=400.00]
+ RenderSVGPath {rect} at (0,0) size 200x200 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,-100.00)}] [fill={[type=PATTERN] [id="shot"]}] [x=0.00] [y=100.00] [width=200.00] [height=200.00]
Added: trunk/LayoutTests/svg/custom/transformed-pattern-clamp-svg-root.svg (0 => 96155)
--- trunk/LayoutTests/svg/custom/transformed-pattern-clamp-svg-root.svg (rev 0)
+++ trunk/LayoutTests/svg/custom/transformed-pattern-clamp-svg-root.svg 2011-09-27 21:06:17 UTC (rev 96155)
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="200" width="200">
+<title>The rectangle should be filled with a single smooth gradient.</title>
+<defs>
+ <linearGradient id="gradient" x2="0%" y2="100%">
+ <stop offset="0" stop-color="white"/>
+ <stop offset="1" stop-color="black"/>
+ </linearGradient>
+ <pattern id="shot" patternUnits="userSpaceOnUse" width="400" height="400">
+ <rect height="400" width="400" fill="url(#gradient)"/>
+ </pattern>
+</defs>
+<rect transform="translate(0,-100)" x="0" y="100" width="200" height="200" fill="url(#shot)"/>
+</svg>
Modified: trunk/Source/WebCore/ChangeLog (96154 => 96155)
--- trunk/Source/WebCore/ChangeLog 2011-09-27 21:04:04 UTC (rev 96154)
+++ trunk/Source/WebCore/ChangeLog 2011-09-27 21:06:17 UTC (rev 96155)
@@ -1,3 +1,36 @@
+2011-09-27 Tim Horton <timothy_hor...@apple.com>
+
+ REGRESSION(65665): Pattern size being clamped to SVG size can prevent transformed elements from being fully covered by userSpaceOnUse patterns
+ https://bugs.webkit.org/show_bug.cgi?id=67700
+ <rdar://problem/10125102>
+
+ Reviewed by Darin Adler.
+
+ Clamp all resources to the same size, 4096x4096 (arbitrarily chosen), instead of to the size
+ of the <svg> element. This fixes the case where a transformed element displays part of a resource
+ outside of the size of the <svg> element.
+
+ When drawing an oversized pattern into its tile image, scale the content down to fit. When drawing
+ the tile image to the screen, scale it back up to fit the expected area. This will cause pixelation
+ when patterns are over the 4k limit.
+
+ Tests: svg/custom/transformed-pattern-clamp-svg-root.svg, svg/custom/oversized-pattern-scale.svg
+
+ * rendering/svg/RenderSVGResourceClipper.cpp:
+ (WebCore::RenderSVGResourceClipper::applyClippingToContext):
+ * rendering/svg/RenderSVGResourceGradient.cpp:
+ (WebCore::createMaskAndSwapContextForTextGradient):
+ (WebCore::clipToTextMask):
+ * rendering/svg/RenderSVGResourceMasker.cpp:
+ (WebCore::RenderSVGResourceMasker::applyResource):
+ * rendering/svg/RenderSVGResourcePattern.cpp:
+ (WebCore::RenderSVGResourcePattern::applyResource):
+ (WebCore::RenderSVGResourcePattern::createTileImage):
+ * rendering/svg/RenderSVGResourcePattern.h:
+ * rendering/svg/SVGImageBufferTools.cpp:
+ (WebCore::SVGImageBufferTools::clampedAbsoluteTargetRect):
+ * rendering/svg/SVGImageBufferTools.h:
+
2011-09-27 Dan Bernstein <m...@apple.com>
<rdar://problem/10098679> Assertion failure in RenderLayer::paintPaginatedChildLayer()
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp (96154 => 96155)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp 2011-09-27 21:04:04 UTC (rev 96154)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp 2011-09-27 21:06:17 UTC (rev 96155)
@@ -173,7 +173,7 @@
SVGImageBufferTools::calculateTransformationToOutermostSVGCoordinateSystem(object, absoluteTransform);
FloatRect absoluteTargetRect = absoluteTransform.mapRect(repaintRect);
- FloatRect clampedAbsoluteTargetRect = SVGImageBufferTools::clampedAbsoluteTargetRectForRenderer(object, absoluteTargetRect);
+ FloatRect clampedAbsoluteTargetRect = SVGImageBufferTools::clampedAbsoluteTargetRect(absoluteTargetRect);
if (shouldCreateClipData && !clampedAbsoluteTargetRect.isEmpty()) {
if (!SVGImageBufferTools::createImageBuffer(absoluteTargetRect, clampedAbsoluteTargetRect, clipperData->clipMaskImage, ColorSpaceDeviceRGB))
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp (96154 => 96155)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp 2011-09-27 21:04:04 UTC (rev 96154)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp 2011-09-27 21:06:17 UTC (rev 96155)
@@ -86,7 +86,7 @@
SVGImageBufferTools::calculateTransformationToOutermostSVGCoordinateSystem(textRootBlock, absoluteTransform);
FloatRect absoluteTargetRect = absoluteTransform.mapRect(textRootBlock->repaintRectInLocalCoordinates());
- FloatRect clampedAbsoluteTargetRect = SVGImageBufferTools::clampedAbsoluteTargetRectForRenderer(textRootBlock, absoluteTargetRect);
+ FloatRect clampedAbsoluteTargetRect = SVGImageBufferTools::clampedAbsoluteTargetRect(absoluteTargetRect);
if (clampedAbsoluteTargetRect.isEmpty())
return false;
@@ -123,7 +123,7 @@
SVGImageBufferTools::calculateTransformationToOutermostSVGCoordinateSystem(textRootBlock, absoluteTransform);
FloatRect absoluteTargetRect = absoluteTransform.mapRect(targetRect);
- FloatRect clampedAbsoluteTargetRect = SVGImageBufferTools::clampedAbsoluteTargetRectForRenderer(textRootBlock, absoluteTargetRect);
+ FloatRect clampedAbsoluteTargetRect = SVGImageBufferTools::clampedAbsoluteTargetRect(absoluteTargetRect);
SVGImageBufferTools::clipToImageBuffer(context, absoluteTransform, clampedAbsoluteTargetRect, imageBuffer);
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp (96154 => 96155)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp 2011-09-27 21:04:04 UTC (rev 96154)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp 2011-09-27 21:06:17 UTC (rev 96155)
@@ -99,7 +99,7 @@
SVGImageBufferTools::calculateTransformationToOutermostSVGCoordinateSystem(object, absoluteTransform);
FloatRect absoluteTargetRect = absoluteTransform.mapRect(object->repaintRectInLocalCoordinates());
- FloatRect clampedAbsoluteTargetRect = SVGImageBufferTools::clampedAbsoluteTargetRectForRenderer(object, absoluteTargetRect);
+ FloatRect clampedAbsoluteTargetRect = SVGImageBufferTools::clampedAbsoluteTargetRect(absoluteTargetRect);
if (!maskerData->maskImage && !clampedAbsoluteTargetRect.isEmpty()) {
SVGMaskElement* maskElement = static_cast<SVGMaskElement*>(node());
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp (96154 => 96155)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp 2011-09-27 21:04:04 UTC (rev 96154)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp 2011-09-27 21:06:17 UTC (rev 96155)
@@ -120,9 +120,10 @@
// Ignore 2D rotation, as it doesn't affect the size of the tile.
SVGImageBufferTools::clear2DRotation(absoluteTransformIgnoringRotation);
FloatRect absoluteTileBoundaries = absoluteTransformIgnoringRotation.mapRect(tileBoundaries);
+ FloatRect clampedAbsoluteTileBoundaries;
// Build tile image.
- OwnPtr<ImageBuffer> tileImage = createTileImage(object, m_attributes, tileBoundaries, absoluteTileBoundaries, tileImageTransform);
+ OwnPtr<ImageBuffer> tileImage = createTileImage(m_attributes, tileBoundaries, absoluteTileBoundaries, tileImageTransform, clampedAbsoluteTileBoundaries);
if (!tileImage)
return false;
@@ -137,7 +138,7 @@
// Compute pattern space transformation.
patternData->transform.translate(tileBoundaries.x(), tileBoundaries.y());
- patternData->transform.scale(tileBoundaries.width() / absoluteTileBoundaries.width(), tileBoundaries.height() / absoluteTileBoundaries.height());
+ patternData->transform.scale(tileBoundaries.width() / clampedAbsoluteTileBoundaries.width(), tileBoundaries.height() / clampedAbsoluteTileBoundaries.height());
AffineTransform patternTransform = m_attributes.patternTransform();
if (!patternTransform.isIdentity())
@@ -241,24 +242,14 @@
return true;
}
-PassOwnPtr<ImageBuffer> RenderSVGResourcePattern::createTileImage(RenderObject* object,
- const PatternAttributes& attributes,
+PassOwnPtr<ImageBuffer> RenderSVGResourcePattern::createTileImage(const PatternAttributes& attributes,
const FloatRect& tileBoundaries,
const FloatRect& absoluteTileBoundaries,
- const AffineTransform& tileImageTransform) const
+ const AffineTransform& tileImageTransform,
+ FloatRect& clampedAbsoluteTileBoundaries) const
{
- ASSERT(object);
+ clampedAbsoluteTileBoundaries = SVGImageBufferTools::clampedAbsoluteTargetRect(absoluteTileBoundaries);
- // Clamp tile image size against SVG viewport size, as last resort, to avoid allocating huge image buffers.
- FloatRect contentBoxRect = SVGRenderSupport::findTreeRootObject(object)->contentBoxRect();
-
- FloatRect clampedAbsoluteTileBoundaries = absoluteTileBoundaries;
- if (clampedAbsoluteTileBoundaries.width() > contentBoxRect.width())
- clampedAbsoluteTileBoundaries.setWidth(contentBoxRect.width());
-
- if (clampedAbsoluteTileBoundaries.height() > contentBoxRect.height())
- clampedAbsoluteTileBoundaries.setHeight(contentBoxRect.height());
-
OwnPtr<ImageBuffer> tileImage;
if (!SVGImageBufferTools::createImageBuffer(absoluteTileBoundaries, clampedAbsoluteTileBoundaries, tileImage, ColorSpaceDeviceRGB))
@@ -268,8 +259,8 @@
ASSERT(tileImageContext);
// The image buffer represents the final rendered size, so the content has to be scaled (to avoid pixelation).
- tileImageContext->scale(FloatSize(absoluteTileBoundaries.width() / tileBoundaries.width(),
- absoluteTileBoundaries.height() / tileBoundaries.height()));
+ tileImageContext->scale(FloatSize(clampedAbsoluteTileBoundaries.width() / tileBoundaries.width(),
+ clampedAbsoluteTileBoundaries.height() / tileBoundaries.height()));
// Apply tile image transformations.
if (!tileImageTransform.isIdentity())
Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.h (96154 => 96155)
--- trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.h 2011-09-27 21:04:04 UTC (rev 96154)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.h 2011-09-27 21:06:17 UTC (rev 96155)
@@ -61,8 +61,9 @@
private:
bool buildTileImageTransform(RenderObject*, const PatternAttributes&, const SVGPatternElement*, FloatRect& patternBoundaries, AffineTransform& tileImageTransform) const;
- PassOwnPtr<ImageBuffer> createTileImage(RenderObject*, const PatternAttributes&, const FloatRect& tileBoundaries,
- const FloatRect& absoluteTileBoundaries, const AffineTransform& tileImageTransform) const;
+ PassOwnPtr<ImageBuffer> createTileImage(const PatternAttributes&, const FloatRect& tileBoundaries,
+ const FloatRect& absoluteTileBoundaries, const AffineTransform& tileImageTransform,
+ FloatRect& clampedAbsoluteTileBoundaries) const;
bool m_shouldCollectPatternAttributes : 1;
PatternAttributes m_attributes;
Modified: trunk/Source/WebCore/rendering/svg/SVGImageBufferTools.cpp (96154 => 96155)
--- trunk/Source/WebCore/rendering/svg/SVGImageBufferTools.cpp 2011-09-27 21:04:04 UTC (rev 96154)
+++ trunk/Source/WebCore/rendering/svg/SVGImageBufferTools.cpp 2011-09-27 21:06:17 UTC (rev 96155)
@@ -28,6 +28,8 @@
#include "RenderSVGContainer.h"
#include "RenderSVGRoot.h"
+static float kMaxImageBufferSize = 4096;
+
namespace WebCore {
static AffineTransform& currentContentTransformation()
@@ -113,13 +115,16 @@
return IntSize(static_cast<int>(lroundf(size.width())), static_cast<int>(lroundf(size.height())));
}
-FloatRect SVGImageBufferTools::clampedAbsoluteTargetRectForRenderer(const RenderObject* renderer, const FloatRect& absoluteTargetRect)
+FloatRect SVGImageBufferTools::clampedAbsoluteTargetRect(const FloatRect& absoluteTargetRect)
{
- ASSERT(renderer);
+ FloatRect clampedAbsoluteTargetRect = absoluteTargetRect;
- const RenderSVGRoot* svgRoot = SVGRenderSupport::findTreeRootObject(renderer);
- FloatRect clampedAbsoluteTargetRect = absoluteTargetRect;
- clampedAbsoluteTargetRect.intersect(svgRoot->frameRect());
+ if (clampedAbsoluteTargetRect.width() > kMaxImageBufferSize)
+ clampedAbsoluteTargetRect.setWidth(kMaxImageBufferSize);
+
+ if (clampedAbsoluteTargetRect.height() > kMaxImageBufferSize)
+ clampedAbsoluteTargetRect.setHeight(kMaxImageBufferSize);
+
return clampedAbsoluteTargetRect;
}
Modified: trunk/Source/WebCore/rendering/svg/SVGImageBufferTools.h (96154 => 96155)
--- trunk/Source/WebCore/rendering/svg/SVGImageBufferTools.h 2011-09-27 21:04:04 UTC (rev 96154)
+++ trunk/Source/WebCore/rendering/svg/SVGImageBufferTools.h 2011-09-27 21:06:17 UTC (rev 96155)
@@ -40,7 +40,7 @@
static void clipToImageBuffer(GraphicsContext*, const AffineTransform& absoluteTransform, const FloatRect& clampedAbsoluteTargetRect, OwnPtr<ImageBuffer>&);
static void calculateTransformationToOutermostSVGCoordinateSystem(const RenderObject*, AffineTransform& absoluteTransform);
- static FloatRect clampedAbsoluteTargetRectForRenderer(const RenderObject*, const FloatRect& absoluteTargetRect);
+ static FloatRect clampedAbsoluteTargetRect(const FloatRect& absoluteTargetRect);
static IntSize roundedImageBufferSize(const FloatSize&);
static void clear2DRotation(AffineTransform&);