Title: [135976] trunk/Source/WebCore
- Revision
- 135976
- Author
- [email protected]
- Date
- 2012-11-27 21:41:24 -0800 (Tue, 27 Nov 2012)
Log Message
Optimization in image decoding
https://bugs.webkit.org/show_bug.cgi?id=88424
Patch by Viatcheslav Ostapenko <[email protected]> on 2012-11-27
Reviewed by Brent Fulgham.
Optimization in image decoding.
Reduce branching and multiplications in GIF image decoding loops and functions.
Rebase and update of original patch by Misha Tyutyunik <[email protected]>
Covered by existing tests.
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::haveDecodedRow):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (135975 => 135976)
--- trunk/Source/WebCore/ChangeLog 2012-11-28 05:39:03 UTC (rev 135975)
+++ trunk/Source/WebCore/ChangeLog 2012-11-28 05:41:24 UTC (rev 135976)
@@ -1,3 +1,19 @@
+2012-11-27 Viatcheslav Ostapenko <[email protected]>
+
+ Optimization in image decoding
+ https://bugs.webkit.org/show_bug.cgi?id=88424
+
+ Reviewed by Brent Fulgham.
+
+ Optimization in image decoding.
+ Reduce branching and multiplications in GIF image decoding loops and functions.
+ Rebase and update of original patch by Misha Tyutyunik <[email protected]>
+
+ Covered by existing tests.
+
+ * platform/image-decoders/gif/GIFImageDecoder.cpp:
+ (WebCore::GIFImageDecoder::haveDecodedRow):
+
2012-11-27 Michael Saboff <[email protected]>
TextIterator unnecessarily converts 8 bit strings to 16 bits
@@ -8610,7 +8626,7 @@
Unreviewed. Fix Chromium Win compilation after r135255.
https://bugs.webkit.org/show_bug.cgi?id=97803
- * WebCore.gypi: removed reference to platform/wince/DragDataWince.cpp which
+ * WebCore.gypi: removed reference to platform/wince/DragDataWince.cpp which
was deleted in the aforementioned change.
2012-11-19 Kentaro Hara <[email protected]>
Modified: trunk/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp (135975 => 135976)
--- trunk/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp 2012-11-28 05:39:03 UTC (rev 135975)
+++ trunk/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp 2012-11-28 05:41:24 UTC (rev 135976)
@@ -230,12 +230,13 @@
if ((buffer.status() == ImageFrame::FrameEmpty) && !initFrameBuffer(frameIndex))
return false;
+ ImageFrame::PixelData* currentAddress = buffer.getAddr(xBegin, yBegin);
// Write one row's worth of data into the frame.
for (int x = xBegin; x < xEnd; ++x) {
const unsigned char sourceValue = *(rowBuffer + (m_scaled ? m_scaledColumns[x] : x) - frameReader->x_offset);
if ((!frameReader->is_transparent || (sourceValue != frameReader->tpixel)) && (sourceValue < colorMapSize)) {
const size_t colorIndex = static_cast<size_t>(sourceValue) * 3;
- buffer.setRGBA(x, yBegin, colorMap[colorIndex], colorMap[colorIndex + 1], colorMap[colorIndex + 2], 255);
+ buffer.setRGBA(currentAddress, colorMap[colorIndex], colorMap[colorIndex + 1], colorMap[colorIndex + 2], 255);
} else {
m_currentBufferSawAlpha = true;
// We may or may not need to write transparent pixels to the buffer.
@@ -246,8 +247,9 @@
// beyond the first, or the initial passes will "show through" the
// later ones.
if (writeTransparentPixels)
- buffer.setRGBA(x, yBegin, 0, 0, 0, 0);
+ buffer.setRGBA(currentAddress, 0, 0, 0, 0);
}
+ ++currentAddress;
}
// Tell the frame to copy the row data if need be.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes