Bug 22186 - [QT] lacks putImageData support in Canvas
: [QT] lacks putImageData support in Canvas
Status: RESOLVED FIXED
: WebKit
WebKit Qt
: 528+ (Nightly build)
: PC All
: P2 Normal
Assigned To:
:
: Qt
:
:
  Show dependency treegraph
 
Reported: 2008-11-11 13:54 PST by
Modified: 2009-03-02 12:32 PST (History)


Attachments
getImageData support (2.83 KB, patch)
2008-11-11 14:02 PST, Dirk Schulze
no flags Review Patch | Details | Formatted Diff | Diff
getImageData support (3.22 KB, patch)
2009-02-03 06:18 PST, Dirk Schulze
no flags Review Patch | Details | Formatted Diff | Diff
getImageData support (3.06 KB, patch)
2009-02-03 12:56 PST, Dirk Schulze
sam: review+
Review Patch | Details | Formatted Diff | Diff
follow up of getImageData (1.49 KB, patch)
2009-02-03 15:48 PST, Dirk Schulze
sam: review+
Review Patch | Details | Formatted Diff | Diff
putImageData support for Qt (3.50 KB, patch)
2009-03-01 00:42 PST, Dirk Schulze
no flags Review Patch | Details | Formatted Diff | Diff
putImageData support for Qt (3.30 KB, patch)
2009-03-02 04:37 PST, Dirk Schulze
no flags Review Patch | Details | Formatted Diff | Diff
putImageData support for Qt (3.77 KB, patch)
2009-03-02 05:56 PST, Dirk Schulze
zecke: review+
Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-11-11 13:54:09 PST
QtWebKit lacks getImageDatat / putImageData support for Canvas.
------- Comment #1 From 2008-11-11 14:02:31 PST -------
Created an attachment (id=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.
------- Comment #2 From 2009-02-03 06:18:58 PST -------
Created an attachment (id=27277) [details]
getImageData support

add getImageData support for qt.
------- Comment #3 From 2009-02-03 12:56:05 PST -------
Created an attachment (id=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 #4 From 2009-02-03 13:04:10 PST -------
(From update of attachment 27284 [details])
r=oliver+sam
------- Comment #5 From 2009-02-03 13:28:58 PST -------
landed getImageData support in r40546.
------- Comment #6 From 2009-02-03 15:48:59 PST -------
Created an attachment (id=27295) [details]
follow up of getImageData

follow up of the getImageData patch above. To call toImage once speeds up getImageData.
------- Comment #7 From 2009-02-04 01:11:29 PST -------
landed follow up in r40559
------- Comment #8 From 2009-02-12 10:59:51 PST -------
Bug gardening: landed, so fixed.
------- Comment #9 From 2009-02-12 11:41:54 PST -------
(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
------- Comment #10 From 2009-03-01 00:42:14 PST -------
Created an attachment (id=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.
------- Comment #11 From 2009-03-02 04:37:59 PST -------
Created an attachment (id=28167) [details]
putImageData support for Qt

make putImageData a bit faster.
------- Comment #12 From 2009-03-02 05:56:46 PST -------
Created an attachment (id=28168) [details]
putImageData support for Qt

more speed-up.
------- Comment #13 From 2009-03-02 06:09:42 PST -------
(From update of attachment 28168 [details])
> + [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.
------- Comment #14 From 2009-03-02 12:32:23 PST -------
landed in 41355.