[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 15:43:17 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 11f34788bdee23a23863be42e359d523705cffcb
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Nov 11 00:48:29 2010 +0000
2010-11-10 Pascal Massimino <pascal.massimino at gmail.com>
Reviewed by Adam Barth.
add test case for png where each row has or hasn't alpha values.
This is to exercise code logic within PNGImageDecoder.cpp
https://bugs.webkit.org/show_bug.cgi?id=49333
* fast/images/png_per_row_alpha_decoding-expected.png: Added.
* fast/images/png_per_row_alpha_decoding-expected.txt: Added.
* fast/images/png_per_row_alpha_decoding.html: Added.
* fast/images/resources/png_per_row_alpha.png: Added.
2010-11-10 Pascal Massimino <pascal.massimino at gmail.com>
Reviewed by Adam Barth.
Simplify the alpha-detection code in png's decoding loop.
https://bugs.webkit.org/show_bug.cgi?id=49333
Added a special test for this case: png_per_row_alpha_decoding.html
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::rowAvailable): modified loop.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 5670ff6..1d882ea 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-11-10 Pascal Massimino <pascal.massimino at gmail.com>
+
+ Reviewed by Adam Barth.
+
+ add test case for png where each row has or hasn't alpha values.
+ This is to exercise code logic within PNGImageDecoder.cpp
+
+ https://bugs.webkit.org/show_bug.cgi?id=49333
+
+ * fast/images/png_per_row_alpha_decoding-expected.png: Added.
+ * fast/images/png_per_row_alpha_decoding-expected.txt: Added.
+ * fast/images/png_per_row_alpha_decoding.html: Added.
+ * fast/images/resources/png_per_row_alpha.png: Added.
+
2010-11-10 Dan Bernstein <mitz at apple.com>
Reviewed by Simon Fraser.
diff --git a/LayoutTests/fast/images/png_per_row_alpha_decoding-expected.png b/LayoutTests/fast/images/png_per_row_alpha_decoding-expected.png
new file mode 100644
index 0000000..fb55e10
Binary files /dev/null and b/LayoutTests/fast/images/png_per_row_alpha_decoding-expected.png differ
diff --git a/LayoutTests/fast/images/png_per_row_alpha_decoding-expected.txt b/LayoutTests/fast/images/png_per_row_alpha_decoding-expected.txt
new file mode 100644
index 0000000..bf527ed
--- /dev/null
+++ b/LayoutTests/fast/images/png_per_row_alpha_decoding-expected.txt
@@ -0,0 +1,7 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584 [bgcolor=#808080]
+ RenderImage {IMG} at (0,0) size 2x10
+ RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/fast/images/png_per_row_alpha_decoding.html b/LayoutTests/fast/images/png_per_row_alpha_decoding.html
new file mode 100644
index 0000000..d378a9e
--- /dev/null
+++ b/LayoutTests/fast/images/png_per_row_alpha_decoding.html
@@ -0,0 +1,5 @@
+<html>
+<body bgcolor='#808080'>
+<img src="resources/png_per_row_alpha.png">
+</body>
+</html>
diff --git a/LayoutTests/fast/images/resources/png_per_row_alpha.png b/LayoutTests/fast/images/resources/png_per_row_alpha.png
new file mode 100644
index 0000000..d8aa6a2
Binary files /dev/null and b/LayoutTests/fast/images/resources/png_per_row_alpha.png differ
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 84b92ba..ad025e5 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-11-10 Pascal Massimino <pascal.massimino at gmail.com>
+
+ Reviewed by Adam Barth.
+
+ Simplify the alpha-detection code in png's decoding loop.
+ https://bugs.webkit.org/show_bug.cgi?id=49333
+
+ Added a special test for this case: png_per_row_alpha_decoding.html
+
+ * platform/image-decoders/png/PNGImageDecoder.cpp:
+ (WebCore::PNGImageDecoder::rowAvailable): modified loop.
+
2010-11-10 Dan Bernstein <mitz at apple.com>
Reviewed by Simon Fraser.
diff --git a/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp b/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
index e4f7a0c..193527b 100644
--- a/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
@@ -395,16 +395,15 @@ void PNGImageDecoder::rowAvailable(unsigned char* rowBuffer, unsigned rowIndex,
// Check that the row is within the image bounds. LibPNG may supply an extra row.
if (destY < 0 || destY >= scaledSize().height())
return;
- bool sawAlpha = buffer.hasAlpha();
+ bool nonTrivialAlpha = false;
for (int x = 0; x < width; ++x) {
png_bytep pixel = row + (m_scaled ? m_scaledColumns[x] : x) * colorChannels;
unsigned alpha = hasAlpha ? pixel[3] : 255;
buffer.setRGBA(x, destY, pixel[0], pixel[1], pixel[2], alpha);
- if (!sawAlpha && alpha < 255) {
- sawAlpha = true;
- buffer.setHasAlpha(true);
- }
+ nonTrivialAlpha |= alpha < 255;
}
+ if (nonTrivialAlpha && !buffer.hasAlpha())
+ buffer.setHasAlpha(nonTrivialAlpha);
}
void PNGImageDecoder::pngComplete()
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list