Summary: | [QT] lacks putImageData support in Canvas | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Dirk Schulze <krit> | ||||||||||||||||
Component: | WebKit Qt | Assignee: | Nobody <webkit-unassigned> | ||||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||||
Severity: | Normal | Keywords: | Qt | ||||||||||||||||
Priority: | P2 | ||||||||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||||||
Hardware: | PC | ||||||||||||||||||
OS: | All | ||||||||||||||||||
Attachments: |
|
Description
Dirk Schulze
2008-11-11 13:54:09 PST
Created attachment 25053 [details] getImageData support This adds getImageData-support to Qt. It fails when the alpha is lower than 255. Don't know if it is a problem of the calculation, this bug: https://bugs.webkit.org/show_bug.cgi?id=20079 or if the alpha-value is allways 255 from translating a QPixmap to a QImage. Created attachment 27277 [details]
getImageData support
add getImageData support for qt.
Created attachment 27284 [details]
getImageData support
use qt to convert to QImage::Format_ARGB32 instead of premultiplied colors. Added a check, if the default qimage format (premultiplied colors) changes.
Comment on attachment 27284 [details]
getImageData support
r=oliver+sam
Created attachment 27295 [details]
follow up of getImageData
follow up of the getImageData patch above. To call toImage once speeds up getImageData.
Bug gardening: landed, so fixed. (In reply to comment #8) > Bug gardening: landed, so fixed. No. Just getImageData was landed. putImageData is missing. I'll upload a patch soon and rename the summary Created attachment 28135 [details]
putImageData support for Qt
putImageData support. I'm not sure if I have to premultiply the Image before I copy the image to the pixmap. I do it for now.
Created attachment 28167 [details]
putImageData support for Qt
make putImageData a bit faster.
Created attachment 28168 [details]
putImageData support for Qt
more speed-up.
Comment on attachment 28168 [details] putImageData support for Qt > + [QT] lacks putImageData support in Canvas Qt please. > + unsigned char* srcRows = source->data()->data()->data() + originy * srcBytesPerRow + originx * 4; > + for (int y = 0; y < numRows; ++y) { > + quint32* scanLine = reinterpret_cast<quint32*>(image.scanLine(y + desty)); > + for (int x = 0; x < numColumns; x++) { > + int basex = x * 4; > + > + scanLine[x + destx] = reinterpret_cast<quint32*>(srcRows + basex)[0]; > + } > + srcRows += srcBytesPerRow; > + } > + m_data.m_pixmap = QPixmap::fromImage(image); weird spacing here... extra line in the for/for... but not at the end of the loops.. > + if (isPainting) > + m_data.m_painter->begin(&m_data.m_pixmap); > } and the naming is really weird here..: endy,endx vs. endY, endX srcRows vs. srcRow.. but all this is coming from the CG variant so I will put it back my complains... just change the spacing and QT... thanks for removing the last notImplemented from there. landed in 41355. |