[Webkit-unassigned] [Bug 89865] [Qt] Avoid a deep copy of QImage in GraphicsContext3D::getImageData.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Jun 25 04:10:26 PDT 2012
https://bugs.webkit.org/show_bug.cgi?id=89865
Huang Dongsung <luxtella at company100.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #149270| |review?, commit-queue?
Flag| |
--- Comment #1 from Huang Dongsung <luxtella at company100.net> 2012-06-25 04:10:25 PST ---
Created an attachment (id=149270)
--> (https://bugs.webkit.org/attachment.cgi?id=149270&action=review)
patch
This patch follows BitmapTextureGL::updateContents.
void BitmapTextureGL::updateContents(Image* image, const IntRect& targetRect, const IntPoint& offset)
{
if (!image)
return;
NativeImagePtr frameImage = image->nativeImageForCurrentFrame();
if (!frameImage)
return;
int bytesPerLine;
const char* imageData;
#if PLATFORM(QT)
QImage qtImage;
#if HAVE(QT5)
// With QPA, we can avoid a deep copy.
qtImage = *frameImage->handle()->buffer();
#else
// This might be a deep copy, depending on other references to the pixmap.
qtImage = frameImage->toImage();
#endif
imageData = reinterpret_cast<const char*>(qtImage.constBits());
bytesPerLine = qtImage.bytesPerLine();
#elif USE(CAIRO)
cairo_surface_t* surface = frameImage->surface();
imageData = reinterpret_cast<const char*>(cairo_image_surface_get_data(surface));
bytesPerLine = cairo_image_surface_get_stride(surface);
#endif
updateContents(imageData, targetRect, offset, bytesPerLine);
}
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list