Changeset 70424 in webkit
- Timestamp:
- Oct 24, 2010 2:08:20 PM (13 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r70421 r70424 1 2010-10-24 Andreas Kling <kling@webkit.org> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] ImageBuffer::platformTransformColorSpace is unnecessarily slow 6 https://bugs.webkit.org/show_bug.cgi?id=48211 7 8 Grab the QImage::bits() and do direct access instead of going through 9 QImage::pixel() and QImage::setPixel(). 10 11 This is a performance optimization, so no new tests. 12 13 * platform/graphics/qt/ImageBufferQt.cpp: 14 (WebCore::ImageBuffer::platformTransformColorSpace): 15 1 16 2010-10-24 Dirk Schulze <krit@webkit.org> 2 17 -
trunk/WebCore/platform/graphics/qt/ImageBufferQt.cpp
r70143 r70424 158 158 ASSERT(!image.isNull()); 159 159 160 uchar* bits = image.bits(); 161 const int bytesPerLine = image.bytesPerLine(); 162 160 163 for (int y = 0; y < m_size.height(); ++y) { 161 for (int x = 0; x < m_size.width(); x++) {162 QRgb value = image.pixel(x, y);163 value = qRgba(lookUpTable[qRed(value)],164 lookUpTable[qGreen(value)],165 lookUpTable[q Blue(value)],166 qAlpha(value));167 image.setPixel(x, y, value);164 quint32* scanLine = reinterpret_cast_ptr<quint32*>(bits + y * bytesPerLine); 165 for (int x = 0; x < m_size.width(); ++x) { 166 QRgb& pixel = scanLine[x]; 167 pixel = qRgba(lookUpTable[qRed(pixel)], 168 lookUpTable[qGreen(pixel)], 169 lookUpTable[qBlue(pixel)], 170 qAlpha(pixel)); 168 171 } 169 172 }
Note: See TracChangeset
for help on using the changeset viewer.