Title: [96371] branches/chromium/874
- Revision
- 96371
- Author
- infe...@chromium.org
- Date
- 2011-09-29 15:42:03 -0700 (Thu, 29 Sep 2011)
Log Message
Merge 96151 - Rapidly refreshing a feMorphology[erode] with r=0 can sometimes cause display corruption
BUG=98161
Review URL: http://codereview.chromium.org/8082012
Modified Paths
Added Paths
Diff
Copied: branches/chromium/874/LayoutTests/svg/filters/feMorphology-zero-radius-expected.png (from rev 96151, trunk/LayoutTests/svg/filters/feMorphology-zero-radius-expected.png)
(Binary files differ)
Copied: branches/chromium/874/LayoutTests/svg/filters/feMorphology-zero-radius-expected.txt (from rev 96151, trunk/LayoutTests/svg/filters/feMorphology-zero-radius-expected.txt) (0 => 96371)
--- branches/chromium/874/LayoutTests/svg/filters/feMorphology-zero-radius-expected.txt (rev 0)
+++ branches/chromium/874/LayoutTests/svg/filters/feMorphology-zero-radius-expected.txt 2011-09-29 22:42:03 UTC (rev 96371)
@@ -0,0 +1 @@
+
Copied: branches/chromium/874/LayoutTests/svg/filters/feMorphology-zero-radius.svg (from rev 96151, trunk/LayoutTests/svg/filters/feMorphology-zero-radius.svg) (0 => 96371)
--- branches/chromium/874/LayoutTests/svg/filters/feMorphology-zero-radius.svg (rev 0)
+++ branches/chromium/874/LayoutTests/svg/filters/feMorphology-zero-radius.svg 2011-09-29 22:42:03 UTC (rev 96371)
@@ -0,0 +1,30 @@
+<svg id="svg" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
+<title>The entire image should be white.</title>
+<defs>
+ <filter id="morph">
+ <feMorphology operator="erode" radius="0"/>
+ </filter>
+</defs>
+<script>
+ <![CDATA[
+ for(var i = 0; i < 100; i+=5)
+ {
+ for(var j = 0; j < 100; j+=5)
+ {
+ var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
+ rect.setAttribute("x", i);
+ rect.setAttribute("y", j);
+ rect.setAttribute("width", "5");
+ rect.setAttribute("height", "5");
+ rect.setAttribute("filter", "url(#morph)");
+
+ document.getElementById("svg").appendChild(rect);
+ }
+ }
+
+ if (window.layoutTestController)
+ window.layoutTestController.dumpAsText();
+ ]]>
+</script>
+
+</svg>
Modified: branches/chromium/874/Source/_javascript_Core/wtf/ByteArray.h (96370 => 96371)
--- branches/chromium/874/Source/_javascript_Core/wtf/ByteArray.h 2011-09-29 22:39:53 UTC (rev 96370)
+++ branches/chromium/874/Source/_javascript_Core/wtf/ByteArray.h 2011-09-29 22:42:03 UTC (rev 96371)
@@ -70,6 +70,8 @@
unsigned char* data() { return m_data; }
+ void clear() { memset(m_data, 0, m_size); }
+
void deref()
{
if (derefBase()) {
Modified: branches/chromium/874/Source/WebCore/platform/graphics/filters/FEMorphology.cpp (96370 => 96371)
--- branches/chromium/874/Source/WebCore/platform/graphics/filters/FEMorphology.cpp 2011-09-29 22:39:53 UTC (rev 96370)
+++ branches/chromium/874/Source/WebCore/platform/graphics/filters/FEMorphology.cpp 2011-09-29 22:42:03 UTC (rev 96371)
@@ -207,8 +207,10 @@
return;
setIsAlphaImage(in->isAlphaImage());
- if (m_radiusX <= 0 || m_radiusY <= 0)
+ if (m_radiusX <= 0 || m_radiusY <= 0) {
+ dstPixelArray->clear();
return;
+ }
Filter* filter = this->filter();
int radiusX = static_cast<int>(floorf(filter->applyHorizontalScale(m_radiusX)));
Modified: branches/chromium/874/Source/WebCore/platform/graphics/filters/FETurbulence.cpp (96370 => 96371)
--- branches/chromium/874/Source/WebCore/platform/graphics/filters/FETurbulence.cpp 2011-09-29 22:39:53 UTC (rev 96370)
+++ branches/chromium/874/Source/WebCore/platform/graphics/filters/FETurbulence.cpp 2011-09-29 22:42:03 UTC (rev 96371)
@@ -372,8 +372,10 @@
if (!pixelArray)
return;
- if (absolutePaintRect().isEmpty())
+ if (absolutePaintRect().isEmpty()) {
+ pixelArray->clear();
return;
+ }
PaintingData paintingData(m_seed, roundedIntSize(filterPrimitiveSubregion().size()));
initPaint(paintingData);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes