Bug 29438
Summary: | [Qt] NPAPI: HBITMAP to QPixmap conversion is slow | ||
---|---|---|---|
Product: | WebKit | Reporter: | Tor Arne Vestbø <vestbo> |
Component: | Plug-ins | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | Normal | CC: | andersca, davidtlwong, kenneth, tonikitoo |
Priority: | P2 | Keywords: | Performance, Qt, QtTriaged |
Version: | 528+ (Nightly build) | ||
Hardware: | Other | ||
OS: | Windows XP | ||
Bug Depends on: | |||
Bug Blocks: | 35962 |
Tor Arne Vestbø
banner uses more CPU time than normal browser.
This bug report originated from issue QTBUG-4251
<http://bugreports.qt.nokia.com/browse/QTBUG-4251>
--- Description ---
Simple test application (source attached) shows webpage with flash
banner. Unfortunately it uses much more CPU time than normal browser
which shows same page (Internet Explorer, Mozilla Firefox, Safari).
We analysed application using DevPartner profiler and it shows that
problem is with QT and WebKit integration.
Application spend lot of time in function QPixmap::fromWinHBITMAP() in
GraphicsContext::releaseWindowsContext()
(C:\Qt\4.5.2\src\3rdparty\webkit\WebCore\platform\graphics\GraphicsContext.cpp).
We analysed releaseWindowsContext() function and think that translation
from HDC to QPixmap is not optimal solution. Source code below:
GraphicsContext::releaseWindowsContext()
...
HBITMAP bitmap = static_cast<HBITMAP>(GetCurrentObject(hdc, OBJ_BITMAP));
BITMAP info;
GetObject(bitmap, sizeof(info), &info);
ASSERT(info.bmBitsPixel == 32);
QPixmap pixmap = QPixmap::fromWinHBITMAP(bitmap, supportAlphaBlend ?
QPixmap::PremultipliedAlpha : QPixmap::NoAlpha);
m_data->p()->drawPixmap(dstRect, pixmap);
We think that it will be better to draw HDC directly on the screen
without translation to QPixmap.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Kenneth Rohde Christiansen
This seems Windows related, I'm changing platform to Windows from Mac OS X
David T. L. Wong
Is it similar problem of https://bugs.webkit.org/show_bug.cgi?id=24913#c1
?